Patchwork [3,of,4,topic-experiment] topics: pass quietempty=True to suppress useless output while changing topics

login
register
mail settings
Submitter Pulkit Goyal
Date June 26, 2017, 8:28 a.m.
Message ID <4c0852883a31643a3f4f.1498465732@workspace>
Download mbox | patch
Permalink /patch/21728/
State Accepted
Headers show

Comments

Pulkit Goyal - June 26, 2017, 8:28 a.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1498355422 -19800
#      Sun Jun 25 07:20:22 2017 +0530
# Node ID 4c0852883a31643a3f4fe50688f85ac90a8d63b9
# Parent  48635ee366c2cac52ba9ccd721c4e9688a4abe90
topics: pass quietempty=True to suppress useless output while changing topics

This will help in suppressing the output "0 files updated, 0 file removed, ..."
Pierre-Yves David - June 26, 2017, 6:59 p.m.
On 06/26/2017 10:28 AM, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit@gmail.com>
> # Date 1498355422 -19800
> #      Sun Jun 25 07:20:22 2017 +0530
> # Node ID 4c0852883a31643a3f4fe50688f85ac90a8d63b9
> # Parent  48635ee366c2cac52ba9ccd721c4e9688a4abe90
> topics: pass quietempty=True to suppress useless output while changing topics
> 
> This will help in suppressing the output "0 files updated, 0 file removed, ..."

I've pushed up to changeset 3
Thanks!,
I need to look at patch 4 in a bit more details.

Cheers,

Patch

diff --git a/hgext3rd/topic/__init__.py b/hgext3rd/topic/__init__.py
--- a/hgext3rd/topic/__init__.py
+++ b/hgext3rd/topic/__init__.py
@@ -377,14 +377,11 @@ 
             rewrote += 1
         # move the working copy too
         wctx = repo[None]
-        # in-progress merge is a bit too complexe for now.
+        # in-progress merge is a bit too complex for now.
         if len(wctx.parents()) == 1:
             newid = successors.get(wctx.p1().node())
             if newid is not None:
-                # this provide some useless output we shoudl eventually suppress
-                #
-                # 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-                hg.update(repo, newid)
+                hg.update(repo, newid, quietempty=True)
         txn.close()
     finally:
         lock.release(txn, l, wl)
diff --git a/tests/test-topic.t b/tests/test-topic.t
--- a/tests/test-topic.t
+++ b/tests/test-topic.t
@@ -655,7 +655,6 @@ 
 Reading the same topic with topic --rev should work:
   $ hg topic --rev . watwat
   switching to topic watwat
-  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   changed topic on 1 changes
 
 Testing issue5441
@@ -680,7 +679,6 @@ 
 
   $ hg topics --rev '13::19' changewat
   switching to topic changewat
-  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   changed topic on 2 changes
   please run hg evolve --rev "topic(changewat)" now
   $ hg log -Gr 'draft()'
@@ -731,7 +729,6 @@ 
   |
   $ hg topics --rev 't1::' changewut
   switching to topic changewut
-  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   changed topic on 3 changes
   please run hg evolve --rev "topic(changewut)" now
   $ hg log -Gr 'draft()'