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

Unified Diff: tools/isolate/isolate.py

Issue 10091011: Added function to get native path case on Windows and OSX. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase against 10080013 Created 8 years, 8 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 | « tools/isolate/data/trace_inputs/child2.py ('k') | tools/isolate/isolate_smoke_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/isolate/isolate.py
diff --git a/tools/isolate/isolate.py b/tools/isolate/isolate.py
index dcf361143f5d8f5db88e0c3500d086833490cf0f..adae8793721026061991df7536a1a6e9f9e4cbe3 100755
--- a/tools/isolate/isolate.py
+++ b/tools/isolate/isolate.py
@@ -391,7 +391,12 @@ def MODEtrace(_outdir, indir, data):
product_dir = None
if data['resultdir'] and indir:
# Defaults to none if both are the same directory.
- product_dir = os.path.relpath(data['resultdir'], indir) or None
+ try:
+ product_dir = os.path.relpath(data['resultdir'], indir) or None
+ except ValueError:
+ # This happens on Windows if data['resultdir'] is one drive, let's say
+ # 'C:\' and indir on another one like 'D:\'.
+ product_dir = None
if not data['command']:
print 'No command to run'
return 1
@@ -439,7 +444,9 @@ def process_options(variables, resultfile, input_file, error):
# The trick used to determine the root directory is to look at "how far" back
# up it is looking up.
# TODO(maruel): Stop the msbuild generator from generating a mix of / and \\.
- root_dir = isolate_dir.replace(os.path.sep, '/')
+ isolate_dir_replaced = isolate_dir.replace(os.path.sep, '/')
+ root_dir = isolate_dir_replaced
+ logging.debug('root_dir before searching: %s' % root_dir)
for i in infiles:
i = i.replace(os.path.sep, '/')
x = isolate_dir.replace(os.path.sep, '/')
@@ -450,9 +457,12 @@ def process_options(variables, resultfile, input_file, error):
if root_dir.startswith(x):
root_dir = x
root_dir = root_dir.replace('/', os.path.sep)
+ logging.debug('root_dir after searching: %s' % root_dir)
+
# The relative directory is automatically determined by the relative path
# between root_dir and the directory containing the .isolate file.
- relative_dir = os.path.relpath(isolate_dir, root_dir)
+ relative_dir = os.path.relpath(isolate_dir, root_dir).replace(
+ os.path.sep, '/')
logging.debug('relative_dir: %s' % relative_dir)
logging.debug(
« no previous file with comments | « tools/isolate/data/trace_inputs/child2.py ('k') | tools/isolate/isolate_smoke_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698