Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the most efficient way to handle "hg import" rejects?

Tags:

mercurial

When I import a patch using hg import, the command sometimes creates .rej files.

When a conflict occurs, is there a way to automatically launch the visual merge tool instead of creating the .rej files?

If not, what is the most efficient workflow to process the .rej files?

like image 707
Sylvain Avatar asked Oct 13 '10 18:10

Sylvain


People also ask

What does HG update do?

Use the command hg update to switch to an existing branch. Use hg commit --close-branch to mark this branch head as closed.


1 Answers

It's not quite the answer you're looking fo,r but ideally you avoid the .rej files by improving your workflow to avoid the need to use import.

Here are some common uses for import and better alternatives for each case:

  • cherry picking - when you're using import (or transplant which is just export followed by import) to move changes from one branch to another without moving everything else on that branch you could instead be using merge if you had been more careful about what the parent of that changeset-to-move was. Hindsight is 20/20, of course, but when possible do a hg update to the earliest possible parent of the change you're making (ex: fix bugs in a child changeset of the changeset that introduced the bug) then then only ancestors of the fix is a changeset that exists anywhere the bug exists, and you save safely pull and merge it wherever the bug exists without bringing anything with it -- or needed import.
  • submitted patches - if possible get people working in mercurial clones from which you can pull. Then you'll only need to merge in their work.

There's nothing wrong with import but when possible prefer a pull and merge and with a little foresight you can usually make that possible.

like image 100
Ry4an Brase Avatar answered Oct 10 '22 13:10

Ry4an Brase