# HG changeset patch # User Mads Kiilerich # Date 1412289760 -7200 # Node ID 3f581bfbb268285492616ec1ebd09808a09033a4 # Parent eeaed3d2b00446af460e344eeac0b45f46325d66 largefiles: replace repo._isaddremove hack with a simple function parameter diff -r eeaed3d2b004 -r 3f581bfbb268 hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py Sun Oct 12 22:23:43 2014 -0700 +++ b/hgext/largefiles/overrides.py Fri Oct 03 00:42:40 2014 +0200 @@ -140,7 +140,7 @@ wlock.release() return bad -def removelargefiles(ui, repo, *pats, **opts): +def removelargefiles(ui, repo, isaddremove, *pats, **opts): after = opts.get('after') if not pats and not after: raise util.Abort(_('no files specified')) @@ -187,7 +187,7 @@ if not after: # If this is being called by addremove, notify the user that we # are removing the file. - if getattr(repo, "_isaddremove", False): + if isaddremove: ui.status(_('removing %s\n') % f) util.unlinkpath(repo.wjoin(f), ignoremissing=True) lfdirstate.remove(f) @@ -195,7 +195,7 @@ remove = [lfutil.standin(f) for f in remove] # If this is being called by addremove, let the original addremove # function handle this. - if not getattr(repo, "_isaddremove", False): + if not isaddremove: for f in remove: util.unlinkpath(repo.wjoin(f), ignoremissing=True) repo[None].forget(remove) @@ -232,7 +232,7 @@ installnormalfilesmatchfn(repo[None].manifest()) result = orig(ui, repo, *pats, **opts) restorematchfn() - return removelargefiles(ui, repo, *pats, **opts) or result + return removelargefiles(ui, repo, False, *pats, **opts) or result def overridestatusfn(orig, repo, rev2, **opts): try: @@ -1118,9 +1118,7 @@ # confused state later. if s.deleted: m = [repo.wjoin(f) for f in s.deleted] - repo._isaddremove = True - removelargefiles(repo.ui, repo, *m, **opts) - repo._isaddremove = False + removelargefiles(repo.ui, repo, True, *m, **opts) # Call into the normal add code, and any files that *should* be added as # largefiles will be addlargefiles(repo.ui, repo, *pats, **opts)