X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/51d914bc0007135058a61623a2d057d2a7626a28..05dbee77e04a759128a17cb988cb94732490f641:/lib/wlrepo/mercurial_backend/document.py diff --git a/lib/wlrepo/mercurial_backend/document.py b/lib/wlrepo/mercurial_backend/document.py index 3f94097a..d1c3e53d 100644 --- a/lib/wlrepo/mercurial_backend/document.py +++ b/lib/wlrepo/mercurial_backend/document.py @@ -50,6 +50,10 @@ class MercurialDocument(wlrepo.Document): ops(self._library, entry_path) message, user = commit_info(self) + + message = self._library._sanitize_string(message) + user = self._library._sanitize_string(user) + self._library._commit(message, user) try: return self._library.document(docid=self.id, user=user) @@ -98,15 +102,21 @@ class MercurialDocument(wlrepo.Document): return (True, False) if self._revision.has_children(): + print 'Update failed: has children.' # can't update non-latest revision return (False, False) sv = self.shared() - - if not sv.ancestorof(self) and not self.parentof(sv): - return self._revision.merge_with(sv._revision, user=user) - return (False, False) + if self.parentof(sv): + return (True, False) + + if sv.ancestorof(self): + return (True, False) + + + return self._revision.merge_with(sv._revision, user=user, + message="$AUTO$ Personal branch update.") finally: lock.release() @@ -180,7 +190,7 @@ class MercurialDocument(wlrepo.Document): return False if changed: - local = local.latest() + local = self.latest()._revision success, changed = main.merge_with(local, user=user,\ message=message)