[PATCH 8 of 9] log: allow matchfn to be non-null even if both --patch/--stat are off

Yuya Nishihara yuya at tcha.org
Mon Jan 15 08:26:42 EST 2018


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1515046846 -32400
#      Thu Jan 04 15:20:46 2018 +0900
# Node ID 670bc1871d139b1e9cf6dff01a343638ae56644c
# Parent  79298fa195792c1371945e3a7161b59387ba76e1
log: allow matchfn to be non-null even if both --patch/--stat are off

This makes the next patch slightly simpler.

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1725,7 +1725,8 @@ class changeset_printer(object):
                 diffordiffstat(self.ui, self.repo, diffopts, prev, node,
                                match=matchfn, stat=False,
                                hunksfilterfn=hunksfilterfn)
-            self.ui.write("\n")
+            if stat or diff:
+                self.ui.write("\n")
 
 class jsonchangeset(changeset_printer):
     '''format changeset information.'''


More information about the Mercurial-devel mailing list