summaryrefslogtreecommitdiff
path: root/morph
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-05-03 16:24:30 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-05-04 14:30:00 +0100
commitc6cad5a28df8c468a56887b374e16e925034575b (patch)
treef40e2c7c25ef35ad008739e56408f9d95909d625 /morph
parent1bf0f127c3e0252a290cf4920f9dfc593f76b0a8 (diff)
downloadmorph-c6cad5a28df8c468a56887b374e16e925034575b.tar.gz
Resolve repository names to URLs before deciding on basenames for directories
Diffstat (limited to 'morph')
-rwxr-xr-xmorph12
1 files changed, 11 insertions, 1 deletions
diff --git a/morph b/morph
index 09450819..291caf79 100755
--- a/morph
+++ b/morph
@@ -581,6 +581,15 @@ class Morph(cliapp.Application):
raise cliapp.AppException("Can't find the mine directory")
self.output.write('%s\n' % dirname)
+ def _resolve_reponame(self, reponame):
+ '''Return the full pull URL of a reponame.'''
+
+ # Setup.
+ aliases = self.settings['repo-alias']
+ cache = morphlib.localrepocache.LocalRepoCache(None, aliases, None)
+
+ return cache.pull_url(reponame)
+
def _clone_to_directory(self, dirname, reponame, ref):
'''Clone a repository below a directory.
@@ -681,7 +690,7 @@ class Morph(cliapp.Application):
raise cliapp.AppException('morph edit must get a repository name '
'and commit ref as argument')
- repo = args[0]
+ repo = self._resolve_reponame(args[0])
ref = args[1]
mine_directory = self._deduce_mine_directory()
@@ -710,6 +719,7 @@ class Morph(cliapp.Application):
this_branch = self._deduce_system_branch()
for repo in args[1:]:
+ repo = self._resolve_reponame(repo)
basename = os.path.basename(repo)
pull_from = os.path.join(mine, other_branch, basename)
repo_dir = os.path.join(mine, this_branch, basename)