Bug 1410969 - Properly resolve wildcards in `mach file-info`; r?ahal draft
authorGregory Szorc <gps@mozilla.com>
Mon, 23 Oct 2017 10:49:55 -0700
changeset 685486 8b2151c9d49d87a41bac2eca57dc83cd432191e8
parent 685485 3a633548ece958a0265ed8ee0b6d7ce9633d023b
child 685487 0a8eb90576c6e80e9093665054815704f7751370
push id85942
push usergszorc@mozilla.com
push dateTue, 24 Oct 2017 17:18:32 +0000
reviewersahal
bugs1410969, 1397406
milestone58.0a1
Bug 1410969 - Properly resolve wildcards in `mach file-info`; r?ahal I likely regressed this as part of e9416a307987 (bug 1397406). Before this change, '*' in filenames didn't work. MozReview-Commit-ID: 33m83H6UTZ
python/mozbuild/mozbuild/frontend/mach_commands.py
--- a/python/mozbuild/mozbuild/frontend/mach_commands.py
+++ b/python/mozbuild/mozbuild/frontend/mach_commands.py
@@ -182,17 +182,21 @@ class MozbuildFileCommands(MachCommandBa
                 if p not in all_paths_set:
                     all_paths_set.add(p)
                     allpaths.append(p)
                 continue
 
             if rev:
                 raise InvalidPathException('cannot use wildcard in version control mode')
 
-            for path, f in reader.finder.find(p):
+            # finder is rooted at / for now.
+            # TODO bug 1171069 tracks changing to relative.
+            search = mozpath.join(self.topsrcdir, p)[1:]
+            for path, f in reader.finder.find(search):
+                path = path[len(self.topsrcdir):]
                 if path not in all_paths_set:
                     all_paths_set.add(path)
                     allpaths.append(path)
 
         return reader.files_info(allpaths)
 
 
     @SubCommand('file-info', 'schedules',