dummy merge (two branches) for dummies

Simon King simon at simonking.org.uk
Fri Aug 19 10:38:21 UTC 2016


On Fri, Aug 19, 2016 at 10:21 AM, Kastner Masilko, Friedrich
<friedrich.kastnermasilko at festo.com> wrote:
>> From: Mercurial [mailto:mercurial-bounces at mercurial-scm.org] On Behalf Of Uwe Brauer
>>
>>     > 2) hg update foo
>>     >    hg debugsetparents uwe foo
>>     >    hg branch uwe
>> nitpicking that should be hg merge uwe ? :-D
>>
>>     >    hg commit -m "Merge using debugsetparents"
>
> The nitpick is wrong. It really should be "hg branch uwe", because that's the only thing that should be changed in the dirstate after the initial update to foo: the branch name. Everything else should stay as it is. As I wrote before, my initial post was wrong in the order of arguments of debugsetparents. Since you are at "foo", that should also be the first argument in the parents list, otherwise Mercurial would get quite confused and produce what Mischa Becker pointed out.
>
> So the proper chain is:
> hg update foo
> hg debugsetparents foo uwe
> hg branch uwe
> hg commit -m "Merge"
>
> This will give you a merge commit that has the exact same content as the foo revision.
>

...but these sorts of complexities are exactly why debugXX commands
are not part of the public hg interface. I would suggest that Uwe uses
Matt's original suggestion, which is clear and will always work, no
matter whether you use branches, bookmarks or anonymous heads.

Simon



More information about the Mercurial mailing list