Mercurial > hg
annotate tests/test-mq @ 2906:453097750fbf
extdiff: fix bugs. add test.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Mon, 14 Aug 2006 15:51:35 -0700 |
parents | 307439d6fede |
children | 2f190e998eb3 |
rev | line source |
---|---|
2729 | 1 #!/bin/sh |
2 | |
3 HGRCPATH=$HGTMP/.hgrc; export HGRCPATH | |
4 echo "[extensions]" >> $HGTMP/.hgrc | |
5 echo "mq=" >> $HGTMP/.hgrc | |
6 | |
7 echo % help | |
8 hg help mq | |
9 | |
10 hg init a | |
11 cd a | |
12 echo a > a | |
2848
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
13 hg ci -Ama |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
14 |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
15 hg clone . ../k |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
16 |
2729 | 17 mkdir b |
18 echo z > b/z | |
19 hg ci -Ama | |
20 | |
21 echo % qinit | |
22 | |
23 hg qinit | |
24 | |
25 cd .. | |
26 hg init b | |
27 | |
28 echo % -R qinit | |
29 | |
30 hg -R b qinit | |
31 | |
32 hg init c | |
33 | |
34 echo % qinit -c | |
35 | |
36 hg --cwd c qinit -c | |
37 hg -R c/.hg/patches st | |
38 | |
39 echo % qnew implies add | |
40 | |
41 hg -R c qnew test.patch | |
42 hg -R c/.hg/patches st | |
43 | |
44 cd a | |
45 | |
46 echo % qnew -m | |
47 | |
48 hg qnew -m 'foo bar' test.patch | |
49 cat .hg/patches/test.patch | |
50 | |
51 echo % qrefresh | |
52 | |
53 echo a >> a | |
54 hg qrefresh | |
2843
0b9ac7dfcf56
Fix some tests for portability.
Danek Duvall <danek.duvall@sun.com>
parents:
2729
diff
changeset
|
55 sed -e "s/^\(diff -r \)\([a-f0-9]* \)/\1 x/" \ |
2729 | 56 -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ |
57 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/test.patch | |
58 | |
59 echo % qpop | |
60 | |
61 hg qpop | |
62 | |
63 echo % qpush | |
64 | |
65 hg qpush | |
66 | |
67 cd .. | |
68 | |
69 echo % pop/push outside repo | |
70 | |
71 hg -R a qpop | |
72 hg -R a qpush | |
73 | |
74 cd a | |
75 hg qnew test2.patch | |
76 | |
77 echo % qrefresh in subdir | |
78 | |
79 cd b | |
80 echo a > a | |
81 hg add a | |
82 hg qrefresh | |
83 | |
84 echo % pop/push -a in subdir | |
85 | |
86 hg qpop -a | |
87 hg --traceback qpush -a | |
88 | |
89 echo % qseries | |
90 hg qseries | |
91 | |
92 echo % qapplied | |
93 hg qapplied | |
94 | |
95 echo % qtop | |
96 hg qtop | |
97 | |
98 echo % qprev | |
99 hg qprev | |
100 | |
101 echo % qnext | |
102 hg qnext | |
103 | |
104 echo % pop, qnext, qprev, qapplied | |
105 hg qpop | |
106 hg qnext | |
107 hg qprev | |
108 hg qapplied | |
109 | |
2846
b8d587cfa3bb
mq: test commit in repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2843
diff
changeset
|
110 echo % commit should fail |
b8d587cfa3bb
mq: test commit in repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2843
diff
changeset
|
111 hg commit |
b8d587cfa3bb
mq: test commit in repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2843
diff
changeset
|
112 |
2848
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
113 echo % push should fail |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
114 hg push ../../k |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
115 |
2729 | 116 echo % qunapplied |
117 hg qunapplied | |
118 | |
2848
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
119 echo % push should succeed |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
120 hg qpop -a |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
121 hg push ../../k |
307439d6fede
mq: do not allow to push from repo with patches applied
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2846
diff
changeset
|
122 |
2729 | 123 echo % strip |
124 cd ../../b | |
125 echo x>x | |
126 hg ci -Ama | |
127 hg strip tip 2>&1 | sed 's/\(saving bundle to \).*/\1/' | |
128 hg unbundle .hg/strip-backup/* |