##// END OF EJS Templates
Refactor update locking slightly
Matt Mackall -
r2812:3aeab7bb default
parent child Browse files
Show More
@@ -2606,7 +2606,7 b' def revert(ui, repo, *pats, **opts):'
2606 2606
2607 2607 if not opts.get('dry_run'):
2608 2608 repo.dirstate.forget(forget[0])
2609 r = hg.revert(repo, node, update.has_key)
2609 r = hg.revert(repo, node, update.has_key, wlock)
2610 2610 repo.dirstate.update(add[0], 'a')
2611 2611 repo.dirstate.update(undelete[0], 'n')
2612 2612 repo.dirstate.update(remove[0], 'r')
@@ -220,10 +220,10 b' def merge(repo, node, force=None, remind'
220 220 return _merge.update(repo, node, branchmerge=True, forcemerge=force,
221 221 remind=remind, wlock=wlock)
222 222
223 def revert(repo, node, choose):
223 def revert(repo, node, choose, wlock):
224 224 """revert changes to revision in node without updating dirstate"""
225 225 return _merge.update(repo, node, force=True, partial=choose,
226 show_stats=False)
226 show_stats=False, wlock=wlock)
227 227
228 228 def verify(repo):
229 229 """verify the consistency of a repository"""
@@ -49,6 +49,10 b' def merge3(repo, fn, my, other, p1, p2):'
49 49
50 50 def update(repo, node, branchmerge=False, force=False, partial=None,
51 51 forcemerge=False, wlock=None, show_stats=True, remind=True):
52
53 if not wlock:
54 wlock = repo.wlock()
55
52 56 pl = repo.dirstate.parents()
53 57 if not force and pl[1] != nullid:
54 58 raise util.Abort(_("outstanding uncommitted merges"))
@@ -110,8 +114,6 b' def update(repo, node, branchmerge=False'
110 114 mw[f] = ""
111 115 mfw[f] = util.is_exec(repo.wjoin(f), mfw.get(f, False))
112 116
113 if not partial and not wlock: wlock = repo.wlock()
114
115 117 for f in deleted + removed:
116 118 if f in mw:
117 119 del mw[f]
General Comments 0
You need to be logged in to leave comments. Login now