comparison mercurial/cmdutil.py @ 25755:72d395e399c1

cmdutil: remove useless dirstate.normallookup() invocation in revert() Explicit 'dirstate.normallookup()' invocation in 'revert()' is useless now, because previous patch fixed the relevant issue by writing in-memory dirstate changes out at the end of dirty check. '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).
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 08 Jul 2015 17:01:09 +0900
parents 3dabc9b7494a
children c5dfa47ad7ee
comparison
equal deleted inserted replaced
25754:19cc443aac34 25755:72d395e399c1
3066 """ 3066 """
3067 parent, p2 = parents 3067 parent, p2 = parents
3068 node = ctx.node() 3068 node = ctx.node()
3069 def checkout(f): 3069 def checkout(f):
3070 fc = ctx[f] 3070 fc = ctx[f]
3071 return repo.wwrite(f, fc.data(), fc.flags()) 3071 repo.wwrite(f, fc.data(), fc.flags())
3072 3072
3073 audit_path = pathutil.pathauditor(repo.root) 3073 audit_path = pathutil.pathauditor(repo.root)
3074 for f in actions['forget'][0]: 3074 for f in actions['forget'][0]:
3075 repo.dirstate.drop(f) 3075 repo.dirstate.drop(f)
3076 for f in actions['remove'][0]: 3076 for f in actions['remove'][0]:
3133 except patch.PatchError as err: 3133 except patch.PatchError as err:
3134 raise util.Abort(str(err)) 3134 raise util.Abort(str(err))
3135 del fp 3135 del fp
3136 else: 3136 else:
3137 for f in actions['revert'][0]: 3137 for f in actions['revert'][0]:
3138 wsize = checkout(f) 3138 checkout(f)
3139 if normal: 3139 if normal:
3140 normal(f) 3140 normal(f)
3141 elif wsize == repo.dirstate._map[f][2]:
3142 # changes may be overlooked without normallookup,
3143 # if size isn't changed at reverting
3144 repo.dirstate.normallookup(f)
3145 3141
3146 for f in actions['add'][0]: 3142 for f in actions['add'][0]:
3147 # Don't checkout modified files, they are already created by the diff 3143 # Don't checkout modified files, they are already created by the diff
3148 if f not in newlyaddedandmodifiedfiles: 3144 if f not in newlyaddedandmodifiedfiles:
3149 checkout(f) 3145 checkout(f)