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

Unified Diff: gclient_scm.py

Issue 546022: gclient: git relative url implementation (Closed)
Patch Set: Created 10 years, 11 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 | « gclient.py ('k') | gclient_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_scm.py
diff --git a/gclient_scm.py b/gclient_scm.py
index 9aa0f0609ec8997286cabdc4fc1a3ce18327ca4f..b564ed48ea5affd1e8f12951260c98e7204f1b89 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -249,6 +249,12 @@ class GitWrapper(SCMWrapper, scm.GIT):
files = self._Run(['diff', '--name-only', merge_base]).split()
file_list.extend([os.path.join(self.checkout_path, f) for f in files])
+ def FullUrlForRelativeUrl(self, url):
+ # Strip from last '/'
+ # Equivalent to unix basename
+ base_url = self.url
+ return base_url[:base_url.rfind('/')] + url
+
def _CheckMinVersion(self, min_version):
def only_int(val):
if val.isdigit():
@@ -528,3 +534,7 @@ class SVNWrapper(SCMWrapper, scm.SVN):
# There's no file list to retrieve.
else:
self.RunAndGetFileList(options, command, path, file_list)
+
+ def FullUrlForRelativeUrl(self, url):
+ # Find the forth '/' and strip from there. A bit hackish.
+ return '/'.join(self.url.split('/')[:4]) + url
« no previous file with comments | « gclient.py ('k') | gclient_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698