Mercurial > public > mercurial-scm > hg
comparison mercurial/revsetlang.py @ 35882:87416288be98
tests: make doctest py3-compatible again
A parsed tree is replaced with parse(expr) because it sucks to add b'' to
every string literal.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 27 Jan 2018 14:17:26 +0900 |
parents | 4269971b0d26 |
children | 2a258985ffeb |
comparison
equal
deleted
inserted
replaced
35881:fa993c3c8462 | 35882:87416288be98 |
---|---|
715 return _hashre.match(symbol) | 715 return _hashre.match(symbol) |
716 | 716 |
717 def gethashlikesymbols(tree): | 717 def gethashlikesymbols(tree): |
718 """returns the list of symbols of the tree that look like hashes | 718 """returns the list of symbols of the tree that look like hashes |
719 | 719 |
720 >>> gethashlikesymbols(('dagrange', ('symbol', '3'), ('symbol', 'abe3ff'))) | 720 >>> gethashlikesymbols(parse(b'3::abe3ff')) |
721 ['3', 'abe3ff'] | 721 ['3', 'abe3ff'] |
722 >>> gethashlikesymbols(('func', ('symbol', 'precursors'), ('symbol', '.'))) | 722 >>> gethashlikesymbols(parse(b'precursors(.)')) |
723 [] | 723 [] |
724 >>> gethashlikesymbols(('func', ('symbol', 'precursors'), ('symbol', '34'))) | 724 >>> gethashlikesymbols(parse(b'precursors(34)')) |
725 ['34'] | 725 ['34'] |
726 >>> gethashlikesymbols(('symbol', 'abe3ffZ')) | 726 >>> gethashlikesymbols(parse(b'abe3ffZ')) |
727 [] | 727 [] |
728 """ | 728 """ |
729 if not tree: | 729 if not tree: |
730 return [] | 730 return [] |
731 | 731 |