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

login
register
mail settings
Submitter Mads Kiilerich
Date Jan. 16, 2014, 1:18 a.m.
Message ID <f20bc114853d8752e04d.1389835092@localhost.localdomain>
Download mbox | patch
Permalink /patch/3342/
State Rejected
Headers show

Comments

Mads Kiilerich - Jan. 16, 2014, 1:18 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@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.

Patch

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(),