[PATCH 2 of 2] patch: handle 'gitpatches' being empty, but not none

Dan Villiom Podlaski Christiansen danchr at gmail.com
Sun Sep 11 12:24:56 CDT 2011


# HG changeset patch
# User Dan Villiom Podlaski Christiansen <dan at cabo.dk>
# Date 1315759781 -7200
# Node ID fa5e70dddef12e81c44925a0e2bb3d6f68d7df60
# Parent  df7fb75ff62d97fd175687ce2d26fe0377d3b8e6
patch: handle 'gitpatches' being empty, but not none

diff --git a/mercurial/patch.py b/mercurial/patch.py
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -1199,7 +1199,7 @@ def iterhunks(fp):
             m = gitre.match(x)
             if not m:
                 continue
-            if gitpatches is None:
+            if not gitpatches:
                 # scan whole input for git metadata
                 gitpatches = [('a/' + gp.path, 'b/' + gp.path, gp) for gp
                               in scangitpatch(lr, x)]


More information about the Mercurial-devel mailing list