diff tests/test-mq-safety @ 12378:ab237534d800 stable

mq: always require --force when pushing patches (issue2363) --force was not necessary when passing --rev since 55578a8d7e84, but this behaviour is usually harmful when branch names are passed instead of explicit revisions.
author Patrick Mezard <pmezard@gmail.com>
date Wed, 22 Sep 2010 23:51:10 +0200
parents 2e3ec7ef5349
children
line wrap: on
line diff
--- a/tests/test-mq-safety	Tue Sep 21 23:14:58 2010 +0200
+++ b/tests/test-mq-safety	Wed Sep 22 23:51:10 2010 +0200
@@ -62,3 +62,29 @@
 hg up default
 hg log
 hg qpush
+cd ..
+
+echo '% testing applied patches, push and --force'
+hg init forcepush
+cd forcepush
+echo a > a
+hg ci -Am adda
+echo a >> a
+hg ci -m changea
+hg up 0
+hg branch branch
+echo b > b
+hg ci -Am addb
+hg up 0
+hg --cwd .. clone -r 0 forcepush forcepush2
+echo a >> a
+hg qnew patch
+echo '% pushing applied patch with --rev without --force'
+hg push -r default ../forcepush2
+echo '% pushing applied patch with branchhash, without --force'
+hg push ../forcepush2#default
+echo '% pushing revs excluding applied patch'
+hg push --new-branch -r branch -r 2 ../forcepush2
+echo '% pushing applied patch with --force'
+hg push --force -r default ../forcepush2
+cd ..