diff options
author | Tiago Gomes <tiago.gomes@codethink.co.uk> | 2015-11-20 13:57:31 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2016-03-25 02:02:26 +0000 |
commit | 110d04440c5d6ec75bf252802badfe5b992bb38e (patch) | |
tree | 42aca1865b2610c3210ac888991fc3b509cff032 /morphlib/git.py | |
parent | 2f22021e81f65819b3a6f88ac68d20496bd56b15 (diff) | |
download | morph-110d04440c5d6ec75bf252802badfe5b992bb38e.tar.gz |
WIP Add support for multiple sources per chunkbaserock/pedroalvarez/defv8
TODO:
- Add API to the cache server to retrieve a submodule commit from a
given path.
- Fix cross-bootstrap command.
Change-Id: I3475c2bcb648a272fee33bc878a521f79d4e6581
Diffstat (limited to 'morphlib/git.py')
-rw-r--r-- | morphlib/git.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/morphlib/git.py b/morphlib/git.py index cab551ef..fa0d590f 100644 --- a/morphlib/git.py +++ b/morphlib/git.py @@ -34,11 +34,17 @@ class NoModulesFileError(cliapp.AppException): class Submodule(object): - def __init__(self, name, url, path): + def __init__(self, name, url, sha1, path): self.name = name self.url = url + self.commit = sha1 self.path = path + def __str__(self): + return "{name}|{url}|{path}".format(name=self.name, + url=self.url, + path=self.path) + class InvalidSectionError(cliapp.AppException): @@ -48,14 +54,6 @@ class InvalidSectionError(cliapp.AppException): 'title: [%s]' % (repo, ref, section)) -class MissingSubmoduleCommitError(cliapp.AppException): - - def __init__(self, repo, ref, submodule): - Exception.__init__(self, - '%s:%s:.gitmodules: No commit object found for ' - 'submodule "%s"' % (repo, ref, submodule)) - - class Submodules(object): def __init__(self, repo, ref, runcmd_cb=cliapp.runcmd): @@ -87,6 +85,7 @@ class Submodules(object): raise NoModulesFileError(self.repo, self.ref) def _validate_and_read_entries(self, parser): + gd = morphlib.gitdir.GitDirectory(self.repo) for section in parser.sections(): # validate section name against the 'section "foo"' pattern section_pattern = r'submodule "(.*)"' |