comparison hgext3rd/topic/revset.py @ 2712:f19b314d8475

topics: add t0 and b0 to the stack t0 or b0 will be the base of the stack and it's the parent of t1 or b1. The cool thing about this is that if you update to t0 using `hg up t0` or do `hg prev` on t1, you will be updated to t0 with the current topic preserved. This patch adds t0 to stack and implement the preserving topic case for t0 while using `hg update`.
author Pulkit Goyal <7895pulkit@gmail.com>
date Tue, 04 Jul 2017 01:30:14 +0530
parents 96843c68acc8
children b3abdb3d819e
comparison
equal deleted inserted replaced
2711:8c938e9af113 2712:f19b314d8475
76 branch = None 76 branch = None
77 if not topic and repo.currenttopic: 77 if not topic and repo.currenttopic:
78 topic = repo.currenttopic 78 topic = repo.currenttopic
79 if not topic: 79 if not topic:
80 branch = repo[None].branch() 80 branch = repo[None].branch()
81 return revset.baseset(stack.getstack(repo, branch=branch, topic=topic)) & subset 81 return revset.baseset(stack.getstack(repo, branch=branch, topic=topic)[1:]) & subset
82 82
83 83
84 def modsetup(ui): 84 def modsetup(ui):
85 revset.symbols.update({'topic': topicset}) 85 revset.symbols.update({'topic': topicset})
86 revset.symbols.update({'ngtip': ngtipset}) 86 revset.symbols.update({'ngtip': ngtipset})