Mercurial > public > mercurial-scm > hg
comparison mercurial/context.py @ 33999:be814edf3306
metadataonlyctx: don't crash when reusing the manifest with deletions
This was originally fixed by Mateusz Kwapich for the `metaedit` command in
fb-hgext with a test for the `metaedit` command. It didn't get upstreamed
because `metaedit` was not in core.
This patch fixes the crash and adds a test about `metadataonlyctx` to
avoid future regressions.
Differential Revision: https://phab.mercurial-scm.org/D550
author | Jun Wu <quark@fb.com> |
---|---|
date | Mon, 28 Aug 2017 16:58:59 -0700 |
parents | becce02036e1 |
children | 65ae54582713 |
comparison
equal
deleted
inserted
replaced
33998:becce02036e1 | 33999:be814edf3306 |
---|---|
2369 | 2369 |
2370 modified, added, removed = [], [], [] | 2370 modified, added, removed = [], [], [] |
2371 for f in self._files: | 2371 for f in self._files: |
2372 if not managing(f): | 2372 if not managing(f): |
2373 added.append(f) | 2373 added.append(f) |
2374 elif self[f]: | 2374 elif f in self: |
2375 modified.append(f) | 2375 modified.append(f) |
2376 else: | 2376 else: |
2377 removed.append(f) | 2377 removed.append(f) |
2378 | 2378 |
2379 return scmutil.status(modified, added, removed, [], [], [], []) | 2379 return scmutil.status(modified, added, removed, [], [], [], []) |