comparison mercurial/copies.py @ 15976:d1c74c6151c9 stable

copies: eliminate criss-crosses when chaining Before the copies refactoring, we declared that if a and b were present in source and destination, we ignored copies between them. The refactored code could however report b was a copy of a and vice versa in a situation where we looked for differences between two identical changesets that copy a to b. y / x \ y'
author Matt Mackall <mpm@selenic.com>
date Tue, 24 Jan 2012 17:16:29 -0600
parents 91eb4512edd0
children 3c2ce5c2cee0
comparison
equal deleted inserted replaced
15972:341c58282b25 15976:d1c74c6151c9
97 # chain was a rename, not a copy 97 # chain was a rename, not a copy
98 del t[v] 98 del t[v]
99 if v in src: 99 if v in src:
100 # file is a copy of an existing file 100 # file is a copy of an existing file
101 t[k] = v 101 t[k] = v
102
103 # remove criss-crossed copies
104 for k, v in t.items():
105 if k in src and v in dst:
106 print "bad", k, v
107 del t[k]
108
102 return t 109 return t
103 110
104 def _tracefile(fctx, actx): 111 def _tracefile(fctx, actx):
105 '''return file context that is the ancestor of fctx present in actx''' 112 '''return file context that is the ancestor of fctx present in actx'''
106 stop = actx.rev() 113 stop = actx.rev()