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

Unified Diff: git-try

Issue 213004: Modify git-try so that when files are added, it munges... (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools/
Patch Set: '' Created 11 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: git-try
===================================================================
--- git-try (revision 25816)
+++ git-try (working copy)
@@ -62,10 +62,10 @@
'branch.%s.rietveldpatchset' % GetBranchName()])
-def GetMungedDiff(branch):
+def GetMungedDiff(branch, prefix='src/'):
"""Get the diff we'll send to the try server. We munge paths to match svn."""
# Make the following changes:
- # - Prepend "src/" to paths as svn is expecting
+ # - Prepend "src/" (or some other prefix) to paths as svn is expecting
# - In the case of added files, replace /dev/null with the path to the file
# being added.
output = []
@@ -78,9 +78,9 @@
for i in range(len(diff)):
line = diff[i]
if line.startswith('--- /dev/null'):
- line = '--- %s' % diff[i+1][4:]
+ line = '--- %s' % prefix + diff[i+1][4:]
elif line.startswith('--- ') or line.startswith('+++ '):
- line = line[0:4] + 'src/' + line[4:]
+ line = line[0:4] + prefix + line[4:]
output.append(line)
munged_diff = ''.join(output)
« 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