Patchwork [5,of,8] largefiles: drop a redundant check for patterns when removing without --after

login
register
mail settings
Submitter Matt Harbison
Date Dec. 23, 2014, 8:56 p.m.
Message ID <abd1bd4b9c59959bf649.1419368177@Envy>
Download mbox | patch
Permalink /patch/7216/
State Superseded
Headers show

Comments

Matt Harbison - Dec. 23, 2014, 8:56 p.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1417048091 18000
#      Wed Nov 26 19:28:11 2014 -0500
# Node ID abd1bd4b9c59959bf649d8690576b25babee71ba
# Parent  c21dca8850323f74fb17dfb507df9c5aa4edf48b
largefiles: drop a redundant check for patterns when removing without --after

This is in the way of passing a matcher to removelargefiles().  This method is
called in exactly two places- first in overrides.addremove() (but only if the
pattern list passed to it is not empty), and second in the commands.remove()
override.  But since the latter calls commands.remove() first, which also does
this check, it isn't needed here.

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -156,8 +156,6 @@ 
 
 def removelargefiles(ui, repo, isaddremove, *pats, **opts):
     after = opts.get('after')
-    if not pats and not after:
-        raise util.Abort(_('no files specified'))
     m = composelargefilematcher(scmutil.match(repo[None], pats, opts),
                                 repo[None].manifest())
     try: