Commits

Jan Borsodi committed acfe610

hob.repo: A service that changes from draft to published is seen as an update.

Comments (0)

Files changed (1)

     "PROT008": "Service %(name)s %(version)s has already been released (ie. not a draft) remotely, local service has modifications.",
     "PROT009": "New command: %(cmd_name)s(%(message_path)s) returns (%(response_path)s) = %(cmd_id)d;",
     "PROT010": "New event: %(cmd_name)s returns (%(response_path)s) = %(cmd_id)d;",
+    "PROT011": "Service %(name)s %(version)s has changed from draft to published.",
     }
 
 # Codes related to message
                            })
                 if self.checkDraft:
                     res = MESSAGE_CONFLICT
+        elif self.service["draft"] and res == MESSAGE_SAME:
+            local_is_draft, remote_is_draft = self.service["draft"]
+            if remote_is_draft and not local_is_draft:
+                version = ".".join(local.options["version"].value.split(".")[0:2])
+                self.info(local, "PROT011",
+                          {
+                             "name": local.name,
+                             "version": version,
+                          })
+                res = MESSAGE_EXTENDED
         fail = False
         if res == MESSAGE_SAME:
             pass
             self.info(local, "PROT006", dict(major=major, minor=minor, name=name))
 
     def onServiceDraftState(self, local, remote, version, local_is_draft, remote_is_draft):
-        if self.service["result"] == MESSAGE_EXTENDED:
-            self.service["draft"] = (local_is_draft, remote_is_draft)
+        self.service["draft"] = (local_is_draft, remote_is_draft)
 
     def onIdConflict(self, local, remote, version, local_cmd, remote_id):
         self.error(local, "PROT005",