# HG changeset patch # User Dan Villiom Podlaski Christiansen # Date 2011-04-30 17:36:48 # Node ID d3f7e110c3c0ba9a2398c8609ee5215d259f14ed # Parent e83ced8b6464ff8f4c6cd9e4b780ba4b5d6208e0 opener: introduce an abstact superclass of it Currently, this class doesn't do anything useful. diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -129,7 +129,14 @@ class path_auditor(object): # want to add "foo/bar/baz" before checking if there's a "foo/.hg" self.auditeddir.update(prefixes) -class opener(object): +class abstractopener(object): + """Abstract base class; cannot be instantiated""" + + def __init__(self, *args, **kwargs): + '''Prevent instantiation; don't call this from subclasses.''' + raise NotImplementedError('attempted instantiating ' + str(type(self))) + +class opener(abstractopener): '''Open files relative to a base directory This class is used to hide the details of COW semantics and