##// END OF EJS Templates
copies: return None instead of ChangingFiles when relevant...
marmoute -
r46246:1720d843 default draft
parent child Browse files
Show More
@@ -599,7 +599,7 class changelog(revlog.revlog):
599 l = [hex(manifest), user, parseddate] + sortedfiles + [b"", desc]
599 l = [hex(manifest), user, parseddate] + sortedfiles + [b"", desc]
600 text = b"\n".join(l)
600 text = b"\n".join(l)
601 return self.addrevision(
601 return self.addrevision(
602 text, transaction, len(self), p1, p2, sidedata=sidedata
602 text, transaction, len(self), p1, p2, sidedata=sidedata, flags=flags
603 )
603 )
604
604
605 def branchinfo(self, rev):
605 def branchinfo(self, rev):
@@ -24,6 +24,8 from . import (
24
24
25 from .utils import stringutil
25 from .utils import stringutil
26
26
27 from .revlogutils import flagutil
28
27
29
28 def _filter(src, dst, t):
30 def _filter(src, dst, t):
29 """filters out invalid copies after chaining"""
31 """filters out invalid copies after chaining"""
@@ -179,6 +181,9 def _revinfo_getter(repo):
179 """
181 """
180 cl = repo.changelog
182 cl = repo.changelog
181 parents = cl.parentrevs
183 parents = cl.parentrevs
184 flags = cl.flags
185
186 HASCOPIESINFO = flagutil.REVIDX_HASCOPIESINFO
182
187
183 changelogrevision = cl.changelogrevision
188 changelogrevision = cl.changelogrevision
184
189
@@ -213,7 +218,10 def _revinfo_getter(repo):
213 e = merge_caches.pop(rev, None)
218 e = merge_caches.pop(rev, None)
214 if e is not None:
219 if e is not None:
215 return e
220 return e
216 value = (p1, p2, changelogrevision(rev).changes)
221 changes = None
222 if flags(rev) & HASCOPIESINFO:
223 changes = changelogrevision(rev).changes
224 value = (p1, p2, changes)
217 if p1 != node.nullrev and p2 != node.nullrev:
225 if p1 != node.nullrev and p2 != node.nullrev:
218 # XXX some case we over cache, IGNORE
226 # XXX some case we over cache, IGNORE
219 merge_caches[rev] = value
227 merge_caches[rev] = value
@@ -293,12 +301,15 def _combine_changeset_copies(
293 copies = {}
301 copies = {}
294 for i, c in enumerate(children[r]):
302 for i, c in enumerate(children[r]):
295 p1, p2, changes = revinfo(c)
303 p1, p2, changes = revinfo(c)
304 childcopies = {}
296 if r == p1:
305 if r == p1:
297 parent = 1
306 parent = 1
307 if changes is not None:
298 childcopies = changes.copied_from_p1
308 childcopies = changes.copied_from_p1
299 else:
309 else:
300 assert r == p2
310 assert r == p2
301 parent = 2
311 parent = 2
312 if changes is not None:
302 childcopies = changes.copied_from_p2
313 childcopies = changes.copied_from_p2
303 if not alwaysmatch:
314 if not alwaysmatch:
304 childcopies = {
315 childcopies = {
@@ -313,6 +324,7 def _combine_changeset_copies(
313 source = prev[1]
324 source = prev[1]
314 newcopies[dest] = (c, source)
325 newcopies[dest] = (c, source)
315 assert newcopies is not copies
326 assert newcopies is not copies
327 if changes is not None:
316 for f in changes.removed:
328 for f in changes.removed:
317 if f in newcopies:
329 if f in newcopies:
318 if newcopies is copies:
330 if newcopies is copies:
@@ -373,13 +385,21 def _merge_copies_dict(minor, major, isa
373 # than the branch point or there is a merge
385 # than the branch point or there is a merge
374 if new_tt == other_tt:
386 if new_tt == other_tt:
375 minor[dest] = value
387 minor[dest] = value
376 elif value[1] is None and dest in changes.salvaged:
388 elif (
389 changes is not None
390 and value[1] is None
391 and dest in changes.salvaged
392 ):
377 pass
393 pass
378 elif other[1] is None and dest in changes.salvaged:
394 elif (
395 changes is not None
396 and other[1] is None
397 and dest in changes.salvaged
398 ):
379 minor[dest] = value
399 minor[dest] = value
380 elif not isancestor(new_tt, other_tt):
400 elif not isancestor(new_tt, other_tt):
381 minor[dest] = value
401 minor[dest] = value
382 elif dest in changes.merged:
402 elif changes is not None and dest in changes.merged:
383 minor[dest] = value
403 minor[dest] = value
384
404
385
405
General Comments 0
You need to be logged in to leave comments. Login now