summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordmichael <dmichael@chromium.org>2015-01-15 15:32:34 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-15 23:33:40 +0000
commitcd4ea7fe9e50ba0ee0ac3f08aeb0bb21653ee00b (patch)
treea7ffdc3368c00c5cf4a89fdb6c15b768fb7aca43
parent43e10274b3707a8946532efc9fee5b1caf4d133f (diff)
downloadchromium_src-cd4ea7fe9e50ba0ee0ac3f08aeb0bb21653ee00b.zip
chromium_src-cd4ea7fe9e50ba0ee0ac3f08aeb0bb21653ee00b.tar.gz
chromium_src-cd4ea7fe9e50ba0ee0ac3f08aeb0bb21653ee00b.tar.bz2
PPAPI generator: Ignore more date-only changes
Previously, the generator could only ignore changes in the: // From FILENAME.idl modified DAY MON DATE TIME YEAR. line if it was not wrapped or wrapped in a specific place. (Note this line would otherwise change every time you generate). This CL makes it a little better, in that it will ignore timestamp changes regardless of where the "modified" output is wrapped. Otherwise, the generator wants to update a few thunk files because it's now 2015. See: https://codereview.chromium.org/849473003/ for context. BUG= R=bbudge@chromium.org Review URL: https://codereview.chromium.org/849283003 Cr-Commit-Position: refs/heads/master@{#311767}
-rwxr-xr-xppapi/generators/idl_outfile.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/ppapi/generators/idl_outfile.py b/ppapi/generators/idl_outfile.py
index 053cf3e..f6a1627 100755
--- a/ppapi/generators/idl_outfile.py
+++ b/ppapi/generators/idl_outfile.py
@@ -54,6 +54,7 @@ class IDLOutFile(object):
curwords = curline.split()
oldwords = oldline.split()
+ # It wasn't a perfect match. Check for changes we should ignore.
# Unmatched lines must be the same length
if len(curwords) != len(oldwords):
return False
@@ -67,16 +68,19 @@ class IDLOutFile(object):
if len(curwords) > 4 and curwords[1] == 'Copyright':
if curwords[4:] == oldwords[4:]: continue
- # Ignore changes to auto generation timestamp when line unwrapped
+ # Ignore changes to auto generation timestamp.
# // From FILENAME.idl modified DAY MON DATE TIME YEAR.
# /* From FILENAME.idl modified DAY MON DATE TIME YEAR. */
- if len(curwords) > 8 and curwords[1] == 'From':
+ # The line may be wrapped, so first deal with the first "From" line.
+ if curwords[1] == 'From':
if curwords[0:4] == oldwords[0:4]: continue
# Ignore changes to auto generation timestamp when line is wrapped
- # * modified DAY MON DATE TIME YEAR.
- if len(curwords) > 6 and curwords[1] == 'modified':
- continue
+ if index > 0:
+ two_line_oldwords = oldlines[index - 1].split() + oldwords[1:]
+ two_line_curwords = curlines[index - 1].split() + curwords[1:]
+ if len(two_line_curwords) > 8 and two_line_curwords[1] == 'From':
+ if two_line_curwords[0:4] == two_line_oldwords[0:4]: continue
return False
return True