summaryrefslogtreecommitdiffstats
path: root/command.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-06-03 16:01:11 -0700
committerShawn O. Pearce <sop@google.com>2009-07-03 11:00:16 -0700
commitf1a6b14fdc5402f9ed765a8a342d9c07c5b91e2d (patch)
treef67b0e4fdb68bf3466202a27d5a0732edf424812 /command.py
parentca3d8ff4fc7bac11a747e4f32a81b42a01f4f297 (diff)
downloadgit-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.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/command.py b/command.py
index a941b95a..5ca43f20 100644
--- a/command.py
+++ b/command.py
@@ -17,6 +17,8 @@ import os
17import optparse 17import optparse
18import sys 18import sys
19 19
20import manifest_loader
21
20from error import NoSuchProjectError 22from error import NoSuchProjectError
21 23
22class Command(object): 24class 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 """