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