Patchwork largefiles: enable subrepo support for remove

login
register
mail settings
Submitter Matt Harbison
Date Jan. 9, 2015, 4:52 a.m.
Message ID <60a3c9e2b300f76297bc.1420779131@Envy>
Download mbox | patch
Permalink /patch/7399/
State Accepted
Commit 304e69cb1ee95743e95a17f6f283e8ccf2bf66ea
Headers show

Comments

Matt Harbison - Jan. 9, 2015, 4:52 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1419991972 18000
#      Tue Dec 30 21:12:52 2014 -0500
# Node ID 60a3c9e2b300f76297bc7832fa88cb36f031a281
# Parent  42824b273ecf46e26b4543d239ed3b3d4c9927f7
largefiles: enable subrepo support for remove

Previously, remove failed when operating on a largefile in a subrepo, stating
that the file is untracked.
Pierre-Yves David - Jan. 9, 2015, 5:21 a.m.
On 01/08/2015 08:52 PM, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1419991972 18000
> #      Tue Dec 30 21:12:52 2014 -0500
> # Node ID 60a3c9e2b300f76297bc7832fa88cb36f031a281
> # Parent  42824b273ecf46e26b4543d239ed3b3d4c9927f7
> largefiles: enable subrepo support for remove

This change looks good to me, but I'll wait for Mads Kiilerich feedback 
on it.
Matt Mackall - Jan. 9, 2015, 9:31 p.m.
On Thu, 2015-01-08 at 23:52 -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1419991972 18000
> #      Tue Dec 30 21:12:52 2014 -0500
> # Node ID 60a3c9e2b300f76297bc7832fa88cb36f031a281
> # Parent  42824b273ecf46e26b4543d239ed3b3d4c9927f7
> largefiles: enable subrepo support for remove

This is queued for default, thanks.

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -260,12 +260,11 @@ 
 
     return (result == 1 or bad) and 1 or 0
 
-def overrideremove(orig, ui, repo, *pats, **opts):
-    installnormalfilesmatchfn(repo[None].manifest())
-    result = orig(ui, repo, *pats, **opts)
-    restorematchfn()
-    matcher = scmutil.match(repo[None], pats, opts)
-    return removelargefiles(ui, repo, False, matcher, **opts) or result
+def cmdutilremove(orig, ui, repo, matcher, prefix, after, force, subrepos):
+    normalmatcher = composenormalfilematcher(matcher, repo[None].manifest())
+    result = orig(ui, repo, normalmatcher, prefix, after, force, subrepos)
+    return removelargefiles(ui, repo, False, matcher, after=after,
+                            force=force) or result
 
 def overridestatusfn(orig, repo, rev2, **opts):
     try:
diff --git a/hgext/largefiles/uisetup.py b/hgext/largefiles/uisetup.py
--- a/hgext/largefiles/uisetup.py
+++ b/hgext/largefiles/uisetup.py
@@ -33,8 +33,7 @@ 
     # and in the process of handling commit -A (issue3542)
     entry = extensions.wrapfunction(scmutil, 'addremove',
                                     overrides.scmutiladdremove)
-    entry = extensions.wrapcommand(commands.table, 'remove',
-                                   overrides.overrideremove)
+    extensions.wrapfunction(cmdutil, 'remove', overrides.cmdutilremove)
     entry = extensions.wrapcommand(commands.table, 'forget',
                                    overrides.overrideforget)
 
diff --git a/tests/test-largefiles-misc.t b/tests/test-largefiles-misc.t
--- a/tests/test-largefiles-misc.t
+++ b/tests/test-largefiles-misc.t
@@ -362,6 +362,9 @@ 
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg status -S
 
+  $ hg rm -v subrepo/large.txt
+  removing subrepo/large.txt (glob)
+  $ hg revert -R subrepo subrepo/large.txt
   $ rm subrepo/large.txt
   $ hg addremove -S
   removing subrepo/large.txt