topics: pass quietempty=True to suppress useless output while changing topics
authorPulkit Goyal <7895pulkit@gmail.com>
Sun, 25 Jun 2017 07:20:22 +0530
changeset 2665 0ade6e87346b
parent 2664 ed6fb5f20b24
child 2666 2d828f448081
topics: pass quietempty=True to suppress useless output while changing topics This will help in suppressing the output "0 files updated, 0 file removed, ..."
README
hgext3rd/topic/__init__.py
tests/test-topic.t
--- a/README	Sun Jun 25 06:53:22 2017 +0530
+++ b/README	Sun Jun 25 07:20:22 2017 +0530
@@ -132,6 +132,7 @@
  - topic: changing topic on revs no longer adds extra instability (issue5441)
  - topic: topics: rename '--change' flag to '--rev' flag,
  - topic: multiple large performance improvements,
+ - topic: various small output improvement,
 
 6.4.1 - in progress
 -------------------
--- a/hgext3rd/topic/__init__.py	Sun Jun 25 06:53:22 2017 +0530
+++ b/hgext3rd/topic/__init__.py	Sun Jun 25 07:20:22 2017 +0530
@@ -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)
--- a/tests/test-topic.t	Sun Jun 25 06:53:22 2017 +0530
+++ b/tests/test-topic.t	Sun Jun 25 07:20:22 2017 +0530
@@ -684,7 +684,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
@@ -709,7 +708,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()'
@@ -760,7 +758,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()'