Show More
@@ -70,6 +70,9 b' def update(repo, node, branchmerge=False' | |||||
70 | p1, p2 = pl[0], node |
|
70 | p1, p2 = pl[0], node | |
71 | pa = repo.changelog.ancestor(p1, p2) |
|
71 | pa = repo.changelog.ancestor(p1, p2) | |
72 |
|
72 | |||
|
73 | # are we going backwards? | |||
|
74 | backwards = (pa == p2) | |||
|
75 | ||||
73 | # is there a linear path from p1 to p2? |
|
76 | # is there a linear path from p1 to p2? | |
74 | linear_path = (pa == p1 or pa == p2) |
|
77 | linear_path = (pa == p1 or pa == p2) | |
75 | if branchmerge and linear_path: |
|
78 | if branchmerge and linear_path: | |
@@ -154,8 +157,8 b' def update(repo, node, branchmerge=False' | |||||
154 | s = 1 |
|
157 | s = 1 | |
155 | # are we clobbering? |
|
158 | # are we clobbering? | |
156 | # is remote's version newer? |
|
159 | # is remote's version newer? | |
157 | # or are we going back in time? |
|
160 | # or are we going back in time and clean? | |
158 |
elif overwrite or m2[f] != a or ( |
|
161 | elif overwrite or m2[f] != a or (backwards and mw[f] == m1[f]): | |
159 | repo.ui.debug(_(" remote %s is newer, get\n") % f) |
|
162 | repo.ui.debug(_(" remote %s is newer, get\n") % f) | |
160 | get[f] = (m2.execf(f), m2[f]) |
|
163 | get[f] = (m2.execf(f), m2[f]) | |
161 | s = 1 |
|
164 | s = 1 | |
@@ -192,7 +195,7 b' def update(repo, node, branchmerge=False' | |||||
192 | repo.ui.debug(_("remote deleted %s, clobbering\n") % f) |
|
195 | repo.ui.debug(_("remote deleted %s, clobbering\n") % f) | |
193 | remove.append(f) |
|
196 | remove.append(f) | |
194 | elif n == m1.get(f, nullid): # same as parent |
|
197 | elif n == m1.get(f, nullid): # same as parent | |
195 |
if |
|
198 | if backwards: | |
196 | repo.ui.debug(_("remote deleted %s\n") % f) |
|
199 | repo.ui.debug(_("remote deleted %s\n") % f) | |
197 | remove.append(f) |
|
200 | remove.append(f) | |
198 | else: |
|
201 | else: | |
@@ -217,7 +220,7 b' def update(repo, node, branchmerge=False' | |||||
217 | repo.ui.debug(_("remote created %s\n") % f) |
|
220 | repo.ui.debug(_("remote created %s\n") % f) | |
218 | get[f] = (m2.execf(f), n) |
|
221 | get[f] = (m2.execf(f), n) | |
219 | else: |
|
222 | else: | |
220 |
if overwrite or |
|
223 | if overwrite or backwards: | |
221 | repo.ui.debug(_("local deleted %s, recreating\n") % f) |
|
224 | repo.ui.debug(_("local deleted %s, recreating\n") % f) | |
222 | get[f] = (m2.execf(f), n) |
|
225 | get[f] = (m2.execf(f), n) | |
223 | else: |
|
226 | else: |
General Comments 0
You need to be logged in to leave comments.
Login now