no bug, make tree output be hierarchical for modules, rs=foopy
authorAxel Hecht <axel@pike.org>
Tue, 06 Jun 2017 14:18:59 +0200
changeset 259 eb1fa359b18a36355b77a2eb271a693516586731
parent 257 d3ac7afd7c104938ffb02113a95101528d6c63cd
child 260 fd159b984acf395badabb7da0b252c45c6cfcdfe
push id63
push useraxel@mozilla.com
push dateWed, 07 Jun 2017 08:14:18 +0000
reviewersfoopy
no bug, make tree output be hierarchical for modules, rs=foopy This is a bit of a follow-up to the configuration landing, making the json of both variants match for modules with '/' in them. So devtools/client and devtools/shared get a shared parent devtools, with client and shared being children. MozReview-Commit-ID: LaMkgMrM9Fn
compare_locales/compare.py
--- a/compare_locales/compare.py
+++ b/compare_locales/compare.py
@@ -24,18 +24,20 @@ class Tree(object):
     def __init__(self, valuetype):
         self.branches = dict()
         self.valuetype = valuetype
         self.value = None
 
     def __getitem__(self, leaf):
         parts = []
         if isinstance(leaf, paths.File):
-            parts = [p for p in [leaf.locale, leaf.module] if p] + \
-                leaf.file.split('/')
+            parts = [] if not leaf.locale else [leaf.locale]
+            if leaf.module:
+                parts += leaf.module.split('/')
+            parts += leaf.file.split('/')
         else:
             parts = leaf.split('/')
         return self.__get(parts)
 
     def __get(self, parts):
         common = None
         old = None
         new = tuple(parts)