Mercury push of a certain revision

I searched here, but did not find any question related to this. I have a problem like this in mercury: I manage an open source project in a bitbucket, so I have a clone of the source code in my local one. But I also use this project for my own website in real time, so I made 2 clones of a bitbucket replica

Bitbucket Repo
|
==local_clone1
|
==local_clone2-> commit1            => commit2    => commit3
                (personalization)     (bug fix)     (add feature)

The question is, I want to push commit2 and commit3 back to local_clone1, so later I can click on the Bitbucket repository. But you do not want to press commit1, since it has my personal data.

I wonder how we do it in mercurial?

+3
source share
2 answers

. . Mercurial.

, :

  • local_clone2
  • (hg tip ) . 731.
  • hg export 730-731 > ../local_clone1/changes.diff ( )
  • local_clone1
  • hg import changes.diff

, ; .

+5

:

, :

hg init db
cd db
echo >file1
hg ci -Am clone              # rev 0
echo >file2
hg ci -Am personalization    # rev 1
echo >file3
hg ci -Am bugfix             # rev 2
echo >file4
hg ci -Am feature            # rev 3 <tip>

, , "" :

hg backout 1
hg ci -m backout

, , .

mq , :

hg qimport -r 1:3  # convert changesets 1-3 to patches
hg qpop -a         # remove all patches (can't delete an applied patch)
hg qdel 1.diff     # delete rev 1 patch
hg qpush -a        # reapply remaining patches
hg qfin -a         # convert all applied patches back to changesets.

, . , , . .

+1

Source: https://habr.com/ru/post/1774864/


All Articles