diff hgext3rd/topic/stack.py @ 2915:b3abdb3d819e

stack: replace 'getstack' with direct call to 'stack' The dedicated function do not add any value. We can update all the callers.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 04 Sep 2017 12:23:03 +0200
parents 9897babc1fb5
children 17749d9d3968
line wrap: on
line diff
--- a/hgext3rd/topic/stack.py	Mon Sep 04 12:19:49 2017 +0200
+++ b/hgext3rd/topic/stack.py	Mon Sep 04 12:23:03 2017 +0200
@@ -58,10 +58,6 @@
             revs.insert(0, pt1.rev())
         return revs
 
-def getstack(repo, branch=None, topic=None):
-    # XXX need sorting
-    return stack(repo, branch=branch, topic = topic)
-
 def labelsgen(prefix, labelssuffix):
     """ Takes a label prefix and a list of suffixes. Returns a string of the prefix
     formatted with each suffix separated with a space.
@@ -124,7 +120,7 @@
             fm.plain('%d behind' % data['behindcount'], label='topic.stack.summary.behindcount')
     fm.plain('\n')
 
-    for idx, r in enumerate(getstack(repo, branch=branch, topic=topic), 0):
+    for idx, r in enumerate(stack(repo, branch=branch, topic=topic), 0):
         ctx = repo[r]
         # special case for t0, b0 as it's hard to plugin into rest of the logic
         if idx == 0:
@@ -201,7 +197,7 @@
     :behindcount: number of changeset on rebase destination
     """
     data = {}
-    revs = getstack(repo, branch, topic)[1:]
+    revs = stack(repo, branch, topic)[1:]
     data['changesetcount'] = len(revs)
     data['troubledcount'] = len([r for r in revs if repo[r].isunstable()])
     deps, rdeps = builddependencies(repo, revs)