Comments
Patch
@@ -2474,12 +2474,10 @@ def revert(ui, repo, ctx, parents, *pats
(dsremoved, (actions['undelete'], True)),
(clean, (None, False)),
)
for abs, (rel, exact) in sorted(names.items()):
- # hash on file in target manifest (or None if missing from target)
- mfentry = mf.get(abs)
# target file to be touch on disk (relative to cwd)
target = repo.wjoin(abs)
def handle(xlist, dobackup):
xlist[0].append(abs)
if (dobackup and not opts.get('no_backup') and
@@ -2520,23 +2518,10 @@ def revert(ui, repo, ctx, parents, *pats
# parent is target, no changes mean no changes
if node == parent:
if exact:
ui.warn(_('no changes needed to %s\n') % rel)
continue
- # no change in dirstate but parent and target may differ
- if pmf is None:
- # only need parent manifest in this unlikely case,
- # so do not read by default
- pmf = repo[parent].manifest()
- if abs in pmf and mfentry:
- # if version of file is same in parent and target
- # manifests, do nothing
- if (pmf[abs] != mfentry or
- pmf.flags(abs) != mf.flags(abs)):
- handle(actions['revert'], False)
- else:
- handle(actions['remove'], False)
if not opts.get('dry_run'):
_performrevert(repo, parents, ctx, actions)
if targetsubs: