comparison mercurial/copies.py @ 41754:d5edb5d3a337

copies: filter out copies when target is not in destination manifest When chaining a series of commits that copied a file with a series that removed the destination file, we would still include the copy in the result. Similar to the previous patch, I have checked that `hg status --copies` is not affected by this bug, but I wouldn't be surprised if some commands are. Differential Revision: https://phab.mercurial-scm.org/D5989
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 14 Feb 2019 22:46:18 -0800
parents 3158cb74fbca
children 49ad315b39ee
comparison
equal deleted inserted replaced
41753:3158cb74fbca 41754:d5edb5d3a337
122 del t[v] 122 del t[v]
123 if v in src: 123 if v in src:
124 # file is a copy of an existing file 124 # file is a copy of an existing file
125 t[k] = v 125 t[k] = v
126 126
127 # remove criss-crossed copies
128 for k, v in list(t.items()): 127 for k, v in list(t.items()):
128 # remove criss-crossed copies
129 if k in src and v in dst: 129 if k in src and v in dst:
130 del t[k]
131 # remove copies to files that were then removed
132 elif k not in dst:
130 del t[k] 133 del t[k]
131 134
132 return t 135 return t
133 136
134 def _tracefile(fctx, am, limit=node.nullrev): 137 def _tracefile(fctx, am, limit=node.nullrev):