Patchwork [1,of,3] hg: replace quietempty with show_stats for clean, merge, and update

login
register
mail settings
Submitter timeless@mozdev.org
Date Dec. 18, 2015, 6:21 a.m.
Message ID <314dec0273cffa3c07fd.1450419697@waste.org>
Download mbox | patch
Permalink /patch/12138/
State Superseded
Headers show

Comments

timeless@mozdev.org - Dec. 18, 2015, 6:21 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1450415128 0
#      Fri Dec 18 05:05:28 2015 +0000
# Node ID 314dec0273cffa3c07fd19cd9ed71d588bf30f98
# Parent  2916ebaef3129451bfd4f9f62487e70f74124d46
hg: replace quietempty with show_stats for clean, merge, and update

Patch

diff --git a/mercurial/hg.py b/mercurial/hg.py
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -637,9 +637,7 @@ 
             srcpeer.close()
     return srcpeer, destpeer
 
-def _showstats(repo, stats, quietempty=False):
-    if quietempty and not any(stats):
-        return
+def _showstats(repo, stats):
     repo.ui.status(_("%d files updated, %d files merged, "
                      "%d files removed, %d files unresolved\n") % stats)
 
@@ -652,10 +650,11 @@ 
     return mergemod.update(repo, node, False, overwrite,
                            labels=['working copy', 'destination'])
 
-def update(repo, node, quietempty=False):
+def update(repo, node, show_stats=True):
     """update the working directory to node, merging linear changes"""
     stats = updaterepo(repo, node, False)
-    _showstats(repo, stats, quietempty)
+    if show_stats:
+        _showstats(repo, stats)
     if stats[3]:
         repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n"))
     return stats[3] > 0
@@ -663,19 +662,20 @@ 
 # naming conflict in clone()
 _update = update
 
-def clean(repo, node, show_stats=True, quietempty=False):
+def clean(repo, node, show_stats=True):
     """forcibly switch the working directory to node, clobbering changes"""
     stats = updaterepo(repo, node, True)
     util.unlinkpath(repo.join('graftstate'), ignoremissing=True)
     if show_stats:
-        _showstats(repo, stats, quietempty)
+        _showstats(repo, stats)
     return stats[3] > 0
 
-def merge(repo, node, force=None, remind=True):
+def merge(repo, node, force=None, remind=True, show_stats=True):
     """Branch merge with node, resolving changes. Return true if any
     unresolved conflicts."""
     stats = mergemod.update(repo, node, True, force)
-    _showstats(repo, stats)
+    if show_stats:
+        _showstats(repo, stats)
     if stats[3]:
         repo.ui.status(_("use 'hg resolve' to retry unresolved file merges "
                          "or 'hg update -C .' to abandon\n"))