[PATCH 3 of 5] cmdutil: remove useless dirstate.normallookup invocation in revert
FUJIWARA Katsunori
foozy at lares.dti.ne.jp
Wed May 27 12:03:23 CDT 2015
# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1432745859 -32400
# Thu May 28 01:57:39 2015 +0900
# Node ID 883211e892300c7750838a83e849e760fd309003
# Parent b82f32b8734b109b84f533dc62dd3f23195d1e0a
cmdutil: remove useless dirstate.normallookup invocation in revert
Explicit `dirstate.normallookup` invocation in `revert()` is now
useless, because previous patch makes `dirstate.unsureifambig()` be
invoked at the end of `localrepository.wwrite()`.
`dirstate.normallookup()` invocation was introduced by 21b33f0460e0 to
avoid occasional test failure (see issue4583 for detail). This is
partial backout of it (added tests are still left).
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -3098,7 +3098,7 @@
node = ctx.node()
def checkout(f):
fc = ctx[f]
- return repo.wwrite(f, fc.data(), fc.flags())
+ repo.wwrite(f, fc.data(), fc.flags())
audit_path = pathutil.pathauditor(repo.root)
for f in actions['forget'][0]:
@@ -3154,13 +3154,9 @@
del fp
else:
for f in actions['revert'][0]:
- wsize = checkout(f)
+ checkout(f)
if normal:
normal(f)
- elif wsize == repo.dirstate._map[f][2]:
- # changes may be overlooked without normallookup,
- # if size isn't changed at reverting
- repo.dirstate.normallookup(f)
for f in actions['add'][0]:
# Don't checkout modified files, they are already created by the diff
More information about the Mercurial-devel
mailing list