summaryrefslogtreecommitdiff
path: root/morphlib/sourcemanager.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-03-23 16:48:21 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-03-23 16:48:21 +0000
commiteb591e2ccd511aa3d9e33af49efdb2c7ce10fc9e (patch)
treeb77fa7a5980cf4fa951d526066cd955449e33aed /morphlib/sourcemanager.py
parentf6a019d1fe6eb85cb774e85c0d0a04e4c05b0107 (diff)
downloadmorph-eb591e2ccd511aa3d9e33af49efdb2c7ce10fc9e.tar.gz
Add cmdtest for morph branch to set origin correctly
Diffstat (limited to 'morphlib/sourcemanager.py')
-rw-r--r--morphlib/sourcemanager.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/morphlib/sourcemanager.py b/morphlib/sourcemanager.py
index 21c99fa9..2747a2c9 100644
--- a/morphlib/sourcemanager.py
+++ b/morphlib/sourcemanager.py
@@ -164,6 +164,7 @@ class SourceManager(object):
repo_urls = [urlparse.urljoin(fixup_url(x), repo)
for x in self.settings['git-base-url']]
+ orig_url = None
cached_repo = None
errors = []
@@ -172,6 +173,7 @@ class SourceManager(object):
quoted_url = quote_url(repo_url)
cached_repo_dirname = os.path.join(self.cache_dir, quoted_url)
if os.path.exists(cached_repo_dirname):
+ orig_url = repo_url
cached_repo = cached_repo_dirname
break
@@ -183,6 +185,7 @@ class SourceManager(object):
cached_repo, error = self._cache_repo_from_bundle(server,
repo_url)
if cached_repo:
+ orig_url = repo_url
break
else:
errors.append(error)
@@ -193,6 +196,7 @@ class SourceManager(object):
for repo_url in repo_urls:
cached_repo, error = self._cache_repo_from_url(repo_url)
if cached_repo:
+ orig_url = repo_url
break
else:
errors.append(error)
@@ -227,7 +231,7 @@ class SourceManager(object):
# we should have a cached version of the repo now, return a treeish
# for the repo and ref tuple
- treeish = morphlib.git.Treeish(cached_repo, repo, ref, self.msg)
+ treeish = morphlib.git.Treeish(cached_repo, orig_url, ref, self.msg)
self.indent_less()
return treeish