Commit direct to other repositories [then pull]

Johan Samyn johan.samyn at gmail.com
Thu Feb 25 14:00:52 CST 2010


2010/2/25 Greg Ward <greg-hg at gerg.ca>:
>
> The usual trick is a dummy merge.  Imagine you go with named branches
> (easier to illustrate):
>
>  hg branch client-ABC       # new branch for new client
>  [...commit happily away...]
>
> Now you have changes on client-ABC that are general purpose and belong
> on the trunk.  No problem:
>
>  hg update default
>  hg merge client-ABC
>  hg commit -m"merge from client-ABC"
>
> But what if those changes on client-ABC are client-specific and should
> not get to the trunk?  Again, not hard:
>
>  hg update default
>  hg debugsetparents . client-ABC
>  hg commit -m"dummy merge with client-ABC to prevent stuff from
> polluting the trunk"
>
> (debugsetparents is a powerful and slightly mysterious command.  Be
> sure you understand what "parents of the working directory" means
> before you use this irrevocably.  ;-)
>
> (Also, the procedure usually advertised for dummy merge is this:
>
>  HGMERGE=internal:local hg merge client-ABC
>  hg revert --all
>  hg commit -m"dummy merge with client-ABC to prevent stuff from
> polluting the trunk"
>
> but I honestly don't understand why people use that when
> debugsetparents is equivalent.)
>

Why don't you add all this to the TipsAndTricks page on the Mercurial
wiki ? Or a separate page on dummy merges there ? I think a lot of
tips go lost by not gathering them on that wiki.


More information about the Mercurial mailing list