Mercurial > hg-stable
changeset 4658:17f5d2069551
mq: test that qpush cleans things up when it fails
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Thu, 21 Jun 2007 00:34:14 -0300 |
parents | 27a386b96557 |
children | 7a7d4937272b |
files | tests/test-mq-qpush-fail tests/test-mq-qpush-fail.out |
diffstat | 2 files changed, 62 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-mq-qpush-fail Thu Jun 21 00:34:14 2007 -0300 @@ -0,0 +1,43 @@ +#!/bin/sh + +# Test that qpush cleans things up if it doesn't complete + +echo "[extensions]" >> $HGRCPATH +echo "mq=" >> $HGRCPATH + +hg init repo +cd repo + +echo foo > foo +hg ci -Am 'add foo' -d '0 0' + +touch untracked-file +echo 'syntax: glob' > .hgignore +echo '.hgignore' >> .hgignore + +hg qinit +hg qnew patch1 +echo >> foo +hg qrefresh -m 'patch 1' + +hg qnew patch2 +echo bar > bar +hg add bar +hg qrefresh -m 'patch 2' + +hg qnew bad-patch +echo >> foo +hg qrefresh + +hg qpop -a + +python -c 'print "\xe9"' > message +cat .hg/patches/bad-patch >> message +mv message .hg/patches/bad-patch + +hg qpush -a && echo 'qpush succeded?!' + +hg parents + +echo '% bar should be gone; other unknown/ignored files should still be around' +hg status -A
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-mq-qpush-fail.out Thu Jun 21 00:34:14 2007 -0300 @@ -0,0 +1,19 @@ +adding foo +Patch queue now empty +applying patch1 +applying patch2 +applying bad-patch +transaction abort! +rollback completed +cleaning up working directory...done +abort: decoding near 'é': 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)! +changeset: 0:bbd179dfa0a7 +tag: tip +user: test +date: Thu Jan 01 00:00:00 1970 +0000 +summary: add foo + +% bar should be gone; other unknown/ignored files should still be around +? untracked-file +I .hgignore +C foo