diff options
Diffstat (limited to 'git_superproject.py')
| -rw-r--r-- | git_superproject.py | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/git_superproject.py b/git_superproject.py index 935e1250..ce68690f 100644 --- a/git_superproject.py +++ b/git_superproject.py | |||
| @@ -90,7 +90,7 @@ class Superproject(object): | |||
| 90 | self._git_event_log = git_event_log | 90 | self._git_event_log = git_event_log |
| 91 | self._quiet = quiet | 91 | self._quiet = quiet |
| 92 | self._print_messages = print_messages | 92 | self._print_messages = print_messages |
| 93 | self._branch = self._GetBranch() | 93 | self._branch = manifest.branch |
| 94 | self._repodir = os.path.abspath(repodir) | 94 | self._repodir = os.path.abspath(repodir) |
| 95 | self._superproject_dir = superproject_dir | 95 | self._superproject_dir = superproject_dir |
| 96 | self._superproject_path = os.path.join(self._repodir, superproject_dir) | 96 | self._superproject_path = os.path.join(self._repodir, superproject_dir) |
| @@ -100,6 +100,7 @@ class Superproject(object): | |||
| 100 | if self._manifest.superproject: | 100 | if self._manifest.superproject: |
| 101 | remote = self._manifest.superproject['remote'] | 101 | remote = self._manifest.superproject['remote'] |
| 102 | git_name = hashlib.md5(remote.name.encode('utf8')).hexdigest() + '-' | 102 | git_name = hashlib.md5(remote.name.encode('utf8')).hexdigest() + '-' |
| 103 | self._branch = self._manifest.superproject['revision'] | ||
| 103 | self._remote_url = remote.url | 104 | self._remote_url = remote.url |
| 104 | else: | 105 | else: |
| 105 | self._remote_url = None | 106 | self._remote_url = None |
| @@ -116,17 +117,6 @@ class Superproject(object): | |||
| 116 | """Returns the manifest path if the path exists or None.""" | 117 | """Returns the manifest path if the path exists or None.""" |
| 117 | return self._manifest_path if os.path.exists(self._manifest_path) else None | 118 | return self._manifest_path if os.path.exists(self._manifest_path) else None |
| 118 | 119 | ||
| 119 | def _GetBranch(self): | ||
| 120 | """Returns the branch name for getting the approved manifest.""" | ||
| 121 | p = self._manifest.manifestProject | ||
| 122 | b = p.GetBranch(p.CurrentBranch) | ||
| 123 | if not b: | ||
| 124 | return None | ||
| 125 | branch = b.merge | ||
| 126 | if branch and branch.startswith(R_HEADS): | ||
| 127 | branch = branch[len(R_HEADS):] | ||
| 128 | return branch | ||
| 129 | |||
| 130 | def _LogMessage(self, message): | 120 | def _LogMessage(self, message): |
| 131 | """Logs message to stderr and _git_event_log.""" | 121 | """Logs message to stderr and _git_event_log.""" |
| 132 | if self._print_messages: | 122 | if self._print_messages: |
