X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/c6fc086238de9fefb56169edc148bbcd3ff866fa..ddd5ce2848efb9d43ed14322b1a9fa1494711865:/lib/wlrepo/mercurial_backend/document.py diff --git a/lib/wlrepo/mercurial_backend/document.py b/lib/wlrepo/mercurial_backend/document.py index 0883d99b..3911d042 100644 --- a/lib/wlrepo/mercurial_backend/document.py +++ b/lib/wlrepo/mercurial_backend/document.py @@ -116,23 +116,24 @@ class MercurialDocument(wlrepo.Document): try: if self.ismain(): # main revision of the document - return (True, False) + return self - if self._revision.has_children(): - log.info('Update failed: has children.') - # can't update non-latest revision - return (False, False) + if self._revision.has_children(): + raise UpdateException("Revision has children.") sv = self.shared() if self.parentof(sv): - return (True, False) + return self if sv.ancestorof(self): - return (True, False) + return self - return self._revision.merge_with(sv._revision, user=user, - message="$AUTO$ Personal branch update.") + if self._revision.merge_with(sv._revision, user=user,\ + message="$AUTO$ Personal branch update."): + return self.latest() + else: + raise UpdateException("Merge failed.") finally: lock.release()