changeset 4268:d5a2cc19903f

topics: improve the message around topic changing The new message says 'cleared' when topic name is cleared, if we change to a new topic name, it mentions the new topic name too.
author Pulkit Goyal <pulkit@yandex-team.ru>
date Mon, 26 Nov 2018 16:43:39 +0300
parents 18ed2a237ab5
children c8f96f4cb600
files hgext3rd/topic/__init__.py tests/test-evolve-topic.t tests/test-stack-branch.t tests/test-topic-change.t tests/test-topic-stack.t tests/test-topic.t
diffstat 6 files changed, 17 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/topic/__init__.py	Wed Nov 21 11:13:21 2018 +0000
+++ b/hgext3rd/topic/__init__.py	Mon Nov 26 16:43:39 2018 +0300
@@ -680,7 +680,11 @@
             txn = repo.transaction('rewrite-topics')
             rewrote = _changetopics(ui, repo, touchedrevs, topic)
             txn.close()
-            ui.status('changed topic on %d changes\n' % rewrote)
+            if topic is None:
+                ui.status('cleared topic on %d changesets\n' % rewrote)
+            else:
+                ui.status('changed topic on %d changesets to "%s"\n' % (rewrote,
+                                                                        topic))
         finally:
             lockmod.release(txn, lock, wl)
             repo.invalidate()
--- a/tests/test-evolve-topic.t	Wed Nov 21 11:13:21 2018 +0000
+++ b/tests/test-evolve-topic.t	Mon Nov 26 16:43:39 2018 +0300
@@ -257,7 +257,7 @@
   
   $ hg topic -r 070c5573d8f9 bar
   4 new orphan changesets
-  changed topic on 1 changes
+  changed topic on 1 changesets to "bar"
   $ hg up 16d6f664b17c
   switching to topic bar
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- a/tests/test-stack-branch.t	Wed Nov 21 11:13:21 2018 +0000
+++ b/tests/test-stack-branch.t	Mon Nov 26 16:43:39 2018 +0300
@@ -309,7 +309,7 @@
 ----------------------------------------------------
 
   $ hg topic --rev b4::b5 sometopic
-  changed topic on 2 changes
+  changed topic on 2 changesets to "sometopic"
   $ hg stack
   ### target: foo (branch)
   s3$ c_f (unstable)
--- a/tests/test-topic-change.t	Wed Nov 21 11:13:21 2018 +0000
+++ b/tests/test-topic-change.t	Mon Nov 26 16:43:39 2018 +0300
@@ -51,7 +51,7 @@
 Clearing topic from revision without topic
 
   $ hg topic -r . --clear
-  changed topic on 0 changes
+  cleared topic on 0 changesets
 
 Clearing current topic when no active topic is not error
 
@@ -62,7 +62,7 @@
 
   $ hg topic -r 0:: foo
   switching to topic foo
-  changed topic on 8 changes
+  changed topic on 8 changesets to "foo"
   $ hg glog
   @  15:05095f607171 {foo}
   |  Added h  ()
@@ -100,7 +100,7 @@
 
   $ hg topic -r abcedffeae90:: bar
   switching to topic bar
-  changed topic on 4 changes
+  changed topic on 4 changesets to "bar"
   $ hg glog
   @  19:d7d36e193ea7 {bar}
   |  Added h  ()
@@ -139,7 +139,7 @@
   $ hg topic -r . --current
   active topic 'foobar' grew its first changeset
   (see 'hg help topics' for more information)
-  changed topic on 1 changes
+  changed topic on 1 changesets to "foobar"
   $ hg glog -r .
   @  20:c2d6b7df5dcf {foobar}
   |  Added h  ()
@@ -149,7 +149,7 @@
 
   $ hg topic -r 9::10 --current
   5 new orphan changesets
-  changed topic on 2 changes
+  changed topic on 2 changesets to "foobar"
   $ hg glog
   o  22:1b88140feefe {foobar}
   |  Added c  ()
@@ -302,7 +302,7 @@
   $ hg topic -r . --clear
   clearing empty topic "watwat"
   active topic 'watwat' is now empty
-  changed topic on 1 changes
+  cleared topic on 1 changesets
 
   $ hg glog
   @  31:c48d6d71b2d9 {}
@@ -335,7 +335,7 @@
   $ hg bookmark bookboo
   $ hg topic -r . movebook
   switching to topic movebook
-  changed topic on 1 changes
+  changed topic on 1 changesets to "movebook"
   $ hg glog
   @  32:1b83d11095b9 {movebook}
   |  Added h  (book bookboo)
@@ -376,7 +376,7 @@
   $ hg topic -r . watwat
   switching to topic watwat
   1 new orphan changesets
-  changed topic on 1 changes
+  changed topic on 1 changesets to "watwat"
 
   $ hg glog
   @  33:894983f69e69 {watwat}
--- a/tests/test-topic-stack.t	Wed Nov 21 11:13:21 2018 +0000
+++ b/tests/test-topic-stack.t	Mon Nov 26 16:43:39 2018 +0300
@@ -495,7 +495,7 @@
   $ hg topic foobar -r 'desc(c_e) + desc(c_D)'
   switching to topic foobar
   4 new orphan changesets
-  changed topic on 2 changes
+  changed topic on 2 changesets to "foobar"
   $ hg log -G
   @  17 default {foobar} draft c_D
   |
--- a/tests/test-topic.t	Wed Nov 21 11:13:21 2018 +0000
+++ b/tests/test-topic.t	Mon Nov 26 16:43:39 2018 +0300
@@ -863,7 +863,7 @@
 
   $ hg topic topic1970 --rev 0
   switching to topic topic1970
-  changed topic on 1 changes
+  changed topic on 1 changesets to "topic1970"
 
   $ hg add b
   $ hg topic topic1990