X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/3193141f55df20910cf8ba35f9e669d79c90d3f4..a5dd9b05d1136543817c697ecd0d878a1aa4d260:/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()