Commit 0731f8d2 authored by Anton Shestakov's avatar Anton Shestakov
Browse files

topic: support foo#stack syntax

parent 801bbfc4e2e8
Changelog
=========
10.1.0 - in progress
--------------------
topic (0.20.0)
* stack: support foo#stack relation revset (hg-5.4+ only)
10.0.0 -- 2020-05-09
--------------------
......
......@@ -172,3 +172,13 @@ if util.safehasattr(revset, 'subscriptrelations'):
revset.subscriptrelations[b'topic'] = topicrel
revset.subscriptrelations[b't'] = topicrel
# x#y revset operator support (no support for older version)
# hg <= 5.3 (eca82eb9d777)
if util.safehasattr(revset, 'relations'):
def stackrel(repo, subset, x, rel, order):
z = (b'rangeall', None)
return stacksubrel(repo, subset, x, rel, z, order)
revset.relations[b'stack'] = stackrel
revset.relations[b's'] = stackrel
......@@ -385,6 +385,14 @@ Also test the revset:
hg: parse error: stack takes no arguments, it works on current topic
[255]
Stack relation:
$ hg log -r 'foo#stack'
2 default {foo} draft c_c
4 default {foo} draft c_e
5 default {foo} draft c_f
6 default {foo} draft c_d
Stack relation subscript:
$ hg log -r 'foo#stack[0]'
......
......@@ -910,6 +910,10 @@ stack subscript relation
^ 3
s1: 0
$ tlog 'tip#s'
0:
4:
$ tlog 'tip#stack[0]'
$ tlog 'tip#stack[1]'
0:
......@@ -928,6 +932,11 @@ stack subscript relation
s1: 1
s0^ 0 (base)
$ tlog 'featureA#s'
1: featureA
2: featureA
3: featureA
$ tlog 'featureA#s[0]'
0:
$ tlog 'featureA#s[0:0]'
......@@ -978,6 +987,7 @@ stack subscript relation
### target: default (branch)
(stack is empty)
s0^ 4 (base current)
$ tlog 'wdir()#s'
$ tlog 'wdir()#s[0]'
4:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment