tags:

views:

27

answers:

1

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?

+2  A: 

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.

Ry4an
I agree. You cannot properly launch a diff tool with a .rej file alone, or with a patch for that matter. There just isn't enough information there. What you really need to know is what particular changeset the patch is supposed to be applied against. Then you could theoretically write a script to present a merge.