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

Unified Diff: gclient_utils.py

Issue 500015: gclient: implement a less hacky relative URL implementation (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
Index: gclient_utils.py
diff --git a/gclient_utils.py b/gclient_utils.py
index e2cfb11b3fe91b4ecc5af06ca17ff6cb397085b6..3a6438d1c0226dd1bf8d1d288e574dbdef0ed399 100644
--- a/gclient_utils.py
+++ b/gclient_utils.py
@@ -38,6 +38,17 @@ def SplitUrlRevision(url):
return tuple(components)
+def FullUrlFromRelative(base_url, url):
+ # Find the forth '/' and strip from there. A bit hackish.
+ return '/'.join(base_url.split('/')[:4]) + url
+
+
+def FullUrlFromRelative2(base_url, url):
M-A Ruel 2009/12/15 18:49:42 Frankly, I would have prefered it to be SCM-depend
Mandeep Singh Baines 2009/12/15 20:54:30 k, I'll send out a CL to do that. I don't want to
+ # Strip from last '/'
+ # Equivalent to unix basename
+ return base_url[:base_url.rfind('/')] + url
+
+
def ParseXML(output):
try:
return xml.dom.minidom.parseString(output)

Powered by Google App Engine
This is Rietveld 408576698