X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/de93104a2513acc5a378496c6bf6ab7ed0d45d60..dbd31e1486a3f2a94cb6828ee5ceb7dee783091f:/lib/wlrepo/__init__.py diff --git a/lib/wlrepo/__init__.py b/lib/wlrepo/__init__.py index 430e59f9..9de75a02 100644 --- a/lib/wlrepo/__init__.py +++ b/lib/wlrepo/__init__.py @@ -18,7 +18,7 @@ class Library(object): """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 @@ -108,6 +108,10 @@ class LibraryException(Exception): 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=[]):