Mercurial > public > mercurial-scm > hg
comparison mercurial/merge.py @ 8742:a964ab624385
merge: allow merging going backwards
New behavior is generally superior and more correct, except possibly
with regards to missing files. hg up . is now effectively a no-op,
which is probably the desired behavior for people expecting to move to
tip, but may surprise people who were expecting deleted files to
reappear.
case 1: update to .
a-w -> a-w
classic: ancestor a
missing recreated right?
rmed recreated WRONG
added forgotten WRONG
changed preserved RIGHT
conflicted can't happen
backward merge: ancestor a (NO EFFECT)
missing missing wrong?
rm'ed rm'ed RIGHT
added preserved RIGHT
changed preserved RIGHT
conflicted can't happen
case 2: update to ancestor of .
a-b-w -> b-w
\
a
classic: ancestor a
missing recreated right?
rmed recreated wrong?
added forgotten wrong?
changed preserved RIGHT
conflicted preserved wrong?
backwards merge: ancestor b
missing missing or conflict right?
rm'ed missing or conflict right?
changed preserved RIGHT
conflicted merge RIGHT
added preserved right?
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 08 Jun 2009 18:14:44 -0500 |
parents | e592180ba435 |
children | a8d5af707656 |
comparison
equal
deleted
inserted
replaced
8741:e592180ba435 | 8742:a964ab624385 |
---|---|
129 repo.ui.debug(_(" overwrite %s partial %s\n") % (overwrite, bool(partial))) | 129 repo.ui.debug(_(" overwrite %s partial %s\n") % (overwrite, bool(partial))) |
130 repo.ui.debug(_(" ancestor %s local %s remote %s\n") % (pa, p1, p2)) | 130 repo.ui.debug(_(" ancestor %s local %s remote %s\n") % (pa, p1, p2)) |
131 | 131 |
132 m1 = p1.manifest() | 132 m1 = p1.manifest() |
133 m2 = p2.manifest() | 133 m2 = p2.manifest() |
134 ma = pa.manifest() | |
135 backwards = (pa == p2) | 134 backwards = (pa == p2) |
136 | 135 |
137 if backwards or overwrite: | 136 if overwrite: |
138 ma = m1 | 137 ma = m1 |
138 elif backwards: | |
139 ma = p1.p1().manifest() | |
140 else: | |
141 ma = pa.manifest() | |
139 | 142 |
140 action = [] | 143 action = [] |
141 copy, copied, diverge = {}, {}, {} | 144 copy, copied, diverge = {}, {}, {} |
142 | 145 |
143 def fmerge(f, f2, fa): | 146 def fmerge(f, f2, fa): |