##// END OF EJS Templates
largefiles: replace repo._isaddremove hack with a simple function parameter
Mads Kiilerich -
r23038:3f581bfb default
parent child Browse files
Show More
@@ -140,7 +140,7 b' def addlargefiles(ui, repo, *pats, **opt'
140 wlock.release()
140 wlock.release()
141 return bad
141 return bad
142
142
143 def removelargefiles(ui, repo, *pats, **opts):
143 def removelargefiles(ui, repo, isaddremove, *pats, **opts):
144 after = opts.get('after')
144 after = opts.get('after')
145 if not pats and not after:
145 if not pats and not after:
146 raise util.Abort(_('no files specified'))
146 raise util.Abort(_('no files specified'))
@@ -187,7 +187,7 b' def removelargefiles(ui, repo, *pats, **'
187 if not after:
187 if not after:
188 # If this is being called by addremove, notify the user that we
188 # If this is being called by addremove, notify the user that we
189 # are removing the file.
189 # are removing the file.
190 if getattr(repo, "_isaddremove", False):
190 if isaddremove:
191 ui.status(_('removing %s\n') % f)
191 ui.status(_('removing %s\n') % f)
192 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
192 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
193 lfdirstate.remove(f)
193 lfdirstate.remove(f)
@@ -195,7 +195,7 b' def removelargefiles(ui, repo, *pats, **'
195 remove = [lfutil.standin(f) for f in remove]
195 remove = [lfutil.standin(f) for f in remove]
196 # If this is being called by addremove, let the original addremove
196 # If this is being called by addremove, let the original addremove
197 # function handle this.
197 # function handle this.
198 if not getattr(repo, "_isaddremove", False):
198 if not isaddremove:
199 for f in remove:
199 for f in remove:
200 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
200 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
201 repo[None].forget(remove)
201 repo[None].forget(remove)
@@ -232,7 +232,7 b' def overrideremove(orig, ui, repo, *pats'
232 installnormalfilesmatchfn(repo[None].manifest())
232 installnormalfilesmatchfn(repo[None].manifest())
233 result = orig(ui, repo, *pats, **opts)
233 result = orig(ui, repo, *pats, **opts)
234 restorematchfn()
234 restorematchfn()
235 return removelargefiles(ui, repo, *pats, **opts) or result
235 return removelargefiles(ui, repo, False, *pats, **opts) or result
236
236
237 def overridestatusfn(orig, repo, rev2, **opts):
237 def overridestatusfn(orig, repo, rev2, **opts):
238 try:
238 try:
@@ -1118,9 +1118,7 b' def scmutiladdremove(orig, repo, pats=[]'
1118 # confused state later.
1118 # confused state later.
1119 if s.deleted:
1119 if s.deleted:
1120 m = [repo.wjoin(f) for f in s.deleted]
1120 m = [repo.wjoin(f) for f in s.deleted]
1121 repo._isaddremove = True
1121 removelargefiles(repo.ui, repo, True, *m, **opts)
1122 removelargefiles(repo.ui, repo, *m, **opts)
1123 repo._isaddremove = False
1124 # Call into the normal add code, and any files that *should* be added as
1122 # Call into the normal add code, and any files that *should* be added as
1125 # largefiles will be
1123 # largefiles will be
1126 addlargefiles(repo.ui, repo, *pats, **opts)
1124 addlargefiles(repo.ui, repo, *pats, **opts)
General Comments 0
You need to be logged in to leave comments. Login now