Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/merge.py @ 18895:ed676ed67a5c
manifestmerge: handle workdir removed, remote removed with flags
This can happen when a file with flags is removed or deleted in the working
directory and also not present in m2. The obvious solution is to add a
__delitem__ override to manifestdict that removes the file from flags if
necessary, but that has a significant performance cost in some cases, e.g.
hg status --rev rev1 --rev rev2 <file>.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Wed, 10 Apr 2013 12:34:42 -0700 |
parents | f63035b9b38a |
children | a59e575c6ff8 |
comparison
equal
deleted
inserted
replaced
18894:ed46c2b98b0d | 18895:ed676ed67a5c |
---|---|
244 | 244 |
245 for f, (n12, fl12) in diff12.iteritems(): | 245 for f, (n12, fl12) in diff12.iteritems(): |
246 if n12: | 246 if n12: |
247 n1, n2 = n12 | 247 n1, n2 = n12 |
248 else: # file contents didn't change, but flags did | 248 else: # file contents didn't change, but flags did |
249 n1 = n2 = m1[f] | 249 n1 = n2 = m1.get(f, None) |
250 if n1 is None: | |
251 # Since n1 == n2, the file isn't present in m2 either. This | |
252 # means that the file was removed or deleted locally and | |
253 # removed remotely, but that residual entries remain in flags. | |
254 # This can happen in manifests generated by workingctx. | |
255 continue | |
250 if fl12: | 256 if fl12: |
251 fl1, fl2 = fl12 | 257 fl1, fl2 = fl12 |
252 else: # flags didn't change, file contents did | 258 else: # flags didn't change, file contents did |
253 fl1 = fl2 = m1.flags(f) | 259 fl1 = fl2 = m1.flags(f) |
254 | 260 |