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

Unified Diff: patch.py

Issue 8539016: Fix deleted empty files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 1 month 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 | « no previous file | testing_support/patches_data.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: patch.py
diff --git a/patch.py b/patch.py
index 4c96de3561339925048cd4398b3636191634b599..4a67cadfced14efa28c9e232399593b3dafaae02 100644
--- a/patch.py
+++ b/patch.py
@@ -289,7 +289,13 @@ class FilePatchDiff(FilePatchBase):
(match.group(1), line))
return
- # Ignore "deleted file mode 100644" since it's not needed.
+ match = re.match(r'^deleted file mode (\d{6})$', line)
+ if match:
+ # It is necessary to parse it because there may be no hunk, like when the
+ # file was empty.
+ self.is_delete = True
+ return
+
match = re.match(r'^new(| file) mode (\d{6})$', line)
if match:
mode = match.group(2)
@@ -297,6 +303,7 @@ class FilePatchDiff(FilePatchBase):
# TODO(maruel): Add support to remove a property.
if bool(int(mode[4]) & 1):
self.svn_properties.append(('svn:executable', '*'))
+ return
match = re.match(r'^--- (.*)$', line)
if match:
« no previous file with comments | « no previous file | testing_support/patches_data.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698