directaccess: fix with tree without order
authorBoris Feld <boris.feld@octobus.net>
Thu, 31 Aug 2017 17:00:09 +0200
changeset 2893 0938f3a09a1e
parent 2892 0eed6678b150
child 2894 31aa9d097d29
directaccess: fix with tree without order 1b28525e6698 removes order from tree, changing the indexes in gethashsymbols. Fix that
hgext3rd/evolve/hack/directaccess.py
--- a/hgext3rd/evolve/hack/directaccess.py	Fri Sep 01 11:08:22 2017 +0200
+++ b/hgext3rd/evolve/hack/directaccess.py	Thu Aug 31 17:00:09 2017 +0200
@@ -155,12 +155,12 @@
         return []
 
     results = []
-    if len(tree) == 2 and tree[0] == "symbol":
+    if len(tree) in (2, 3) and tree[0] == "symbol":
         results.append(tree[1])
     elif tree[0] == "func" and tree[1] == _listtuple:
         # the optimiser will group sequence of hash request
         results += tree[2][1].split('\0')
-    elif len(tree) >= 3:
+    elif len(tree) >= 2:
         for subtree in tree[1:]:
             results += gethashsymbols(subtree, maxrev)
         # return directly, we don't need to filter symbols again