comparison hgext/largefiles/overrides.py @ 41653:16a49c778bde

forget: pass around uipathfn and use instead of m.rel() (API) Differential Revision: https://phab.mercurial-scm.org/D5911
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 08 Feb 2019 13:08:01 -0800
parents 6a447a3d1bd0
children f164076427b2
comparison
equal deleted inserted replaced
41652:6a447a3d1bd0 41653:16a49c778bde
1076 return orig(repo, *args, **kwargs) 1076 return orig(repo, *args, **kwargs)
1077 finally: 1077 finally:
1078 repo.lfstatus = False 1078 repo.lfstatus = False
1079 1079
1080 @eh.wrapfunction(cmdutil, 'forget') 1080 @eh.wrapfunction(cmdutil, 'forget')
1081 def cmdutilforget(orig, ui, repo, match, prefix, explicitonly, dryrun, 1081 def cmdutilforget(orig, ui, repo, match, prefix, uipathfn, explicitonly, dryrun,
1082 interactive): 1082 interactive):
1083 normalmatcher = composenormalfilematcher(match, repo[None].manifest()) 1083 normalmatcher = composenormalfilematcher(match, repo[None].manifest())
1084 bad, forgot = orig(ui, repo, normalmatcher, prefix, explicitonly, dryrun, 1084 bad, forgot = orig(ui, repo, normalmatcher, prefix, uipathfn, explicitonly,
1085 interactive) 1085 dryrun, interactive)
1086 m = composelargefilematcher(match, repo[None].manifest()) 1086 m = composelargefilematcher(match, repo[None].manifest())
1087 1087
1088 try: 1088 try:
1089 repo.lfstatus = True 1089 repo.lfstatus = True
1090 s = repo.status(match=m, clean=True) 1090 s = repo.status(match=m, clean=True)
1096 1096
1097 for f in forget: 1097 for f in forget:
1098 fstandin = lfutil.standin(f) 1098 fstandin = lfutil.standin(f)
1099 if fstandin not in repo.dirstate and not repo.wvfs.isdir(fstandin): 1099 if fstandin not in repo.dirstate and not repo.wvfs.isdir(fstandin):
1100 ui.warn(_('not removing %s: file is already untracked\n') 1100 ui.warn(_('not removing %s: file is already untracked\n')
1101 % m.rel(f)) 1101 % uipathfn(f))
1102 bad.append(f) 1102 bad.append(f)
1103 1103
1104 for f in forget: 1104 for f in forget:
1105 if ui.verbose or not m.exact(f): 1105 if ui.verbose or not m.exact(f):
1106 ui.status(_('removing %s\n') % m.rel(f)) 1106 ui.status(_('removing %s\n') % uipathfn(f))
1107 1107
1108 # Need to lock because standin files are deleted then removed from the 1108 # Need to lock because standin files are deleted then removed from the
1109 # repository and we could race in-between. 1109 # repository and we could race in-between.
1110 with repo.wlock(): 1110 with repo.wlock():
1111 lfdirstate = lfutil.openlfdirstate(ui, repo) 1111 lfdirstate = lfutil.openlfdirstate(ui, repo)