blob: f737e86601661b419bd9d4b785ca8fe8f2af329d [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. Pearce75b87c82009-07-03 16:24:57 -070044 def InitBranch(self):
45 pass
46
Shawn O. Pearcecc6c7962009-07-03 15:29:02 -070047 def SetMRefs(self, project):
48 pass
Shawn O. Pearce87bda122009-07-03 16:37:30 -070049
50 def Upgrade_Local(self, old):
51 raise ManifestParseError, 'unsupported upgrade path'