comparison tests/test-mq-git.t @ 12324:b701610f6c56

tests: unify some of test-mq*
author Adrian Buehlmann <adrian@cadifra.com>
date Sun, 19 Sep 2010 23:42:18 +0200
parents tests/test-mq-git@8cb81d75730c
children 9d4ebb75de53
comparison
equal deleted inserted replaced
12318:d643ae555a4d 12324:b701610f6c56
1 # Test the plumbing of mq.git option
2 # Automatic upgrade itself is tested elsewhere.
3
4 $ echo "[extensions]" >> $HGRCPATH
5 $ echo "mq=" >> $HGRCPATH
6 $ echo "[diff]" >> $HGRCPATH
7 $ echo "nodates=1" >> $HGRCPATH
8
9 $ hg init repo-auto
10 $ cd repo-auto
11
12 git=auto: regular patch creation:
13
14 $ echo a > a
15 $ hg add a
16 $ hg qnew -d '0 0' -f adda
17
18 $ cat .hg/patches/adda
19 # HG changeset patch
20 # Parent 0000000000000000000000000000000000000000
21 # Date 0 0
22
23 diff -r 000000000000 -r ef8dafc9fa4c a
24 --- /dev/null
25 +++ b/a
26 @@ -0,0 +1,1 @@
27 +a
28
29 git=auto: git patch creation with copy:
30
31 $ hg cp a b
32 $ hg qnew -d '0 0' -f copy
33
34 $ cat .hg/patches/copy
35 # HG changeset patch
36 # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
37 # Date 0 0
38
39 diff --git a/a b/b
40 copy from a
41 copy to b
42
43 git=auto: git patch when using --git:
44
45 $ echo regular > regular
46 $ hg add regular
47 $ hg qnew -d '0 0' --git -f git
48
49 $ cat .hg/patches/git
50 # HG changeset patch
51 # Parent 99586d5f048c399e20f81cee41fbb3809c0e735d
52 # Date 0 0
53
54 diff --git a/regular b/regular
55 new file mode 100644
56 --- /dev/null
57 +++ b/regular
58 @@ -0,0 +1,1 @@
59 +regular
60
61 git=auto: regular patch after qrefresh without --git:
62
63 $ hg qrefresh -d '0 0'
64
65 $ cat .hg/patches/git
66 # HG changeset patch
67 # Parent 99586d5f048c399e20f81cee41fbb3809c0e735d
68 # Date 0 0
69
70 diff -r 99586d5f048c regular
71 --- /dev/null
72 +++ b/regular
73 @@ -0,0 +1,1 @@
74 +regular
75
76 $ cd ..
77
78 $ hg init repo-keep
79 $ cd repo-keep
80 $ echo '[mq]' > .hg/hgrc
81 $ echo 'git = KEEP' >> .hg/hgrc
82
83 git=keep: git patch with --git:
84
85 $ echo a > a
86 $ hg add a
87 $ hg qnew -d '0 0' -f --git git
88
89 $ cat .hg/patches/git
90 # HG changeset patch
91 # Parent 0000000000000000000000000000000000000000
92 # Date 0 0
93
94 diff --git a/a b/a
95 new file mode 100644
96 --- /dev/null
97 +++ b/a
98 @@ -0,0 +1,1 @@
99 +a
100
101 git=keep: git patch after qrefresh without --git:
102
103 $ echo a >> a
104 $ hg qrefresh -d '0 0'
105
106 $ cat .hg/patches/git
107 # HG changeset patch
108 # Parent 0000000000000000000000000000000000000000
109 # Date 0 0
110
111 diff --git a/a b/a
112 new file mode 100644
113 --- /dev/null
114 +++ b/a
115 @@ -0,0 +1,2 @@
116 +a
117 +a
118 $ cd ..
119
120 $ hg init repo-yes
121 $ cd repo-yes
122 $ echo '[mq]' > .hg/hgrc
123 $ echo 'git = yes' >> .hg/hgrc
124
125 git=yes: git patch:
126
127 $ echo a > a
128 $ hg add a
129 $ hg qnew -d '0 0' -f git
130
131 $ cat .hg/patches/git
132 # HG changeset patch
133 # Parent 0000000000000000000000000000000000000000
134 # Date 0 0
135
136 diff --git a/a b/a
137 new file mode 100644
138 --- /dev/null
139 +++ b/a
140 @@ -0,0 +1,1 @@
141 +a
142
143 git=yes: git patch after qrefresh:
144
145 $ echo a >> a
146 $ hg qrefresh -d '0 0'
147
148 $ cat .hg/patches/git
149 # HG changeset patch
150 # Parent 0000000000000000000000000000000000000000
151 # Date 0 0
152
153 diff --git a/a b/a
154 new file mode 100644
155 --- /dev/null
156 +++ b/a
157 @@ -0,0 +1,2 @@
158 +a
159 +a
160 $ cd ..
161
162 $ hg init repo-no
163 $ cd repo-no
164 $ echo '[diff]' > .hg/hgrc
165 $ echo 'git = True' >> .hg/hgrc
166 $ echo '[mq]' > .hg/hgrc
167 $ echo 'git = False' >> .hg/hgrc
168
169 git=no: regular patch with copy:
170
171 $ echo a > a
172 $ hg add a
173 $ hg qnew -d '0 0' -f adda
174 $ hg cp a b
175 $ hg qnew -d '0 0' -f regular
176
177 $ cat .hg/patches/regular
178 # HG changeset patch
179 # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
180 # Date 0 0
181
182 diff -r ef8dafc9fa4c -r a70404f79ba3 b
183 --- /dev/null
184 +++ b/b
185 @@ -0,0 +1,1 @@
186 +a
187
188 git=no: regular patch after qrefresh with copy:
189
190 $ hg cp a c
191 $ hg qrefresh -d '0 0'
192
193 $ cat .hg/patches/regular
194 # HG changeset patch
195 # Parent ef8dafc9fa4caff80f6e243eb0171bcd60c455b4
196 # Date 0 0
197
198 diff -r ef8dafc9fa4c b
199 --- /dev/null
200 +++ b/b
201 @@ -0,0 +1,1 @@
202 +a
203 diff -r ef8dafc9fa4c c
204 --- /dev/null
205 +++ b/c
206 @@ -0,0 +1,1 @@
207 +a
208
209 $ cd ..
210