diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 0be5b3f02..790cd5de0 100644 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -73,7 +73,6 @@ def CommonChecks(input_api, output_api, tests_to_black_list, run_on_python3): r'.*download_from_google_storage_unittest\.py$', r'.*gclient_scm_test\.py$', r'.*gclient_smoketest\.py$', - r'.*gclient_test\.py$', r'.*git_cache_test\.py$', r'.*git_cl_test\.py$', r'.*git_common_test\.py$', diff --git a/git_cache.py b/git_cache.py index 8d050c36c..4d3892df9 100755 --- a/git_cache.py +++ b/git_cache.py @@ -69,7 +69,7 @@ def exponential_backoff_retry(fn, excs=(Exception,), name=None, count=10, Returns: The return value of the successful fn. """ printerr = printerr or logging.warning - for i in xrange(count): + for i in range(count): try: return fn() except excs as e: @@ -268,7 +268,13 @@ class Mirror(object): def UrlToCacheDir(url): """Convert a git url to a normalized form for the cache dir path.""" parsed = urlparse.urlparse(url) - norm_url = parsed.netloc + parsed.path + # Get rid of the port. This is only needed for Windows tests, since tests + # serve git from git://localhost:port/git, but Windows doesn't like ':' in + # paths. + netloc = parsed.netloc + if ':' in netloc: + netloc = netloc.split(':', 1)[0] + norm_url = netloc + parsed.path if norm_url.endswith('.git'): norm_url = norm_url[:-len('.git')] diff --git a/tests/gclient_test.py b/tests/gclient_test.py index 03b63167c..1f959ce3e 100755 --- a/tests/gclient_test.py +++ b/tests/gclient_test.py @@ -802,8 +802,8 @@ class GclientTest(trial_dir.TestCase): self.assertEqual( [ ('foo', 'svn://example.com/foo'), - ('foo/bar', 'svn://example.com/bar'), - ('foo/baz', 'svn://example.com/baz'), + (os.path.join('foo', 'bar'), 'svn://example.com/bar'), + (os.path.join('foo', 'baz'), 'svn://example.com/baz'), ], self._get_processed()) @@ -839,8 +839,8 @@ class GclientTest(trial_dir.TestCase): self.assertEqual( [ ('foo', 'svn://example.com/foo'), - ('foo/bar', 'svn://example.com/bar'), - ('foo/bar/baz', 'svn://example.com/baz'), + (os.path.join('foo', 'bar'), 'svn://example.com/bar'), + (os.path.join('foo', 'bar', 'baz'), 'svn://example.com/baz'), ], self._get_processed()) @@ -878,8 +878,8 @@ class GclientTest(trial_dir.TestCase): self.assertEqual( [ ('foo', 'svn://example.com/foo'), - ('foo/third_party/bar', 'svn://example.com/bar'), - ('foo/third_party/baz', 'svn://example.com/baz'), + (os.path.join('foo', 'third_party', 'bar'), 'svn://example.com/bar'), + (os.path.join('foo', 'third_party', 'baz'), 'svn://example.com/baz'), ], self._get_processed())