diff tests/test-rebase-mq @ 7955:c3d4ff03ec72

rebase: keep original mq patch format (Issue1574) Rebase now doesn't make assumptions about which format has been used for a mq patch (git or normal). Before finalizing a patch it keeps track of the original format, by reading its header, and then restores the format when reimporting it. This way it also allows for having mixed styles. Note: this version corrects a failure in the test
author Stefano Tortarolo <stefano.tortarolo@gmail.com>
date Thu, 26 Mar 2009 16:58:50 +0200
parents 02f4a0bcfdce
children 8766fee6f225
line wrap: on
line diff
--- a/tests/test-rebase-mq	Mon Mar 30 18:26:32 2009 +0200
+++ b/tests/test-rebase-mq	Thu Mar 26 16:58:50 2009 +0200
@@ -11,6 +11,7 @@
         -e "s/^\(# Node ID\).*/\1/" \
         -e "s/^\(# Parent\).*/\1/" \
         -e "s/^\(diff -r \)\([a-f0-9]* \)\(-r \)\([a-f0-9]* \)/\1x \3y /" \
+        -e "s/^\(diff -r \)\([a-f0-9]* \)/\1x /" \
         -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" \
         -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/"
 }
@@ -74,3 +75,38 @@
 echo '% And the patch is correct'
 cat .hg/patches/f2.patch | filterpatch
 
+echo
+echo '% Adding one git-style patch and one normal'
+hg qpop -a
+rm -fr .hg/patches
+hg qinit -c
+
+hg up 0
+hg qnew --git f_git.patch
+echo 'mq1' > p
+hg add p
+hg qref --git -m 'P0 (git)'
+
+hg qnew f.patch
+echo 'mq2' > p
+hg qref -m 'P1'
+
+echo '% Git patch'
+cat .hg/patches/f_git.patch  | filterpatch
+
+echo
+echo '% Normal patch'
+cat .hg/patches/f.patch | filterpatch
+
+echo
+echo '% Rebase the applied mq patches'
+hg rebase -s 2 -d 1 --quiet 2>&1 | sed -e 's/\(saving bundle to \).*/\1/'
+
+echo '% And the patches are correct'
+echo '% Git patch'
+cat .hg/patches/f_git.patch  | filterpatch
+
+echo
+echo '% Normal patch'
+cat .hg/patches/f.patch | filterpatch
+