copy a single file from one branch to another| pseudo conflict in a merge
Matt Harbison
mharbison72 at gmail.com
Tue Jul 16 01:48:28 UTC 2019
(Please don't drop the CC line when replying- gmane is missing some emails
in this thread)
> On Sun, 14 Jul 2019 01:36:53 -0400, Uwe Brauer <oub at mat.ucm.es> wrote:
>
> By the way, what to do think of adding some features to merge,Commit for
> example allows me to exclude or include files, so maybe merge
> could offer the option of selecting files the same way, for example
> hg up default
> hg merge feature -f file1 -r default
> or
> hg merge feature -f file1 -r feature
>
> Which would mean for file1 don't merge but take either the version of
> the default or the feature branch.
> (The questions is what syntax to use if you have a bunch of files but I
> would approach this the same way ashg commit -X
Merging is a commit level thing, so you can't exclude files. What you can
do is control how they are resolved. You do have some degree of control
over this from the command line. See `hg help config.merge-patterns`.
The sample implies setting it in the config file (and you can do that),
but on the command line, add `--config merge-patterns=...`.
The other half of the equation is selecting the right merge tool for the
pattern. See `hg help merge-tools`. I didn't try it myself, but you're
probably interested in either `:local` or `:remote`, depending on your
situation. I vaguely remember that there's some gotcha here like the
merge tool is only used if the file changed on *both* sides. That is, if
it only changed in the other branch, using `:local` won't keep those
changes out of the working directory. You'll have to revert that.
More information about the Mercurial
mailing list