# HG changeset patch # User Bryan O'Sullivan # Date 1452892489 28800 # Node ID a33c1c9e769c571c8b049821aa03a4475636dd2c # Parent 4133a306606c82195594c2cdf56d088b5db48274 with: use context manager in merge update diff -r 4133a306606c -r a33c1c9e769c mercurial/merge.py --- a/mercurial/merge.py Fri Jan 15 13:14:49 2016 -0800 +++ b/mercurial/merge.py Fri Jan 15 13:14:49 2016 -0800 @@ -1360,7 +1360,6 @@ """ onode = node - wlock = repo.wlock() # If we're doing a partial update, we need to skip updating # the dirstate, so make a note of any partial-ness to the # update here. @@ -1368,7 +1367,7 @@ partial = False else: partial = True - try: + with repo.wlock(): wc = repo[None] pl = wc.parents() p1 = pl[0] @@ -1541,8 +1540,6 @@ if not branchmerge: repo.dirstate.setbranch(p2.branch()) repo.dirstate.endparentchange() - finally: - wlock.release() if not partial: repo.hook('update', parent1=xp1, parent2=xp2, error=stats[3])