# HG changeset patch # User Patrick Mezard # Date 2008-03-24 16:02:08 # Node ID b40e90341ae24e4f72869ce40b6e98bcf0b2c0a5 # Parent 31a01e3d99ccbbd2e74f2c3c43001ace8af636ea convert: record deleted files in monotone source diff --git a/hgext/convert/monotone.py b/hgext/convert/monotone.py --- a/hgext/convert/monotone.py +++ b/hgext/convert/monotone.py @@ -26,6 +26,7 @@ class monotone_source(converter_source, 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 @@ class monotone_source(converter_source, # 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) diff --git a/tests/test-convert-mtn b/tests/test-convert-mtn --- a/tests/test-convert-mtn +++ b/tests/test-convert-mtn @@ -69,7 +69,6 @@ cd repo.mtn-hg hg up -C glog echo % manifest -# BUG: c and dir/b should not appear here hg manifest echo % contents cat dir/a diff --git a/tests/test-convert-mtn.out b/tests/test-convert-mtn.out --- a/tests/test-convert-mtn.out +++ b/tests/test-convert-mtn.out @@ -32,18 +32,16 @@ scanning source... sorting... converting... 0 update2 -5 files updated, 0 files merged, 0 files removed, 0 files unresolved -@ 2 "update2" files: bin bin2 e +3 files updated, 0 files merged, 0 files removed, 0 files unresolved +@ 2 "update2" files: bin bin2 dir/b e | -o 1 "update1" files: a bin dir/a dir/b +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 e % contents a