[PATCH 4 of 7] largefiles, cat: make handling of bad matches more legible

Mads Kiilerich mads at kiilerich.com
Wed Jan 15 19:18:12 CST 2014


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1389834907 -3600
#      Thu Jan 16 02:15:07 2014 +0100
# Node ID f20bc114853d8752e04dcf573e9c0e78a43b65a0
# Parent  cd51bc9bf14366c381799f953a75930f6293cafb
largefiles, cat: make handling of bad matches more legible

Functions automatically return when they are done and there is nothing to
return from .bad.

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -1169,17 +1169,21 @@ def overridecat(orig, ui, repo, file1, *
     notbad = set()
     m = scmutil.match(ctx, (file1,) + pats, opts)
     origmatchfn = m.matchfn
+
     def lfmatchfn(f):
         lf = lfutil.splitstandin(f)
         if lf is None:
             return origmatchfn(f)
         notbad.add(lf)
         return origmatchfn(lf)
+
     m.matchfn = lfmatchfn
     origbadfn = m.bad
+
     def lfbadfn(f, msg):
         if not f in notbad:
-            return origbadfn(f, msg)
+            origbadfn(f, msg)
+
     m.bad = lfbadfn
     for f in ctx.walk(m):
         fp = cmdutil.makefileobj(repo, opts.get('output'), ctx.node(),


More information about the Mercurial-devel mailing list