diff options
author | Shawn O. Pearce <sop@google.com> | 2009-06-03 16:01:11 -0700 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2009-07-03 11:00:16 -0700 |
commit | f1a6b14fdc5402f9ed765a8a342d9c07c5b91e2d (patch) | |
tree | f67b0e4fdb68bf3466202a27d5a0732edf424812 /command.py | |
parent | ca3d8ff4fc7bac11a747e4f32a81b42a01f4f297 (diff) | |
download | git-repo-f1a6b14fdc5402f9ed765a8a342d9c07c5b91e2d.tar.gz |
Create an abstract Manifest base class
This will help as we add support for another manifest type.
Signed-off-by: Shawn O. Pearce <sop@google.com>
Diffstat (limited to 'command.py')
-rw-r--r-- | command.py | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -17,6 +17,8 @@ import os | |||
17 | import optparse | 17 | import optparse |
18 | import sys | 18 | import sys |
19 | 19 | ||
20 | import manifest_loader | ||
21 | |||
20 | from error import NoSuchProjectError | 22 | from error import NoSuchProjectError |
21 | 23 | ||
22 | class Command(object): | 24 | class Command(object): |
@@ -24,7 +26,6 @@ class Command(object): | |||
24 | """ | 26 | """ |
25 | 27 | ||
26 | common = False | 28 | common = False |
27 | manifest = None | ||
28 | _optparse = None | 29 | _optparse = None |
29 | 30 | ||
30 | def WantPager(self, opt): | 31 | def WantPager(self, opt): |
@@ -57,6 +58,13 @@ class Command(object): | |||
57 | """ | 58 | """ |
58 | raise NotImplementedError | 59 | raise NotImplementedError |
59 | 60 | ||
61 | @property | ||
62 | def manifest(self): | ||
63 | return self.GetManifest() | ||
64 | |||
65 | def GetManifest(self, reparse=False): | ||
66 | return manifest_loader.GetManifest(self.repodir, reparse) | ||
67 | |||
60 | def GetProjects(self, args, missing_ok=False): | 68 | def GetProjects(self, args, missing_ok=False): |
61 | """A list of projects that match the arguments. | 69 | """A list of projects that match the arguments. |
62 | """ | 70 | """ |