##// END OF EJS Templates
with: use context manager for lock in histedit cleanupnode
Bryan O'Sullivan -
r27833:321759df default
parent child Browse files
Show More
@@ -1471,9 +1471,7 b' def cleanupnode(ui, repo, name, nodes):'
1471 The set of node to strip may contains unknown nodes."""
1471 The set of node to strip may contains unknown nodes."""
1472 ui.debug('should strip %s nodes %s\n' %
1472 ui.debug('should strip %s nodes %s\n' %
1473 (name, ', '.join([node.short(n) for n in nodes])))
1473 (name, ', '.join([node.short(n) for n in nodes])))
1474 lock = None
1474 with repo.lock():
1475 try:
1476 lock = repo.lock()
1477 # do not let filtering get in the way of the cleanse
1475 # do not let filtering get in the way of the cleanse
1478 # we should probably get rid of obsolescence marker created during the
1476 # we should probably get rid of obsolescence marker created during the
1479 # histedit, but we currently do not have such information.
1477 # histedit, but we currently do not have such information.
@@ -1488,8 +1486,6 b' def cleanupnode(ui, repo, name, nodes):'
1488 # but this trigger a bug in changegroup hook.
1486 # but this trigger a bug in changegroup hook.
1489 # This would reduce bundle overhead
1487 # This would reduce bundle overhead
1490 repair.strip(ui, repo, c)
1488 repair.strip(ui, repo, c)
1491 finally:
1492 release(lock)
1493
1489
1494 def stripwrapper(orig, ui, repo, nodelist, *args, **kwargs):
1490 def stripwrapper(orig, ui, repo, nodelist, *args, **kwargs):
1495 if isinstance(nodelist, str):
1491 if isinstance(nodelist, str):
General Comments 0
You need to be logged in to leave comments. Login now