Merge with crew
authorMatt Mackall <mpm@selenic.com>
Mon, 24 Mar 2008 11:12:57 -0500
changeset 6378 f0f830114a9b
parent 6375 cdc458b12f0f (current diff)
parent 6377 2cf67d007f41 (diff)
child 6379 d2bb66a8a435
Merge with crew
--- a/hgext/convert/monotone.py	Mon Mar 24 10:01:05 2008 -0500
+++ b/hgext/convert/monotone.py	Mon Mar 24 11:12:57 2008 -0500
@@ -26,6 +26,7 @@
         self.add_file_re = re.compile(space + "add_file" + name + "content" + revision)
         self.patch_re    = re.compile(space + "patch" + name + "from" + revision + "to" + revision)
         self.rename_re   = re.compile(space + "rename" + name + "to" + name)
+        self.delete_re   = re.compile(space + "delete" + name)
         self.tag_re      = re.compile(space + "tag" + name + "revision" + revision)
         self.cert_re     = re.compile(lines + space + "name" + name + "value" + value)
 
@@ -137,6 +138,9 @@
             # Delete/rename is handled later when the convert engine
             # discovers an IOError exception from getfile,
             # but only if we add the "from" file to the list of changes.
+            m = self.delete_re.match(e)
+            if m:
+                files[m.group(1)] = rev
             m = self.rename_re.match(e)
             if m:
                 toname = m.group(2)
--- a/tests/test-convert-mtn	Mon Mar 24 10:01:05 2008 -0500
+++ b/tests/test-convert-mtn	Mon Mar 24 11:12:57 2008 -0500
@@ -55,6 +55,9 @@
 mtn drop dir/b
 mtn mv bin bin2
 mtn ci -m update2
+# Test directory move
+mtn mv dir dir2
+mtn ci -m movedir
 cd ..
 
 echo % convert incrementally
@@ -69,8 +72,7 @@
 hg up -C
 glog
 echo % manifest
-# BUG: c and dir/b should not appear here
 hg manifest
 echo % contents
-cat dir/a
+cat dir2/a
 
--- a/tests/test-convert-mtn.out	Mon Mar 24 10:01:05 2008 -0500
+++ b/tests/test-convert-mtn.out	Mon Mar 24 11:12:57 2008 -0500
@@ -26,24 +26,28 @@
 mtn: renaming bin to bin2 in workspace manifest
 mtn: beginning commit on branch 'com.selenic.test'
 mtn: committed revision 6c6977a6ef609ec80e40779f89dbd2772c96de62
+mtn: renaming dir to dir2 in workspace manifest
+mtn: beginning commit on branch 'com.selenic.test'
+mtn: committed revision 5de5abe7c15eae70cf3acdda23c9c319ea50c1af
 % convert incrementally
 assuming destination repo.mtn-hg
 scanning source...
 sorting...
 converting...
-0 update2
-5 files updated, 0 files merged, 0 files removed, 0 files unresolved
-@  2 "update2" files: bin bin2 e
+1 update2
+0 movedir
+3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+@  3 "movedir" files: dir/a dir2/a
 |
-o  1 "update1" files: a bin dir/a dir/b
+o  2 "update2" files: bin bin2 dir/b e
+|
+o  1 "update1" files: a bin c dir/a dir/b
 |
 o  0 "initialize" files: a bin c dir/b
 
 % manifest
 bin2
-c
-dir/a
-dir/b
+dir2/a
 e
 % contents
 a