evolve: do not try to display stack index of changeset who do not have one stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 25 Oct 2018 18:09:08 +0200
branchstable
changeset 4210 470ba668687a
parent 4209 aa9f33078157
child 4211 ec37b19460cc
child 4216 b90422a11a88
evolve: do not try to display stack index of changeset who do not have one
hgext3rd/evolve/utility.py
tests/test-topic-stack-complex.t
--- a/hgext3rd/evolve/utility.py	Thu Oct 25 18:08:34 2018 +0200
+++ b/hgext3rd/evolve/utility.py	Thu Oct 25 18:09:08 2018 +0200
@@ -14,7 +14,7 @@
 from mercurial.node import nullrev
 
 shorttemplate = "[{label('evolve.rev', rev)}] {desc|firstline}\n"
-stacktemplate = "[s{label('evolve.rev', topicidx)}] {desc|firstline}\n"
+stacktemplate = """[{label('evolve.rev', if(topicidx, "s{topicidx}", rev))}] {desc|firstline}\n"""
 
 def obsexcmsg(ui, message, important=False):
     verbose = ui.configbool('experimental', 'verbose-obsolescence-exchange',
--- a/tests/test-topic-stack-complex.t	Thu Oct 25 18:08:34 2018 +0200
+++ b/tests/test-topic-stack-complex.t	Thu Oct 25 18:09:08 2018 +0200
@@ -172,7 +172,7 @@
   $ hg evolve --content-divergent -r ec94a1ed1330
   merge:[s5] Added e and f
   with: [s4] Added e and f
-  base: [s] Added e and f
+  base: [3] Added e and f
   updating to "local" side of the conflict: ec94a1ed1330
   merging "other" content-divergent changeset 'f2eff98490d2'
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved