##// END OF EJS Templates
tests: unify test-mq-safety
Nicolas Dumazet -
r11898:7dc8b9e2 default
parent child Browse files
Show More
@@ -1,64 +1,106 b''
1 #!/bin/sh
1 $ echo '[extensions]' >> $HGRCPATH
2 $ echo 'mq =' >> $HGRCPATH
2 3
3 echo '[extensions]' >> $HGRCPATH
4 echo 'mq =' >> $HGRCPATH
4 $ hg init repo
5 $ cd repo
6
7 $ echo foo > foo
8 $ hg ci -qAm 'add a file'
9
10 $ hg qinit
5 11
6 hg init repo
7 cd repo
12 $ hg qnew foo
13 $ echo foo >> foo
14 $ hg qrefresh -m 'append foo'
8 15
9 echo foo > foo
10 hg ci -qAm 'add a file'
16 $ hg qnew bar
17 $ echo bar >> foo
18 $ hg qrefresh -m 'append bar'
19
11 20
12 hg qinit
21 try to commit on top of a patch
22
23 $ echo quux >> foo
24 $ hg ci -m 'append quux'
25 abort: cannot commit over an applied mq patch
13 26
14 hg qnew foo
15 echo foo >> foo
16 hg qrefresh -m 'append foo'
27
28 cheat a bit...
17 29
18 hg qnew bar
19 echo bar >> foo
20 hg qrefresh -m 'append bar'
30 $ mv .hg/patches .hg/patches2
31 $ hg ci -m 'append quux'
32 $ mv .hg/patches2 .hg/patches
33
34
35 qpop/qrefresh on the wrong revision
21 36
22 echo '% try to commit on top of a patch'
23 echo quux >> foo
24 hg ci -m 'append quux'
37 $ hg qpop
38 abort: popping would remove a revision not managed by this patch queue
39 $ hg qpop -n patches 2>&1 | sed -e 's/\(using patch queue:\).*/\1/'
40 using patch queue:
41 abort: popping would remove a revision not managed by this patch queue
42 $ hg qrefresh
43 abort: working directory revision is not qtip
25 44
26 # cheat a bit...
27 mv .hg/patches .hg/patches2
28 hg ci -m 'append quux'
29 mv .hg/patches2 .hg/patches
45 $ hg up -C qtip
46 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
47 $ hg qpop
48 abort: popping would remove a revision not managed by this patch queue
49 $ hg qrefresh
50 abort: cannot refresh a revision with children
51 $ hg tip --template '{rev} {desc}\n'
52 3 append quux
30 53
31 echo '% qpop/qrefresh on the wrong revision'
32 hg qpop
33 hg qpop -n patches 2>&1 | sed -e 's/\(using patch queue:\).*/\1/'
34 hg qrefresh
35 54
36 hg up -C qtip
37 echo '% qpop'
38 hg qpop
39
40 echo '% qrefresh'
41 hg qrefresh
42
43 echo '% tip:'
44 hg tip --template '{rev} {desc}\n'
55 qpush warning branchheads
45 56
46 echo '% qpush warning branchheads'
47 cd ..
48 hg init branchy
49 cd branchy
50 echo q > q
51 hg add q
52 hg qnew -f qp
53 hg qpop
54 echo a > a
55 hg ci -Ama
56 hg up null
57 hg branch b
58 echo c > c
59 hg ci -Amc
60 hg merge default
61 hg ci -mmerge
62 hg up default
63 hg log
64 hg qpush
57 $ cd ..
58 $ hg init branchy
59 $ cd branchy
60 $ echo q > q
61 $ hg add q
62 $ hg qnew -f qp
63 $ hg qpop
64 popping qp
65 patch queue now empty
66 $ echo a > a
67 $ hg ci -Ama
68 adding a
69 $ hg up null
70 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
71 $ hg branch b
72 marked working directory as branch b
73 $ echo c > c
74 $ hg ci -Amc
75 adding c
76 $ hg merge default
77 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
78 (branch merge, don't forget to commit)
79 $ hg ci -mmerge
80 $ hg up default
81 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
82 $ hg log
83 changeset: 2:65309210bf4e
84 branch: b
85 tag: tip
86 parent: 1:707adb4c8ae1
87 parent: 0:cb9a9f314b8b
88 user: test
89 date: Thu Jan 01 00:00:00 1970 +0000
90 summary: merge
91
92 changeset: 1:707adb4c8ae1
93 branch: b
94 parent: -1:000000000000
95 user: test
96 date: Thu Jan 01 00:00:00 1970 +0000
97 summary: c
98
99 changeset: 0:cb9a9f314b8b
100 user: test
101 date: Thu Jan 01 00:00:00 1970 +0000
102 summary: a
103
104 $ hg qpush
105 applying qp
106 now at: qp
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now