# HG changeset patch # User Alexis S. L. Carvalho # Date 2008-02-14 20:08:16 # Node ID 5086576a2152d042f12a7a28f6333a4260a9fefd # Parent 41bb88cb913e96996635c3e2a5329bdd73e90c30 revert: only call dirstate.normal when we know the file is clean diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2329,9 +2329,12 @@ def revert(ui, repo, *pats, **opts): checkout(f) repo.dirstate.add(f) + normal = repo.dirstate.normallookup + if node == parent and p2 == nullid: + normal = repo.dirstate.normal for f in undelete[0]: checkout(f) - repo.dirstate.normal(f) + normal(f) audit_path = util.path_auditor(repo.root) for f in remove[0]: