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

Unified Diff: trychange.py

Issue 8050017: Extract filenames from diffs better. (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools/
Patch Set: Created 9 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trychange.py
===================================================================
--- trychange.py (revision 102930)
+++ trychange.py (working copy)
@@ -478,7 +478,11 @@
for i in range(len(diff)):
if diff[i].startswith('--- ') or diff[i].startswith('+++ '):
new_file = posixpath.join(path_diff, diff[i][4:]).replace('\\', '/')
- changed_files.append(('M', new_file.split('\t')[0]))
+ if diff[i].startswith('--- '):
M-A Ruel 2011/09/27 15:00:45 Maybe time to? import patch patchset = (call func
Alexei Svitkine (slow) 2011/09/27 15:05:13 Maybe next time. ;)
+ file_path = new_file.split('\t')[0].strip()
+ if file_path.startswith('a/'):
+ file_path = file_path[2:]
+ changed_files.append(('M', file_path))
diff[i] = diff[i][0:4] + new_file
return (diff, changed_files)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698