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 |