comparison hgext/largefiles/overrides.py @ 27826:f087b7095381

with: use context manager for wlock in mergeupdate
author Bryan O'Sullivan <bryano@fb.com>
date Fri, 15 Jan 2016 13:14:47 -0800
parents 4692571df9ee
children ee3123e19db9
comparison
equal deleted inserted replaced
27825:4692571df9ee 27826:f087b7095381
1335 def mergeupdate(orig, repo, node, branchmerge, force, 1335 def mergeupdate(orig, repo, node, branchmerge, force,
1336 *args, **kwargs): 1336 *args, **kwargs):
1337 matcher = kwargs.get('matcher', None) 1337 matcher = kwargs.get('matcher', None)
1338 # note if this is a partial update 1338 # note if this is a partial update
1339 partial = matcher and not matcher.always() 1339 partial = matcher and not matcher.always()
1340 wlock = repo.wlock() 1340 with repo.wlock():
1341 try:
1342 # branch | | | 1341 # branch | | |
1343 # merge | force | partial | action 1342 # merge | force | partial | action
1344 # -------+-------+---------+-------------- 1343 # -------+-------+---------+--------------
1345 # x | x | x | linear-merge 1344 # x | x | x | linear-merge
1346 # o | x | x | branch-merge 1345 # o | x | x | branch-merge
1385 1384
1386 lfcommands.updatelfiles(repo.ui, repo, filelist=filelist, 1385 lfcommands.updatelfiles(repo.ui, repo, filelist=filelist,
1387 normallookup=partial) 1386 normallookup=partial)
1388 1387
1389 return result 1388 return result
1390 finally:
1391 wlock.release()
1392 1389
1393 def scmutilmarktouched(orig, repo, files, *args, **kwargs): 1390 def scmutilmarktouched(orig, repo, files, *args, **kwargs):
1394 result = orig(repo, files, *args, **kwargs) 1391 result = orig(repo, files, *args, **kwargs)
1395 1392
1396 filelist = [lfutil.splitstandin(f) for f in files if lfutil.isstandin(f)] 1393 filelist = [lfutil.splitstandin(f) for f in files if lfutil.isstandin(f)]