[darcs-users] An example of a "complicated" change?

Trent W. Buck trentbuck at gmail.com
Tue Apr 14 05:38:17 UTC 2009


Guillaume Hoffmann <guillaumh at gmail.com> writes:

> Simple: you have 3 repos A, B and C, A being the "central", B and C
> being "sons" of A.
>
> Assume B and C have a list of independent changes made above a common
> history present in A. Then, when you want to propagage these histories
> between B and C, you have to create "merge patches" that explicitely
> do the operation. This happens in Git, Mercurial and Bazaar, with Git
> having the advantage of creating the merge patch automatically.

AFAIK...

In both git and hg, the merge patch is automatically create *if and only
if* a simple three-way merge can unify the branches without conflicts.
If there are conflicts, you need to manually resolve them, and record
this resolution as a "merge patch" -- even if there isn't any actual
conflict, and the patch is actually the null patch.

To further confuse matters, "hg log" and "hg diff" claim that the merge
patch contains not only the conflict resolution, but *EVERY* change that
has happened to EITHER branch since the point of divergence.  For this
reason, I just gave up trying to review incoming hg patches in the way
that we do here on darcs-users.  (Possibly there is an option to "fix"
the log/diff operations, and I'm simply unaware of it.)

Note that the primitive operation is "hg pull", and that "hg fetch" is a
wrapper that runs "hg pull", "hg update" and if the 3-way merge didn't
conflict, "hg commit -m 'auto merge'".  In git, "git pull" is the
wrapper AFAIK.

This complication of having two primitive commands and then a wrapper on
top is necessary because the working tree in an hg/git repo can be
"updated" indepenently of the set of patches in that repo, so e.g. the
repo can have revisions up to r500, but the working tree can be "at"
r250.  Darcs users do this by making a branch and deleting patches from
it, e.g. "darcs get --tag 2.0 $PWD $PWD-2.0".



More information about the darcs-users mailing list