Bug 1410938 - Split the clang-format calls into batches of 200 files r=gps

MozReview-Commit-ID: 3cH295RBcv3

--HG--
extra : rebase_source : 68765af2185f73820963da052d3aec036358a2e5
This commit is contained in:
Sylvestre Ledru 2017-10-23 18:14:32 +02:00
parent 38b3c273db
commit c879ade558

View File

@ -343,18 +343,25 @@ class FormatProvider(MachCommandBase):
if path_list == []:
return
args += path_list
print("Processing %d file(s)..." % len(path_list))
batchsize = 200
for i in range(0, len(path_list), batchsize):
l = path_list[i: (i + batchsize)]
# Run clang-format on the list
cf_process = Popen(args + l)
# Wait until the process is over
cf_process.communicate()[0]
# Run clang-format
cf_process = Popen(args)
if show:
# show the diff
if self.repository.name == 'hg':
cf_process = Popen(["hg", "diff"] + path_list)
cf_process = Popen(["hg", "diff"] + paths)
else:
assert self.repository.name == 'git'
cf_process = Popen(["git", "diff"] + path_list)
return cf_process.communicate()[0]
cf_process = Popen(["git", "diff"] + paths)
cf_process.communicate()[0]
def mozregression_import():