[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-devel] Re: cherrypicking in monotone (was: interesting thread.
From: |
William Uther |
Subject: |
[Monotone-devel] Re: cherrypicking in monotone (was: interesting thread...) |
Date: |
Mon, 11 Dec 2006 12:02:20 +1100 |
Nathaniel Smith wrote:
In case people are interested, there's a nice thread going on over on
the VCS-neutral revctrl@ mailing list about cherrypicking in
monotone-style DAG-of-snapshot systems, DaggyFixes, and more generally
the connection between darcs-style and monotone-style merging:
http://thread.gmane.org/gmane.comp.version-control.revctrl/159
I was hoping to test my ideas and try to implement cherry-picking in
monotone sometime soon. But I got distracted and wrote up http://
revctrl.org/OperationalTransformation instead.
Cherry-picking for monotone:
Assume we're cherry-picking the changes in B-C and merging them into
revision D.
a) Find the ancestor you'd use for three way merge, call it A.
b) Pluck B-C and make a new branch with this change from A. Call the
new revision C'. If there are any conflicts then abort and tell the
user what conflicted - the conflicting revision is a dependency on
what they're trying to pull across and should probably be pulled
across too.
c) either:
i) Modify C so it has C' as a parent, but otherwise no change.
ii) Merge C' and C to make C''. C'' should be identical to C.
Auto-resolve all conflicts in favour of C (there shouldn't be any,
but there may be if you didn't abort in b). Any descendants of C
should then be merged with C'' - this should always be a clean
merge. I am wary of doing this (merging descendants with C'')
automatically though.
d) Merge C' with D and allow the user to resolve conflicts.
The end result is something that looks like http://venge.net/monotone/
wiki/DaggyFixes . But done post-hoc. And it records the history
correctly so that you shouldn't get future conflicts (I think).
Now for the monotone questions... It seems you're using *-merge for
merging (in roster_merge.cc). When it gets a conflict on file
contents then fall back to resolve_merge_conflicts() (in merge.cc).
That first tries to do three-way-merging (in diff_patch.cc), and if
that fails calls out to a lua hook for the user to fix things.
a) I haven't traced much of monotone's three-way-merge yet. I'm
guessing noone has thought about this, but does anyone know how
monotone's merge behaves relative to property TP2 of http://
revctrl.org/OperationalTransformation ? (I was going to have a think
about it, but I thought I'd ask first :)
b) As far as implementing cherry-picking, it seems that the least
common ancestor for merge is found about line 80 of merge.cc. Is
that the right place to be looking?
Cheers,
Will :-}
- [Monotone-devel] Re: cherrypicking in monotone (was: interesting thread...),
William Uther <=