[PATCH 03 of 13] largefiles: simplify lfutil.getstandinmatcher by inlining getmatcher

Mads Kiilerich kiilerix at gmail.com
Fri Dec 21 19:06:52 UTC 2012


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1355422746 -3600
# Node ID 71594efccf4d2cd7c6d6f486b2ce6e8a01041236
# Parent  f25956852c892c774c8bc822967a4a2233ae1cb2
largefiles: simplify lfutil.getstandinmatcher by inlining getmatcher

diff --git a/hgext/largefiles/lfutil.py b/hgext/largefiles/lfutil.py
--- a/hgext/largefiles/lfutil.py
+++ b/hgext/largefiles/lfutil.py
@@ -260,19 +260,11 @@
         pats = [standindir]
     else:
         # no patterns and no standin dir: return matcher that matches nothing
-        match = match_.match(repo.root, None, [], exact=True)
-        match.matchfn = lambda f: False
-        return match
-    return getmatcher(repo, pats, opts, showbad=False)
+        return match_.match(repo.root, None, [], exact=True)
 
-def getmatcher(repo, pats=[], opts={}, showbad=True):
-    '''Wrapper around scmutil.match() that adds showbad: if false,
-    neuter the match object's bad() method so it does not print any
-    warnings about missing files or directories.'''
+    # no warnings about missing files or directories
     match = scmutil.match(repo[None], pats, opts)
-
-    if not showbad:
-        match.bad = lambda f, msg: None
+    match.bad = lambda f, msg: None
     return match
 
 def composestandinmatcher(repo, rmatcher):



More information about the Mercurial-devel mailing list