utility: add a template alias that will be used in evolve msgs
authorSushil khanchi <sushilkhanchi97@gmail.com>
Mon, 01 Oct 2018 13:20:30 +0530
changeset 4153 e1f6f9da82c1
parent 4152 fb22c7a6ca8b
child 4154 dd81d7f43857
utility: add a template alias that will be used in evolve msgs This template use stack alias s# instead of rev number in messages printed when we run `hg evolve`. For example, this template's msgs will look like this: move:[s3] add aaa atop:[s2] add bbb move:[s4] add ccc I will be using this template in upcoming patches.
hgext3rd/evolve/evolvecmd.py
hgext3rd/evolve/utility.py
--- a/hgext3rd/evolve/evolvecmd.py	Mon Oct 01 12:37:42 2018 +0530
+++ b/hgext3rd/evolve/evolvecmd.py	Mon Oct 01 13:20:30 2018 +0530
@@ -44,6 +44,7 @@
 
 TROUBLES = compat.TROUBLES
 shorttemplate = utility.shorttemplate
+stacktemplate = utility.stacktemplate
 _bookmarksupdater = rewriteutil.bookmarksupdater
 sha1re = re.compile(r'\b[0-9a-f]{6,40}\b')
 
--- a/hgext3rd/evolve/utility.py	Mon Oct 01 12:37:42 2018 +0530
+++ b/hgext3rd/evolve/utility.py	Mon Oct 01 13:20:30 2018 +0530
@@ -14,6 +14,7 @@
 from mercurial.node import nullrev
 
 shorttemplate = "[{label('evolve.rev', rev)}] {desc|firstline}\n"
+stacktemplate = "[s{label('evolve.rev', topicidx)}] {desc|firstline}\n"
 
 def obsexcmsg(ui, message, important=False):
     verbose = ui.configbool('experimental', 'verbose-obsolescence-exchange',