topic: improve UX by using pager only when we should stable
authorSushil khanchi <sushilkhanchi97@gmail.com>
Tue, 06 Nov 2018 15:53:18 +0530
branchstable
changeset 4231 3eb78bdcdd7c
parent 4230 e796835fe6b3
child 4232 424b498aac00
child 4235 e30119dfd626
topic: improve UX by using pager only when we should Before this patch we were using pager in every case of topic command, either it is setting up a new topic or clearing the active topic. After this patch it will not use pager in following commands: $ hg topic [TOPIC] -r [rev] $ hg topic --clear
CHANGELOG
hgext3rd/topic/__init__.py
--- a/CHANGELOG	Tue Nov 06 10:43:35 2018 +0530
+++ b/CHANGELOG	Tue Nov 06 15:53:18 2018 +0530
@@ -8,6 +8,7 @@
   * evolve: not longer attempt to translate revision's descriptions (issue6016)
   * evolve: fix compatibility with mercurial 4.8's narrow extension.
   * pick: fix summary help text
+  * topic: only use pager when it make senses
 
 8.3.1 -- 2018-10-25
 -------------------
--- a/hgext3rd/topic/__init__.py	Tue Nov 06 10:43:35 2018 +0530
+++ b/hgext3rd/topic/__init__.py	Tue Nov 06 15:53:18 2018 +0530
@@ -652,9 +652,8 @@
                         " '_' and '.' characters")
             raise error.Abort(_("invalid topic name: '%s'") % topic, hint=helptxt)
 
-    ui.pager('topics')
-
     if list:
+        ui.pager('topics')
         if clear or rev:
             raise error.Abort(_("cannot use --clear or --rev with --list"))
         if not topic:
@@ -700,6 +699,7 @@
             ui.status(_('marked working directory as topic: %s\n') % topic)
         return _changecurrenttopic(repo, topic)
 
+    ui.pager('topics')
     # `hg topic --current`
     ret = 0
     if current and not ct: