blob: c03cb4a7cdb7317b5adcb62af31e27a9123bbeb5 [file] [log] [blame]
Shawn O. Pearcef1a6b142009-06-03 16:01:11 -07001#
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
16import os
17
Shawn O. Pearce87bda122009-07-03 16:37:30 -070018from error import ManifestParseError
Shawn O. Pearcef1a6b142009-06-03 16:01:11 -070019from editor import Editor
20from git_config import GitConfig
21from project import MetaProject
22
23class 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. Pearcecc6c7962009-07-03 15:29:02 -070039
40 @property
41 def projects(self):
42 return {}
43
Shawn O. Pearce13f3da52010-12-07 10:31:19 -080044 @property
45 def notice(self):
46 return None
47
48 @property
49 def manifest_server(self):
50 return None
51
Shawn O. Pearce75b87c82009-07-03 16:24:57 -070052 def InitBranch(self):
53 pass
54
Shawn O. Pearcecc6c7962009-07-03 15:29:02 -070055 def SetMRefs(self, project):
56 pass
Shawn O. Pearce87bda122009-07-03 16:37:30 -070057
58 def Upgrade_Local(self, old):
59 raise ManifestParseError, 'unsupported upgrade path'