comparison hgext/largefiles/overrides.py @ 27344:43c00ca887d1

merge: have merge.update use a matcher instead of partial fn This is relatively rarely used functionality, but migrating this to a matcher will make future work on narrow clones more feasible.
author Augie Fackler <augie@google.com>
date Mon, 14 Dec 2015 18:54:03 -0500
parents df9b73d2d444
children 98266b1d144d
comparison
equal deleted inserted replaced
27343:c59647c6694d 27344:43c00ca887d1
1362 fpin.close() 1362 fpin.close()
1363 fp.close() 1363 fp.close()
1364 err = 0 1364 err = 0
1365 return err 1365 return err
1366 1366
1367 def mergeupdate(orig, repo, node, branchmerge, force, partial, 1367 def mergeupdate(orig, repo, node, branchmerge, force,
1368 *args, **kwargs): 1368 *args, **kwargs):
1369 matcher = kwargs.get('matcher', None)
1370 # note if this is a partial update
1371 partial = matcher and not matcher.always()
1369 wlock = repo.wlock() 1372 wlock = repo.wlock()
1370 try: 1373 try:
1371 # branch | | | 1374 # branch | | |
1372 # merge | force | partial | action 1375 # merge | force | partial | action
1373 # -------+-------+---------+-------------- 1376 # -------+-------+---------+--------------
1403 lfutil.updatestandin(repo, lfutil.standin(lfile)) 1406 lfutil.updatestandin(repo, lfutil.standin(lfile))
1404 lfdirstate.write() 1407 lfdirstate.write()
1405 1408
1406 oldstandins = lfutil.getstandinsstate(repo) 1409 oldstandins = lfutil.getstandinsstate(repo)
1407 1410
1408 result = orig(repo, node, branchmerge, force, partial, *args, **kwargs) 1411 result = orig(repo, node, branchmerge, force, *args, **kwargs)
1409 1412
1410 newstandins = lfutil.getstandinsstate(repo) 1413 newstandins = lfutil.getstandinsstate(repo)
1411 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins) 1414 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
1412 if branchmerge or force or partial: 1415 if branchmerge or force or partial:
1413 filelist.extend(s.deleted + s.removed) 1416 filelist.extend(s.deleted + s.removed)