Merge with crew-stable
authorPatrick Mezard <pmezard@gmail.com>
Mon, 02 Jun 2008 21:42:16 +0200
changeset 6643 635541b970e5
parent 6642 c8c7248f6172 (current diff)
parent 6633 67a2d2d9bf21 (diff)
child 6644 8c01ce1f2530
Merge with crew-stable
--- a/hgext/convert/monotone.py	Sat May 31 11:37:55 2008 +0200
+++ b/hgext/convert/monotone.py	Mon Jun 02 21:42:16 2008 +0200
@@ -16,7 +16,7 @@
 
         # regular expressions for parsing monotone output
         space    = r'\s*'
-        name     = r'\s+"((?:[^"]|\\")*)"\s*'
+        name     = r'\s+"((?:\\"|[^"])*)"\s*'
         value    = name
         revision = r'\s+\[(\w+)\]\s*'
         lines    = r'(?:.|\n)+'
@@ -98,11 +98,14 @@
     def mtngetcerts(self, rev):
         certs = {"author":"<missing>", "date":"<missing>",
             "changelog":"<missing>", "branch":"<missing>"}
-        cert_list = self.mtnrun("certs", rev).split("\n\n")
+        cert_list = self.mtnrun("certs", rev).split('\n\n      key "')
         for e in cert_list:
             m = self.cert_re.match(e)
             if m:
-                certs[m.group(1)] = m.group(2)
+                name, value = m.groups()
+                value = value.replace(r'\"', '"')
+                value = value.replace(r'\\', '\\')
+                certs[name] = value
         return certs
 
     def mtnrenamefiles(self, files, fromdir, todir):
--- a/tests/test-convert-mtn	Sat May 31 11:37:55 2008 +0200
+++ b/tests/test-convert-mtn	Mon Jun 02 21:42:16 2008 +0200
@@ -54,7 +54,7 @@
 mtn add e
 mtn drop dir/b
 mtn mv bin bin2
-mtn ci -m update2
+mtn ci -m 'update2 "with" quotes'
 # Test directory move
 mtn mv dir dir2
 mtn ci -m movedir
--- a/tests/test-convert-mtn.out	Sat May 31 11:37:55 2008 +0200
+++ b/tests/test-convert-mtn.out	Mon Jun 02 21:42:16 2008 +0200
@@ -46,7 +46,7 @@
 scanning source...
 sorting...
 converting...
-3 update2
+3 update2 "with" quotes
 2 movedir
 1 emptydir
 0 dropdirectory
@@ -57,7 +57,7 @@
 |
 o  3 "movedir" files: dir/a dir2/a
 |
-o  2 "update2" files: bin bin2 dir/b e
+o  2 "update2 "with" quotes" files: bin bin2 dir/b e
 |
 o  1 "update1" files: a bin c dir/a dir/b
 |