Mercurial > evolve
diff hgext/directaccess.py @ 1518:bca3fce56b2c stable
merge with default
there is some 3.6 related fix and test change that we need on default. No other
significant change happened since last release expect for split, still marked
experimental. So we prepare for a bugfix release.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 02 Nov 2015 00:38:18 +0000 |
parents | 8dfb88ca0c08 |
children | 50e683d9835e |
line wrap: on
line diff
--- a/hgext/directaccess.py Mon Oct 12 01:22:41 2015 -0700 +++ b/hgext/directaccess.py Mon Nov 02 00:38:18 2015 +0000 @@ -129,6 +129,8 @@ hashre = util.re.compile('[0-9a-fA-F]{1,40}') +_listtuple = ('symbol', '_list') + def gethashsymbols(tree): # Returns the list of symbols of the tree that look like hashes # for example for the revset 3::abe3ff it will return ('abe3ff') @@ -143,8 +145,18 @@ if hashre.match(tree[1]): return [tree[1]] return [] - elif len(tree) == 3: - return gethashsymbols(tree[1]) + gethashsymbols(tree[2]) + elif tree[0] == "func" and tree[1] == _listtuple: + # the optimiser will group sequence of hash request + result = [] + for entry in tree[2][1].split('\0'): + if hashre.match(entry): + result.append(entry) + return result + elif len(tree) >= 3: + results = [] + for subtree in tree[1:]: + results += gethashsymbols(subtree) + return results else: return []