Zmiana nazwy project -> platforma.
[redakcja.git] / lib / wlrepo / mercurial_backend / document.py
index fcfd14c..a8f7adc 100644 (file)
@@ -50,6 +50,10 @@ class MercurialDocument(wlrepo.Document):
             
             ops(self._library, entry_path)
             message, user = commit_info(self)
             
             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)
             self._library._commit(message, user)
             try:
                 return self._library.document(docid=self.id, user=user)
@@ -111,7 +115,8 @@ class MercurialDocument(wlrepo.Document):
                 return (True, False)
 
 
                 return (True, False)
 
 
-            return self._revision.merge_with(sv._revision, user=user)
+            return self._revision.merge_with(sv._revision, user=user,
+                message="$AUTO$ Personal branch update.")
         finally:
             lock.release()  
 
         finally:
             lock.release()  
 
@@ -156,6 +161,9 @@ class MercurialDocument(wlrepo.Document):
                 if not local.parentof(main):
                     success, changed = main.merge_with(local, user=user, message=message)
 
                 if not local.parentof(main):
                     success, changed = main.merge_with(local, user=user, message=message)
 
+                success = True
+                changed = False
+
             # Case 3:
             # main *
             #      |
             # Case 3:
             # main *
             #      |
@@ -175,6 +183,9 @@ class MercurialDocument(wlrepo.Document):
                 if not local.parentof(main):
                     success, changed = local.merge_with(main, user=user, \
                         message='$AUTO$ Local branch update during share.')
                 if not local.parentof(main):
                     success, changed = local.merge_with(main, user=user, \
                         message='$AUTO$ Local branch update during share.')
+
+                success = True
+                changed = False
                     
             else:
                 print "case 4"
                     
             else:
                 print "case 4"
@@ -185,7 +196,7 @@ class MercurialDocument(wlrepo.Document):
                     return False
 
                 if changed:
                     return False
 
                 if changed:
-                    local = local.latest()
+                    local = self.latest()._revision
                     
                 success, changed = main.merge_with(local, user=user,\
                     message=message)
                     
                 success, changed = main.merge_with(local, user=user,\
                     message=message)