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