Shawn O. Pearce | f1a6b14 | 2009-06-03 16:01:11 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2009 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | import os |
| 17 | |
Shawn O. Pearce | 87bda12 | 2009-07-03 16:37:30 -0700 | [diff] [blame] | 18 | from error import ManifestParseError |
Shawn O. Pearce | f1a6b14 | 2009-06-03 16:01:11 -0700 | [diff] [blame] | 19 | from editor import Editor |
| 20 | from git_config import GitConfig |
| 21 | from project import MetaProject |
| 22 | |
| 23 | class Manifest(object): |
| 24 | """any manifest format""" |
| 25 | |
| 26 | def __init__(self, repodir): |
| 27 | self.repodir = os.path.abspath(repodir) |
| 28 | self.topdir = os.path.dirname(self.repodir) |
| 29 | self.globalConfig = GitConfig.ForUser() |
| 30 | Editor.globalConfig = self.globalConfig |
| 31 | |
| 32 | self.repoProject = MetaProject(self, 'repo', |
| 33 | gitdir = os.path.join(repodir, 'repo/.git'), |
| 34 | worktree = os.path.join(repodir, 'repo')) |
| 35 | |
| 36 | @property |
| 37 | def IsMirror(self): |
| 38 | return self.manifestProject.config.GetBoolean('repo.mirror') |
Shawn O. Pearce | cc6c796 | 2009-07-03 15:29:02 -0700 | [diff] [blame] | 39 | |
| 40 | @property |
| 41 | def projects(self): |
| 42 | return {} |
| 43 | |
Shawn O. Pearce | 13f3da5 | 2010-12-07 10:31:19 -0800 | [diff] [blame] | 44 | @property |
| 45 | def notice(self): |
| 46 | return None |
| 47 | |
| 48 | @property |
| 49 | def manifest_server(self): |
| 50 | return None |
| 51 | |
Shawn O. Pearce | 75b87c8 | 2009-07-03 16:24:57 -0700 | [diff] [blame] | 52 | def InitBranch(self): |
| 53 | pass |
| 54 | |
Shawn O. Pearce | cc6c796 | 2009-07-03 15:29:02 -0700 | [diff] [blame] | 55 | def SetMRefs(self, project): |
| 56 | pass |
Shawn O. Pearce | 87bda12 | 2009-07-03 16:37:30 -0700 | [diff] [blame] | 57 | |
| 58 | def Upgrade_Local(self, old): |
| 59 | raise ManifestParseError, 'unsupported upgrade path' |