##// END OF EJS Templates
tests: unify test-mq-qpush-fail
Matt Mackall -
r12467:05e1171c default
parent child Browse files
Show More
@@ -1,62 +1,90 b''
1 #!/bin/sh
1 Test that qpush cleans things up if it doesn't complete
2
3 # Test that qpush cleans things up if it doesn't complete
4
5 echo "[extensions]" >> $HGRCPATH
6 echo "mq=" >> $HGRCPATH
7
8 hg init repo
9 cd repo
10
11 echo foo > foo
12 hg ci -Am 'add foo'
13
2
14 touch untracked-file
3 $ echo "[extensions]" >> $HGRCPATH
15 echo 'syntax: glob' > .hgignore
4 $ echo "mq=" >> $HGRCPATH
16 echo '.hgignore' >> .hgignore
5 $ hg init repo
17
6 $ cd repo
18 hg qinit
7 $ echo foo > foo
19
8 $ hg ci -Am 'add foo'
20 echo '% test qpush on empty series'
9 adding foo
21 hg qpush
10 $ touch untracked-file
11 $ echo 'syntax: glob' > .hgignore
12 $ echo '.hgignore' >> .hgignore
13 $ hg qinit
22
14
23 hg qnew patch1
15 test qpush on empty series
24 echo >> foo
25 hg qrefresh -m 'patch 1'
26
27 hg qnew patch2
28 echo bar > bar
29 hg add bar
30 hg qrefresh -m 'patch 2'
31
16
32 hg qnew --config 'mq.plain=true' bad-patch
17 $ hg qpush
33 echo >> foo
18 no patches in series
34 hg qrefresh
19 $ hg qnew patch1
35
20 $ echo >> foo
36 hg qpop -a
21 $ hg qrefresh -m 'patch 1'
37
22 $ hg qnew patch2
38 python -c 'print "\xe9"' > message
23 $ echo bar > bar
39 cat .hg/patches/bad-patch >> message
24 $ hg add bar
40 mv message .hg/patches/bad-patch
25 $ hg qrefresh -m 'patch 2'
41
26 $ hg qnew --config 'mq.plain=true' bad-patch
42 hg qpush -a && echo 'qpush succeded?!'
27 $ echo >> foo
43
28 $ hg qrefresh
44 hg parents
29 $ hg qpop -a
30 popping bad-patch
31 popping patch2
32 popping patch1
33 patch queue now empty
34 $ python -c 'print "\xe9"' > message
35 $ cat .hg/patches/bad-patch >> message
36 $ mv message .hg/patches/bad-patch
37 $ hg qpush -a && echo 'qpush succeded?!'
38 applying patch1
39 applying patch2
40 applying bad-patch
41 transaction abort!
42 rollback completed
43 cleaning up working directory...done
44 abort: decoding near '': 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)!
45 [255]
46 $ hg parents
47 changeset: 0:bbd179dfa0a7
48 tag: tip
49 user: test
50 date: Thu Jan 01 00:00:00 1970 +0000
51 summary: add foo
52
45
53
46 echo '% bar should be gone; other unknown/ignored files should still be around'
54 bar should be gone; other unknown/ignored files should still be around
47 hg status -A
55
56 $ hg status -A
57 ? untracked-file
58 I .hgignore
59 C foo
60
61 preparing qpush of a missing patch
62
63 $ hg qpop -a
64 no patches applied
65 $ hg qpush
66 applying patch1
67 now at: patch1
68 $ rm .hg/patches/patch2
69
70 now we expect the push to fail, but it should NOT complain about patch1
48
71
49 echo '% preparing qpush of a missing patch'
72 $ hg qpush
50 hg qpop -a
73 applying patch2
51 hg qpush
74 unable to read patch2
52 rm .hg/patches/patch2
75 now at: patch1
53 echo '% now we expect the push to fail, but it should NOT complain about patch1'
76 [1]
54 hg qpush
77
78 preparing qpush of missing patch with no patch applied
55
79
56 echo '% preparing qpush of missing patch with no patch applied'
80 $ hg qpop -a
57 hg qpop -a
81 popping patch1
58 rm .hg/patches/patch1
82 patch queue now empty
59 echo '% qpush should fail the same way as below'
83 $ rm .hg/patches/patch1
60 hg qpush
61
84
62 true # happy ending
85 qpush should fail the same way as below
86
87 $ hg qpush
88 applying patch1
89 unable to read patch1
90 [1]
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now