diff hgext/convert/monotone.py @ 13779:c13bfa451656

convert/mtn: convert suspended branches as closed branches Monotone treats branch closing ("suspending") in a similar manner to how we do in mercurial - a cert is added to a revision that marks the branch to be hidden. If a subsequent commit is made, the branch is effectively reopened.
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 25 Mar 2011 15:49:43 -0400
parents aeb41f0048e7
children a916e8de4313
line wrap: on
line diff
--- a/hgext/convert/monotone.py	Sun Mar 27 13:34:20 2011 +0200
+++ b/hgext/convert/monotone.py	Fri Mar 25 15:49:43 2011 -0400
@@ -291,14 +291,18 @@
         return data, attr
 
     def getcommit(self, rev):
-        certs   = self.mtngetcerts(rev)
+        extra = {}
+        certs = self.mtngetcerts(rev)
+        if certs.get('suspend') == certs["branch"]:
+            extra['close'] = '1'
         return commit(
             author=certs["author"],
             date=util.datestr(util.strdate(certs["date"], "%Y-%m-%dT%H:%M:%S")),
             desc=certs["changelog"],
             rev=rev,
             parents=self.mtnrun("parents", rev).splitlines(),
-            branch=certs["branch"])
+            branch=certs["branch"],
+            extra=extra)
 
     def gettags(self):
         tags = {}