comparison hgext/largefiles/overrides.py @ 41652:6a447a3d1bd0

addremove: pass around uipathfn and use instead of m.uipath() (API) Differential Revision: https://phab.mercurial-scm.org/D5903
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 07 Feb 2019 23:25:39 -0800
parents b2df5dc3ebfb
children 16a49c778bde
comparison
equal deleted inserted replaced
41651:b2df5dc3ebfb 41652:6a447a3d1bd0
1223 orig(ui, repo, *pats, **opts) 1223 orig(ui, repo, *pats, **opts)
1224 finally: 1224 finally:
1225 repo.lfstatus = False 1225 repo.lfstatus = False
1226 1226
1227 @eh.wrapfunction(scmutil, 'addremove') 1227 @eh.wrapfunction(scmutil, 'addremove')
1228 def scmutiladdremove(orig, repo, matcher, prefix, opts=None): 1228 def scmutiladdremove(orig, repo, matcher, prefix, uipathfn, opts=None):
1229 if opts is None: 1229 if opts is None:
1230 opts = {} 1230 opts = {}
1231 if not lfutil.islfilesrepo(repo): 1231 if not lfutil.islfilesrepo(repo):
1232 return orig(repo, matcher, prefix, opts) 1232 return orig(repo, matcher, prefix, uipathfn, opts)
1233 # Get the list of missing largefiles so we can remove them 1233 # Get the list of missing largefiles so we can remove them
1234 lfdirstate = lfutil.openlfdirstate(repo.ui, repo) 1234 lfdirstate = lfutil.openlfdirstate(repo.ui, repo)
1235 unsure, s = lfdirstate.status(matchmod.always(repo.root, repo.getcwd()), 1235 unsure, s = lfdirstate.status(matchmod.always(repo.root, repo.getcwd()),
1236 subrepos=[], ignored=False, clean=False, 1236 subrepos=[], ignored=False, clean=False,
1237 unknown=False) 1237 unknown=False)
1258 **pycompat.strkwargs(opts)) 1258 **pycompat.strkwargs(opts))
1259 # Now that we've handled largefiles, hand off to the original addremove 1259 # Now that we've handled largefiles, hand off to the original addremove
1260 # function to take care of the rest. Make sure it doesn't do anything with 1260 # function to take care of the rest. Make sure it doesn't do anything with
1261 # largefiles by passing a matcher that will ignore them. 1261 # largefiles by passing a matcher that will ignore them.
1262 matcher = composenormalfilematcher(matcher, repo[None].manifest(), added) 1262 matcher = composenormalfilematcher(matcher, repo[None].manifest(), added)
1263 return orig(repo, matcher, prefix, opts) 1263 return orig(repo, matcher, prefix, uipathfn, opts)
1264 1264
1265 # Calling purge with --all will cause the largefiles to be deleted. 1265 # Calling purge with --all will cause the largefiles to be deleted.
1266 # Override repo.status to prevent this from happening. 1266 # Override repo.status to prevent this from happening.
1267 @eh.wrapcommand('purge', extension='purge') 1267 @eh.wrapcommand('purge', extension='purge')
1268 def overridepurge(orig, ui, repo, *dirs, **opts): 1268 def overridepurge(orig, ui, repo, *dirs, **opts):