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

Unified Diff: gcl.py

Issue 507072: Factor out PathDifference into gclient_utils for a later reuse. (Closed)
Patch Set: Created 11 years 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 | gclient_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcl.py
diff --git a/gcl.py b/gcl.py
index 84819279b9de3b2e258e450bc0387ef75bdfae30..34b97d7b2c0591636f14a1ff4120058c058c20d6 100755
--- a/gcl.py
+++ b/gcl.py
@@ -819,18 +819,6 @@ def TryChange(change_info, args, swallow_exception):
return
ErrorExit("You need to install trychange.py to use the try server.")
- def PathDifference(root, subpath):
- """Returns the difference subpath minus root."""
- root = os.path.realpath(root)
- subpath = os.path.realpath(subpath)
- if not subpath.startswith(root):
- return None
- # If the root does not have a trailing \ or /, we add it so the returned
- # path starts immediately after the seperator regardless of whether it is
- # provided.
- root = os.path.join(root, '')
- return subpath[len(root):]
-
trychange_args = []
settings = {
'port': GetCodeReviewSetting('TRYSERVER_HTTP_PORT'),
@@ -846,8 +834,9 @@ def TryChange(change_info, args, swallow_exception):
gclient_root = gclient_utils.FindGclientRoot(GetRepositoryRoot())
if gclient_root:
- trychange_args.extend(['--root', PathDifference(gclient_root,
- GetRepositoryRoot())])
+ trychange_args.extend(['--root',
+ gclient_utils.PathDifference(gclient_root,
+ GetRepositoryRoot())])
if change_info:
trychange_args.extend(['--name', change_info.name])
if change_info.issue:
« no previous file with comments | « no previous file | gclient_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698