Mercurial > hgsubversion
changeset 978:70aa5bf7a760
subvertpy wrapper: rename AbstractEditor to BaseEditor
We actually instantiate it, so the name is horribly wrong. While at
it, I gave the two subclasses __slots__ entries as well.
author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
---|---|
date | Sun, 11 Nov 2012 15:31:19 +0100 |
parents | f3d900d320b9 |
children | ce02baa04e53 |
files | hgsubversion/svnwrap/subvertpy_wrapper.py |
diffstat | 1 files changed, 9 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/hgsubversion/svnwrap/subvertpy_wrapper.py +++ b/hgsubversion/svnwrap/subvertpy_wrapper.py @@ -95,7 +95,7 @@ class PathAdapter(object): if self.copyfrom_path: self.copyfrom_path = intern(self.copyfrom_path) -class AbstractEditor(object): +class BaseEditor(object): __slots__ = ('editor', 'baton') def __init__(self, editor, baton=None): @@ -116,7 +116,9 @@ class AbstractEditor(object): def close(self): del self.editor -class FileEditor(AbstractEditor): +class FileEditor(BaseEditor): + __slots__ = () + def __init__(self, editor, baton): super(FileEditor, self).__init__(editor, baton) @@ -130,7 +132,9 @@ class FileEditor(AbstractEditor): self.editor.close_file(self.baton, checksum) super(FileEditor, self).close() -class DirectoryEditor(AbstractEditor): +class DirectoryEditor(BaseEditor): + __slots__ = () + def __init__(self, editor, baton): super(DirectoryEditor, self).__init__(editor, baton) @@ -461,7 +465,7 @@ class SubversionRepo(object): def get_replay(self, revision, editor, oldestrev=0): try: - self.remote.replay(revision, oldestrev, AbstractEditor(editor)) + self.remote.replay(revision, oldestrev, BaseEditor(editor)) except (SubversionException, NotImplementedError), e: # pragma: no cover # can I depend on this number being constant? if (isinstance(e, NotImplementedError) or @@ -476,7 +480,7 @@ class SubversionRepo(object): def get_revision(self, revision, editor): ''' feed the contents of the given revision to the given editor ''' reporter = self.remote.do_update(revision, '', True, - AbstractEditor(editor)) + BaseEditor(editor)) reporter.set_path('', revision, True) reporter.finish()