convert/mtn: handle change in mtn 0.45 certs output
authorPatrick Mezard <pmezard@gmail.com>
Tue, 10 Nov 2009 23:45:24 +0100
changeset 9823 11d7bb5e0df2
parent 9822 8b3e0435e690
child 9824 87c92b260710
convert/mtn: handle change in mtn 0.45 certs output
hgext/convert/monotone.py
--- a/hgext/convert/monotone.py	Tue Nov 10 22:42:13 2009 +0100
+++ b/hgext/convert/monotone.py	Tue Nov 10 23:45:24 2009 +0100
@@ -102,8 +102,13 @@
     def mtngetcerts(self, rev):
         certs = {"author":"<missing>", "date":"<missing>",
             "changelog":"<missing>", "branch":"<missing>"}
-        cert_list = self.mtnrun("certs", rev).split('\n\n      key "')
-        for e in cert_list:
+        certlist = self.mtnrun("certs", rev)
+        # mtn < 0.45:
+        #   key "test@selenic.com"
+        # mtn >= 0.45:
+        #   key [ff58a7ffb771907c4ff68995eada1c4da068d328]
+        certlist = re.split('\n\n      key ["\[]', certlist)
+        for e in certlist:
             m = self.cert_re.match(e)
             if m:
                 name, value = m.groups()