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>
This commit is contained in:
Shawn O. Pearce
2009-07-03 11:00:16 -07:00
parent ca3d8ff4fc
commit f1a6b14fdc
7 changed files with 99 additions and 39 deletions
+9 -1
View File
@@ -17,6 +17,8 @@ import os
import optparse
import sys
import manifest_loader
from error import NoSuchProjectError
class Command(object):
@@ -24,7 +26,6 @@ class Command(object):
"""
common = False
manifest = None
_optparse = None
def WantPager(self, opt):
@@ -57,6 +58,13 @@ class Command(object):
"""
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.
"""