Is the "backport" workflow changing to another Mercurial (Hg) branch?

We have two heads. One of them is our main head of development, and the other is the one that I forgot about to this day. We found a bug and fixed it in our main development branch, and I just realized that it needed to be fixed in the old branch too.

I think it would be better to make changes to the old branch and combine this with the updated branch, but we did not. Can it use mercury? We did not try to do anything like that, and I cannot wrap myself around how this will be done.

+11
version-control branch mercurial cherry-pick
Apr 23 2018-12-21T00:
source share
1 answer

Yes, you have two good options:

Graft: New in Mercurial 2.0

This version introduces the transplant team, which can support intelligent change. The "intelligence" is that it will use the merges inside, which means that you get

  • Renaming support: Imagine that you fixed a bug in the foo.c file in the development branch. In the older service branch, foo.c was called by bar.c Using hg graft , the change to foo.c can be correctly merged into the old bar.c

  • Three-way mergers: An anchor involves twisting the chart around and merging on this timeline. The advantage of tripartite mergers is that you can use your regular graphical merge tool to resolve conflicts.

To copy the tip of default to old-branch , you simply run

 $ hg update old-branch $ hg graft default 

Transplantation: Older Versions

Before we got a transplant command, way

Transplant use is simple:

 $ hg update old-branch $ hg transplant default 

It is very close to launch.

 $ hg update old-branch $ hg export default | hg import - 

except that the graft also adds a piece of metadata that records the original set of changes in the transplanted set of changes. This can be used to skip future transplants.

+14
Apr 24 '12 at 7:22
source share



All Articles