view src/topic/stack.py @ 1896:4ae421cbb07c

stack: exclude obsolete changeset from the set We care about relevant changeset, obsolete have a new version somewhere and we don't care about the old one in our display. In case of unstability, the ordering used is still wrong.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 14 Mar 2016 17:48:31 +0000
parents c8e4c6e03957
children 38570c53b1cf
line wrap: on
line source

# stack.py - code related to stack workflow
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from mercurial.i18n import _
from mercurial import error

def _getstack(repo, topic):
    # XXX need sorting
    return repo.revs("topic(%s) - obsolete()", topic)

def showstack(ui, repo, topic):
    if not topic:
        topic = repo.currenttopic
    if not topic:
        raise error.Abort(_('no active topic to list'))
    for r in _getstack(repo, topic):
        # super crude initial version
        ui.write(repo[r].description().splitlines()[0] + '\n')