##// END OF EJS Templates
localrepo: use context manager for locks in commit()...
Martin von Zweigbergk -
r41399:b87a009d default
parent child Browse files
Show More
@@ -2409,11 +2409,8 b' class localrepository(object):'
2409 match.explicitdir = vdirs.append
2409 match.explicitdir = vdirs.append
2410 match.bad = fail
2410 match.bad = fail
2411
2411
2412 wlock = lock = None
2412 # lock() for recent changelog (see issue4368)
2413 try:
2413 with self.wlock(), self.lock():
2414 wlock = self.wlock()
2415 lock = self.lock() # for recent changelog (see issue4368)
2416
2417 wctx = self[None]
2414 wctx = self[None]
2418 merge = len(wctx.parents()) > 1
2415 merge = len(wctx.parents()) > 1
2419
2416
@@ -2485,9 +2482,6 b' class localrepository(object):'
2485 _('note: commit message saved in %s\n') % msgfn)
2482 _('note: commit message saved in %s\n') % msgfn)
2486 raise
2483 raise
2487
2484
2488 finally:
2489 lockmod.release(lock, wlock)
2490
2491 def commithook(node=hex(ret), parent1=hookp1, parent2=hookp2):
2485 def commithook(node=hex(ret), parent1=hookp1, parent2=hookp2):
2492 # hack for command that use a temporary commit (eg: histedit)
2486 # hack for command that use a temporary commit (eg: histedit)
2493 # temporary commit got stripped before hook release
2487 # temporary commit got stripped before hook release
General Comments 0
You need to be logged in to leave comments. Login now