refactor: remove unneeded patch_count variable (#28467)
This commit is contained in:
parent
976222b509
commit
e323bfe661
1 changed files with 2 additions and 4 deletions
|
@ -306,7 +306,6 @@ def export_patches(repo, out_dir, patch_range=None, dry_run=False):
|
||||||
# If we're doing a dry run, iterate through each patch and see if the newly
|
# If we're doing a dry run, iterate through each patch and see if the newly
|
||||||
# exported patch differs from what exists. Report number of mismatched
|
# exported patch differs from what exists. Report number of mismatched
|
||||||
# patches and fail if there's more than one.
|
# patches and fail if there's more than one.
|
||||||
patch_count = 0
|
|
||||||
bad_patches = []
|
bad_patches = []
|
||||||
for patch in patches:
|
for patch in patches:
|
||||||
filename = get_file_name(patch)
|
filename = get_file_name(patch)
|
||||||
|
@ -314,12 +313,11 @@ def export_patches(repo, out_dir, patch_range=None, dry_run=False):
|
||||||
existing_patch = unicode(io.open(filepath, 'rb').read(), "utf-8")
|
existing_patch = unicode(io.open(filepath, 'rb').read(), "utf-8")
|
||||||
formatted_patch = join_patch(patch)
|
formatted_patch = join_patch(patch)
|
||||||
if formatted_patch != existing_patch:
|
if formatted_patch != existing_patch:
|
||||||
patch_count += 1
|
|
||||||
bad_patches.append(filename)
|
bad_patches.append(filename)
|
||||||
if patch_count > 0:
|
if len(bad_patches) > 0:
|
||||||
sys.stderr.write(
|
sys.stderr.write(
|
||||||
"Patches in {} not up to date: {} patches need update\n-- {}\n".format(
|
"Patches in {} not up to date: {} patches need update\n-- {}\n".format(
|
||||||
out_dir, patch_count, "\n-- ".join(bad_patches)
|
out_dir, len(bad_patches), "\n-- ".join(bad_patches)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue