comparison hgext3rd/topic/revset.py @ 5335:e5406605d8f5

topic: document the other safehasattr() compatibility check
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 23 May 2020 11:43:26 +0800
parents 498dc93c3fa0
children 5a70669beaa3
comparison
equal deleted inserted replaced
5334:498dc93c3fa0 5335:e5406605d8f5
105 topic = repo.currenttopic 105 topic = repo.currenttopic
106 else: 106 else:
107 branch = repo[None].branch() 107 branch = repo[None].branch()
108 return revset.baseset(stack.stack(repo, branch=branch, topic=topic)[1:]) & subset 108 return revset.baseset(stack.stack(repo, branch=branch, topic=topic)[1:]) & subset
109 109
110 # x#y[z] revset operator support (no support for older version)
111 # hg <= 4.8 (e54bfde922f2)
110 if util.safehasattr(revset, 'subscriptrelations'): 112 if util.safehasattr(revset, 'subscriptrelations'):
111 def stacksubrel(repo, subset, x, rel, z, order): 113 def stacksubrel(repo, subset, x, rel, z, order):
112 """This is a revset-flavored implementation of stack aliases. 114 """This is a revset-flavored implementation of stack aliases.
113 115
114 The syntax is: rev#stack[n] or rev#s[n]. Plenty of logic is borrowed 116 The syntax is: rev#stack[n] or rev#s[n]. Plenty of logic is borrowed