Bug 1544797 - clang-format: Use the topsrcdir to generate the paths instead of the pwd r=andi
authorSylvestre Ledru <sledru@mozilla.com>
Tue, 16 Apr 2019 17:38:24 +0000
changeset 469778 ebcc8dd9c2bc
parent 469777 9ca0cca3edb0
child 469779 b674f733df77
push id35882
push usercbrindusan@mozilla.com
push dateWed, 17 Apr 2019 15:54:01 +0000
treeherdermozilla-central@37185c0ae520 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersandi
bugs1544797
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1544797 - clang-format: Use the topsrcdir to generate the paths instead of the pwd r=andi If the user runs mach clang-format from the builddir, it was finding and using unified files. Differential Revision: https://phabricator.services.mozilla.com/D27750
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -2759,17 +2759,19 @@ class StaticAnalysis(MachCommandBase):
     def clang_format(self, assume_filename, path, commit, output_path=None, output_format='diff', verbose=False, outgoing=False):
         # Run clang-format or clang-format-diff on the local changes
         # or files/directories
         if path is None and outgoing:
             repo = get_repository_object(self.topsrcdir)
             path = repo.get_outgoing_files()
 
         if path:
-            path = map(os.path.abspath, path)
+            # Create the full path list
+            path_maker = lambda f_name: os.path.join(self.topsrcdir, f_name)
+            path = map(path_maker, path)
 
         os.chdir(self.topsrcdir)
 
         # Load output file handle, either stdout or a file handle in write mode
         output = None
         if output_path is not None:
             output = sys.stdout if output_path == 'stdout' else open(output_path, 'w')