Patchwork [3,of,8] hg: add quietempty flag to _showstats

login
register
mail settings
Submitter timeless@mozdev.org
Date Dec. 14, 2015, 11:37 p.m.
Message ID <4226922c73feb11bccb5.1450136244@waste.org>
Download mbox | patch
Permalink /patch/12040/
State Accepted
Headers show

Comments

timeless@mozdev.org - Dec. 14, 2015, 11:37 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1450134805 0
#      Mon Dec 14 23:13:25 2015 +0000
# Node ID 4226922c73feb11bccb5457f16a4e80137a53407
# Parent  d1c056038e9c4e0af4aa8ec9b86d551cbecfacab
hg: add quietempty flag to _showstats

if called with quietempty=True, suppress:
0 files updated, 0 files merged, 0 files removed, 0 files unresolved

Patch

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -627,7 +627,9 @@ 
             srcpeer.close()
     return srcpeer, destpeer
 
-def _showstats(repo, stats):
+def _showstats(repo, stats, quietempty=False):
+    if quietempty and not any(stats):
+        return
     repo.ui.status(_("%d files updated, %d files merged, "
                      "%d files removed, %d files unresolved\n") % stats)