##// END OF EJS Templates
copies: consider nullrev a common ancestor...
Martin von Zweigbergk -
r41437:b80af070 default
parent child Browse files
Show More
@@ -31,7 +31,6 b' def _findlimit(repo, a, b):'
31 31 Generally, this means finding the earliest revision number that's an
32 32 ancestor of a or b but not both, except when a or b is a direct descendent
33 33 of the other, in which case we can return the minimum revnum of a and b.
34 None if no such revision exists.
35 34 """
36 35
37 36 # basic idea:
@@ -55,7 +54,6 b' def _findlimit(repo, a, b):'
55 54 visit = [-a, -b]
56 55 heapq.heapify(visit)
57 56 interesting = len(visit)
58 hascommonancestor = False
59 57 limit = node.wdirrev
60 58
61 59 while interesting:
@@ -64,9 +62,9 b' def _findlimit(repo, a, b):'
64 62 parents = [cl.rev(p) for p in repo.dirstate.parents()]
65 63 else:
66 64 parents = cl.parentrevs(r)
65 if parents[1] == node.nullrev:
66 parents = parents[:1]
67 67 for p in parents:
68 if p < 0:
69 continue
70 68 if p not in side:
71 69 # first time we see p; add it to visit
72 70 side[p] = side[r]
@@ -77,14 +75,10 b' def _findlimit(repo, a, b):'
77 75 # p was interesting but now we know better
78 76 side[p] = 0
79 77 interesting -= 1
80 hascommonancestor = True
81 78 if side[r]:
82 79 limit = r # lowest rev visited
83 80 interesting -= 1
84 81
85 if not hascommonancestor:
86 return None
87
88 82 # Consider the following flow (see test-commit-amend.t under issue4405):
89 83 # 1/ File 'a0' committed
90 84 # 2/ File renamed from 'a0' to 'a1' in a new commit (call it 'a1')
@@ -169,8 +163,6 b' def _committedforwardcopies(a, b, match)'
169 163 dbg('debug.copies: looking into rename from %s to %s\n'
170 164 % (a, b))
171 165 limit = _findlimit(repo, a.rev(), b.rev())
172 if limit is None:
173 limit = node.nullrev
174 166 if debug:
175 167 dbg('debug.copies: search limit: %d\n' % limit)
176 168 am = a.manifest()
@@ -465,9 +457,6 b' def _fullcopytracing(repo, c1, c2, base)'
465 457 tca = _c1.ancestor(_c2)
466 458
467 459 limit = _findlimit(repo, c1.rev(), c2.rev())
468 if limit is None:
469 # no common ancestor, no copies
470 return {}, {}, {}, {}, {}
471 460 repo.ui.debug(" searching for copies back to rev %d\n" % limit)
472 461
473 462 m1 = c1.manifest()
General Comments 0
You need to be logged in to leave comments. Login now