comparison hgext3rd/topic/stack.py @ 2684:90e11985d0cc

topic: exclude public and topic changeset from branch stack Stack use-case is to show the current work in progress, which are symbolized by the phase draft and secret phase. Moreover showing public changesets in stack output when displaying current branch would display a lot of changesets for long-lived branches and would be quite useless. We also exclude topic changeset form the stack since they already exist on their own stack. getstack revsets didn't needed update when displaying a topic as when a changeset become public, its topic is no longer relevant.
author Boris Feld <boris.feld@octobus.net>
date Thu, 29 Jun 2017 16:49:33 +0200
parents f5d52fa1cd55
children f19b314d8475
comparison
equal deleted inserted replaced
2683:d22090c6e68f 2684:90e11985d0cc
15 if topic is not None and branch is not None: 15 if topic is not None and branch is not None:
16 raise error.ProgrammingError('both branch and topic specified (not defined yet)') 16 raise error.ProgrammingError('both branch and topic specified (not defined yet)')
17 elif topic is not None: 17 elif topic is not None:
18 trevs = repo.revs("topic(%s) - obsolete()", topic) 18 trevs = repo.revs("topic(%s) - obsolete()", topic)
19 elif branch is not None: 19 elif branch is not None:
20 trevs = repo.revs("branch(%s) - obsolete()", branch) 20 trevs = repo.revs("branch(%s) - public() - obsolete() - topic()", branch)
21 else: 21 else:
22 raise error.ProgrammingError('neither branch and topic specified (not defined yet)') 22 raise error.ProgrammingError('neither branch and topic specified (not defined yet)')
23 return _orderrevs(repo, trevs) 23 return _orderrevs(repo, trevs)
24 24
25 def labelsgen(prefix, labelssuffix): 25 def labelsgen(prefix, labelssuffix):