"""Retrieve a document in the specified revision."""
pass
- def document(self, docid, user=None):
+ def document(self, docid, user=None, rev='latest'):
"""Retrieve a document from a library."""
pass
Should be called on the user version of document. If not, it doesn nothing."""
def data(self, entry):
- """Returns the specified entry as a file-like object."""
+ """Returns the specified entry as a unicode data."""
pass
@property
def parentof(self, other):
return self._revision.parentof(other._revision)
+ def has_parent_from(self, other):
+ return self._revision.has_parent_from(other._revision)
+
def ancestorof(self, other):
return self._revision.ancestorof(other._revision)
Exception.__init__(self, msg)
self.cause = cause
+class UpdateException(LibraryException):
+ pass
+
class RevisionNotFound(LibraryException):
def __init__(self, rev):
LibraryException.__init__(self, "Revision %r not found." % rev)
+
+class RevisionMismatch(LibraryException):
+ def __init__(self, fdi, rev):
+ LibraryException.__init__(self, "No revision %r for document %r." % (rev, fdi))
class EntryNotFound(LibraryException):
def __init__(self, rev, entry, guesses=[]):
def open_library(path, proto, *args, **kwargs):
if proto == 'hg':
- import wlrepo.mercurial_backend
- return wlrepo.mercurial_backend.MercurialLibrary(path, *args, **kwargs)
+ import wlrepo.mercurial_backend.library
+ return wlrepo.mercurial_backend.library.MercurialLibrary(path, *args, **kwargs)
raise NotImplemented()
\ No newline at end of file