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>
diff --git a/command.py b/command.py
index a941b95..5ca43f2 100644
--- a/command.py
+++ b/command.py
@@ -17,6 +17,8 @@
import optparse
import sys
+import manifest_loader
+
from error import NoSuchProjectError
class Command(object):
@@ -24,7 +26,6 @@
"""
common = False
- manifest = None
_optparse = None
def WantPager(self, opt):
@@ -57,6 +58,13 @@
"""
raise NotImplementedError
+ @property
+ def manifest(self):
+ return self.GetManifest()
+
+ def GetManifest(self, reparse=False):
+ return manifest_loader.GetManifest(self.repodir, reparse)
+
def GetProjects(self, args, missing_ok=False):
"""A list of projects that match the arguments.
"""