Add test for issue 529 - "mq aborts when merging patch deleting files".
authorPatrick Mezard <pmezard@gmail.com>
Sat, 07 Apr 2007 19:42:26 +0100
changeset 4333 4f721e96f1de
parent 4332 4e5e1638b165
child 4334 66a3fe30f9fc
child 4336 1cc5fc1d0994
Add test for issue 529 - "mq aborts when merging patch deleting files".
tests/test-mq-merge
tests/test-mq-merge.out
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-merge	Sat Apr 07 19:42:26 2007 +0100
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# Test issue 529 - mq aborts when merging patch deleting files
+
+rewrite_path()
+{
+    sed -e 's:\\:/:g' -e 's:[^ ]*/t/::g'
+}
+
+echo "[extensions]" >> $HGRCPATH
+echo "hgext.mq=" >> $HGRCPATH
+
+# Commit two dummy files in "init" changeset
+hg init t
+cd t
+echo a > a
+echo b > b
+hg ci -Am init
+hg tag -l init
+
+# Create a patch removing a
+hg qnew rm_a
+hg rm a
+hg qrefresh -m "rm a"
+
+# Save the patch queue so we can merge it later
+hg qsave -c -e 2>&1 | rewrite_path
+
+# Update b and commit in an "update" changeset
+hg up -C init
+echo b >> b
+hg st
+hg ci -m update
+
+# Here, qpush used to abort with :
+# The system cannot find the file specified => a
+hg manifest
+hg qpush -a -m 2>&1 | rewrite_path
+hg manifest
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-merge.out	Sat Apr 07 19:42:26 2007 +0100
@@ -0,0 +1,11 @@
+adding a
+adding b
+copy .hg/patches to .hg/patches.1
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+M b
+a
+b
+merging with queue at: .hg/patches.1
+applying rm_a
+Now at: rm_a
+b