# HG changeset patch # User Durham Goode # Date 1443545230 25200 # Node ID 8dfb88ca0c08c2f3b084ab090195dd5e50f65ce4 # Parent 6f574c76c1424a0c20c6366448037b82d3733832 directaccess: inspect trees of len() > 3 Previously, when inspecting revset AST's we'd only traverse down the tree if it was length 3 ([op, left, right]). In some situations, like 'or' the tree node will be greater than length 3 ([op, first, second, ..., nth]). So we need to traverse all the parts of the node to catch all the symbols. diff -r 6f574c76c142 -r 8dfb88ca0c08 hgext/directaccess.py --- a/hgext/directaccess.py Mon Sep 21 22:30:44 2015 +0900 +++ b/hgext/directaccess.py Tue Sep 29 09:47:10 2015 -0700 @@ -152,8 +152,11 @@ if hashre.match(entry): result.append(entry) return result - elif len(tree) == 3: - return gethashsymbols(tree[1]) + gethashsymbols(tree[2]) + elif len(tree) >= 3: + results = [] + for subtree in tree[1:]: + results += gethashsymbols(subtree) + return results else: return [] diff -r 6f574c76c142 -r 8dfb88ca0c08 tests/test-inhibit.t --- a/tests/test-inhibit.t Mon Sep 21 22:30:44 2015 +0900 +++ b/tests/test-inhibit.t Tue Sep 29 09:47:10 2015 -0700 @@ -358,6 +358,13 @@ [255] +Test directaccess in a larger revset + + $ hg log -r '. + .^ + 2db36d8066ff' -T '{node|short}\n' + 55c73a90e4b4 + cf5c4f4554ce + 2db36d8066ff + With severals hidden sha, rebase of one hidden stack onto another one: $ hg update -C 0 0 files updated, 0 files merged, 4 files removed, 0 files unresolved