Patchwork [10,of,13] largefiles: remove reporemove portability wrapper

login
register
mail settings
Submitter Mads Kiilerich
Date Dec. 21, 2012, 7:06 p.m.
Message ID <00078e8ccec904bc6d5e.1356116819@mk-desktop>
Download mbox | patch
Permalink /patch/258/
State Accepted
Commit 51837a31b42542eac4ef7f37e6d00ce082f7db12
Headers show

Comments

Mads Kiilerich - Dec. 21, 2012, 7:06 p.m.
# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1355422746 -3600
# Node ID 00078e8ccec904bc6d5e4825fab01b10cd13e7a3
# Parent  aab8689067ded987b1c3247269786975ca5469d5
largefiles: remove reporemove portability wrapper

Patch

diff --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py
--- a/hgext/largefiles/lfutil.py
+++ b/hgext/largefiles/lfutil.py
@@ -31,18 +31,6 @@ 
     add = repo[None].add
     return add(list)
 
-def reporemove(repo, list, unlink=False):
-    def remove(list, unlink):
-        wlock = repo.wlock()
-        try:
-            if unlink:
-                for f in list:
-                    util.unlinkpath(repo.wjoin(f), ignoremissing=True)
-            repo[None].forget(list)
-        finally:
-            wlock.release()
-    return remove(list, unlink=unlink)
-
 def repoforget(repo, list):
     forget = repo[None].forget
     return forget(list)
diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -180,9 +180,9 @@ 
         # If this is being called by addremove, let the original addremove
         # function handle this.
         if not getattr(repo, "_isaddremove", False):
-            lfutil.reporemove(repo, remove, unlink=True)
-        else:
-            lfutil.reporemove(repo, remove, unlink=False)
+            for f in remove:
+                util.unlinkpath(repo.wjoin(f), ignoremissing=True)
+        repo[None].forget(remove)
     finally:
         wlock.release()
 
@@ -958,8 +958,10 @@ 
             else:
                 lfdirstate.remove(f)
         lfdirstate.write()
-        lfutil.reporemove(repo, [lfutil.standin(f) for f in forget],
-            unlink=True)
+        standins = [lfutil.standin(f) for f in forget]
+        for f in standins:
+            util.unlinkpath(repo.wjoin(f), ignoremissing=True)
+        repo[None].forget(standins)
     finally:
         wlock.release()