Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Unified Diff: tools/sort_sources.py

Issue 924743002: Re-sort GYP files with the latest version of tools/source_list.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a typo introduced recently Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/tld_cleanup/tld_cleanup.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/sort_sources.py
diff --git a/tools/sort_sources.py b/tools/sort_sources.py
index 60d388100f387ab462272c074a0f63d17942714a..63f1afdb6d7e7d338d8605cc7fe2c40ab2c2fb78 100755
--- a/tools/sort_sources.py
+++ b/tools/sort_sources.py
@@ -49,14 +49,16 @@ def SortSources(original_lines):
sources.append([line, comments])
comments = []
else:
- if comments:
- output_lines.extend(comments)
- comments = []
+ # |sources| should be flushed first, to handle comments at the end of a
+ # source list correctly.
if sources:
for source_line, source_comments in sorted(sources):
output_lines.extend(source_comments)
output_lines.append(source_line)
sources = []
+ if comments:
+ output_lines.extend(comments)
+ comments = []
output_lines.append(line)
return output_lines
« no previous file with comments | « net/tools/tld_cleanup/tld_cleanup.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698