Show More
@@ -1,589 +1,601 | |||||
1 | $ HGMERGE=true; export HGMERGE |
|
1 | $ HGMERGE=true; export HGMERGE | |
2 |
|
2 | |||
3 | init |
|
3 | init | |
4 |
|
4 | |||
5 | $ hg init repo |
|
5 | $ hg init repo | |
6 | $ cd repo |
|
6 | $ cd repo | |
7 |
|
7 | |||
8 | commit |
|
8 | commit | |
9 |
|
9 | |||
10 | $ echo 'a' > a |
|
10 | $ echo 'a' > a | |
11 | $ hg ci -A -m test -u nobody -d '1 0' |
|
11 | $ hg ci -A -m test -u nobody -d '1 0' | |
12 | adding a |
|
12 | adding a | |
13 |
|
13 | |||
14 | annotate -c |
|
14 | annotate -c | |
15 |
|
15 | |||
16 | $ hg annotate -c a |
|
16 | $ hg annotate -c a | |
17 | 8435f90966e4: a |
|
17 | 8435f90966e4: a | |
18 |
|
18 | |||
19 | annotate -cl |
|
19 | annotate -cl | |
20 |
|
20 | |||
21 | $ hg annotate -cl a |
|
21 | $ hg annotate -cl a | |
22 | 8435f90966e4:1: a |
|
22 | 8435f90966e4:1: a | |
23 |
|
23 | |||
24 | annotate -d |
|
24 | annotate -d | |
25 |
|
25 | |||
26 | $ hg annotate -d a |
|
26 | $ hg annotate -d a | |
27 | Thu Jan 01 00:00:01 1970 +0000: a |
|
27 | Thu Jan 01 00:00:01 1970 +0000: a | |
28 |
|
28 | |||
29 | annotate -n |
|
29 | annotate -n | |
30 |
|
30 | |||
31 | $ hg annotate -n a |
|
31 | $ hg annotate -n a | |
32 | 0: a |
|
32 | 0: a | |
33 |
|
33 | |||
34 | annotate -nl |
|
34 | annotate -nl | |
35 |
|
35 | |||
36 | $ hg annotate -nl a |
|
36 | $ hg annotate -nl a | |
37 | 0:1: a |
|
37 | 0:1: a | |
38 |
|
38 | |||
39 | annotate -u |
|
39 | annotate -u | |
40 |
|
40 | |||
41 | $ hg annotate -u a |
|
41 | $ hg annotate -u a | |
42 | nobody: a |
|
42 | nobody: a | |
43 |
|
43 | |||
44 | annotate -cdnu |
|
44 | annotate -cdnu | |
45 |
|
45 | |||
46 | $ hg annotate -cdnu a |
|
46 | $ hg annotate -cdnu a | |
47 | nobody 0 8435f90966e4 Thu Jan 01 00:00:01 1970 +0000: a |
|
47 | nobody 0 8435f90966e4 Thu Jan 01 00:00:01 1970 +0000: a | |
48 |
|
48 | |||
49 | annotate -cdnul |
|
49 | annotate -cdnul | |
50 |
|
50 | |||
51 | $ hg annotate -cdnul a |
|
51 | $ hg annotate -cdnul a | |
52 | nobody 0 8435f90966e4 Thu Jan 01 00:00:01 1970 +0000:1: a |
|
52 | nobody 0 8435f90966e4 Thu Jan 01 00:00:01 1970 +0000:1: a | |
53 |
|
53 | |||
54 | annotate (JSON) |
|
54 | annotate (JSON) | |
55 |
|
55 | |||
56 | $ hg annotate -Tjson a |
|
56 | $ hg annotate -Tjson a | |
57 | [ |
|
57 | [ | |
58 | { |
|
58 | { | |
59 | "line": "a\n", |
|
59 | "line": "a\n", | |
60 | "rev": 0 |
|
60 | "rev": 0 | |
61 | } |
|
61 | } | |
62 | ] |
|
62 | ] | |
63 |
|
63 | |||
64 | $ hg annotate -Tjson -cdfnul a |
|
64 | $ hg annotate -Tjson -cdfnul a | |
65 | [ |
|
65 | [ | |
66 | { |
|
66 | { | |
67 | "date": [1.0, 0], |
|
67 | "date": [1.0, 0], | |
68 | "file": "a", |
|
68 | "file": "a", | |
69 | "line": "a\n", |
|
69 | "line": "a\n", | |
70 | "line_number": 1, |
|
70 | "line_number": 1, | |
71 | "node": "8435f90966e442695d2ded29fdade2bac5ad8065", |
|
71 | "node": "8435f90966e442695d2ded29fdade2bac5ad8065", | |
72 | "rev": 0, |
|
72 | "rev": 0, | |
73 | "user": "nobody" |
|
73 | "user": "nobody" | |
74 | } |
|
74 | } | |
75 | ] |
|
75 | ] | |
76 |
|
76 | |||
77 | $ cat <<EOF >>a |
|
77 | $ cat <<EOF >>a | |
78 | > a |
|
78 | > a | |
79 | > a |
|
79 | > a | |
80 | > EOF |
|
80 | > EOF | |
81 | $ hg ci -ma1 -d '1 0' |
|
81 | $ hg ci -ma1 -d '1 0' | |
82 | $ hg cp a b |
|
82 | $ hg cp a b | |
83 | $ hg ci -mb -d '1 0' |
|
83 | $ hg ci -mb -d '1 0' | |
84 | $ cat <<EOF >> b |
|
84 | $ cat <<EOF >> b | |
85 | > b4 |
|
85 | > b4 | |
86 | > b5 |
|
86 | > b5 | |
87 | > b6 |
|
87 | > b6 | |
88 | > EOF |
|
88 | > EOF | |
89 | $ hg ci -mb2 -d '2 0' |
|
89 | $ hg ci -mb2 -d '2 0' | |
90 |
|
90 | |||
91 | annotate -n b |
|
91 | annotate -n b | |
92 |
|
92 | |||
93 | $ hg annotate -n b |
|
93 | $ hg annotate -n b | |
94 | 0: a |
|
94 | 0: a | |
95 | 1: a |
|
95 | 1: a | |
96 | 1: a |
|
96 | 1: a | |
97 | 3: b4 |
|
97 | 3: b4 | |
98 | 3: b5 |
|
98 | 3: b5 | |
99 | 3: b6 |
|
99 | 3: b6 | |
100 |
|
100 | |||
101 | annotate --no-follow b |
|
101 | annotate --no-follow b | |
102 |
|
102 | |||
103 | $ hg annotate --no-follow b |
|
103 | $ hg annotate --no-follow b | |
104 | 2: a |
|
104 | 2: a | |
105 | 2: a |
|
105 | 2: a | |
106 | 2: a |
|
106 | 2: a | |
107 | 3: b4 |
|
107 | 3: b4 | |
108 | 3: b5 |
|
108 | 3: b5 | |
109 | 3: b6 |
|
109 | 3: b6 | |
110 |
|
110 | |||
111 | annotate -nl b |
|
111 | annotate -nl b | |
112 |
|
112 | |||
113 | $ hg annotate -nl b |
|
113 | $ hg annotate -nl b | |
114 | 0:1: a |
|
114 | 0:1: a | |
115 | 1:2: a |
|
115 | 1:2: a | |
116 | 1:3: a |
|
116 | 1:3: a | |
117 | 3:4: b4 |
|
117 | 3:4: b4 | |
118 | 3:5: b5 |
|
118 | 3:5: b5 | |
119 | 3:6: b6 |
|
119 | 3:6: b6 | |
120 |
|
120 | |||
121 | annotate -nf b |
|
121 | annotate -nf b | |
122 |
|
122 | |||
123 | $ hg annotate -nf b |
|
123 | $ hg annotate -nf b | |
124 | 0 a: a |
|
124 | 0 a: a | |
125 | 1 a: a |
|
125 | 1 a: a | |
126 | 1 a: a |
|
126 | 1 a: a | |
127 | 3 b: b4 |
|
127 | 3 b: b4 | |
128 | 3 b: b5 |
|
128 | 3 b: b5 | |
129 | 3 b: b6 |
|
129 | 3 b: b6 | |
130 |
|
130 | |||
131 | annotate -nlf b |
|
131 | annotate -nlf b | |
132 |
|
132 | |||
133 | $ hg annotate -nlf b |
|
133 | $ hg annotate -nlf b | |
134 | 0 a:1: a |
|
134 | 0 a:1: a | |
135 | 1 a:2: a |
|
135 | 1 a:2: a | |
136 | 1 a:3: a |
|
136 | 1 a:3: a | |
137 | 3 b:4: b4 |
|
137 | 3 b:4: b4 | |
138 | 3 b:5: b5 |
|
138 | 3 b:5: b5 | |
139 | 3 b:6: b6 |
|
139 | 3 b:6: b6 | |
140 |
|
140 | |||
141 | $ hg up -C 2 |
|
141 | $ hg up -C 2 | |
142 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
142 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
143 | $ cat <<EOF >> b |
|
143 | $ cat <<EOF >> b | |
144 | > b4 |
|
144 | > b4 | |
145 | > c |
|
145 | > c | |
146 | > b5 |
|
146 | > b5 | |
147 | > EOF |
|
147 | > EOF | |
148 | $ hg ci -mb2.1 -d '2 0' |
|
148 | $ hg ci -mb2.1 -d '2 0' | |
149 | created new head |
|
149 | created new head | |
150 | $ hg merge |
|
150 | $ hg merge | |
151 | merging b |
|
151 | merging b | |
152 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
152 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
153 | (branch merge, don't forget to commit) |
|
153 | (branch merge, don't forget to commit) | |
154 | $ hg ci -mmergeb -d '3 0' |
|
154 | $ hg ci -mmergeb -d '3 0' | |
155 |
|
155 | |||
156 | annotate after merge |
|
156 | annotate after merge | |
157 |
|
157 | |||
158 | $ hg annotate -nf b |
|
158 | $ hg annotate -nf b | |
159 | 0 a: a |
|
159 | 0 a: a | |
160 | 1 a: a |
|
160 | 1 a: a | |
161 | 1 a: a |
|
161 | 1 a: a | |
162 | 3 b: b4 |
|
162 | 3 b: b4 | |
163 | 4 b: c |
|
163 | 4 b: c | |
164 | 3 b: b5 |
|
164 | 3 b: b5 | |
165 |
|
165 | |||
166 | annotate after merge with -l |
|
166 | annotate after merge with -l | |
167 |
|
167 | |||
168 | $ hg annotate -nlf b |
|
168 | $ hg annotate -nlf b | |
169 | 0 a:1: a |
|
169 | 0 a:1: a | |
170 | 1 a:2: a |
|
170 | 1 a:2: a | |
171 | 1 a:3: a |
|
171 | 1 a:3: a | |
172 | 3 b:4: b4 |
|
172 | 3 b:4: b4 | |
173 | 4 b:5: c |
|
173 | 4 b:5: c | |
174 | 3 b:5: b5 |
|
174 | 3 b:5: b5 | |
175 |
|
175 | |||
176 | $ hg up -C 1 |
|
176 | $ hg up -C 1 | |
177 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
177 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
178 | $ hg cp a b |
|
178 | $ hg cp a b | |
179 | $ cat <<EOF > b |
|
179 | $ cat <<EOF > b | |
180 | > a |
|
180 | > a | |
181 | > z |
|
181 | > z | |
182 | > a |
|
182 | > a | |
183 | > EOF |
|
183 | > EOF | |
184 | $ hg ci -mc -d '3 0' |
|
184 | $ hg ci -mc -d '3 0' | |
185 | created new head |
|
185 | created new head | |
186 | $ hg merge |
|
186 | $ hg merge | |
187 | merging b |
|
187 | merging b | |
188 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
188 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
189 | (branch merge, don't forget to commit) |
|
189 | (branch merge, don't forget to commit) | |
190 | $ cat <<EOF >> b |
|
190 | $ cat <<EOF >> b | |
191 | > b4 |
|
191 | > b4 | |
192 | > c |
|
192 | > c | |
193 | > b5 |
|
193 | > b5 | |
194 | > EOF |
|
194 | > EOF | |
195 | $ echo d >> b |
|
195 | $ echo d >> b | |
196 | $ hg ci -mmerge2 -d '4 0' |
|
196 | $ hg ci -mmerge2 -d '4 0' | |
197 |
|
197 | |||
198 | annotate after rename merge |
|
198 | annotate after rename merge | |
199 |
|
199 | |||
200 | $ hg annotate -nf b |
|
200 | $ hg annotate -nf b | |
201 | 0 a: a |
|
201 | 0 a: a | |
202 | 6 b: z |
|
202 | 6 b: z | |
203 | 1 a: a |
|
203 | 1 a: a | |
204 | 3 b: b4 |
|
204 | 3 b: b4 | |
205 | 4 b: c |
|
205 | 4 b: c | |
206 | 3 b: b5 |
|
206 | 3 b: b5 | |
207 | 7 b: d |
|
207 | 7 b: d | |
208 |
|
208 | |||
209 | annotate after rename merge with -l |
|
209 | annotate after rename merge with -l | |
210 |
|
210 | |||
211 | $ hg annotate -nlf b |
|
211 | $ hg annotate -nlf b | |
212 | 0 a:1: a |
|
212 | 0 a:1: a | |
213 | 6 b:2: z |
|
213 | 6 b:2: z | |
214 | 1 a:3: a |
|
214 | 1 a:3: a | |
215 | 3 b:4: b4 |
|
215 | 3 b:4: b4 | |
216 | 4 b:5: c |
|
216 | 4 b:5: c | |
217 | 3 b:5: b5 |
|
217 | 3 b:5: b5 | |
218 | 7 b:7: d |
|
218 | 7 b:7: d | |
219 |
|
219 | |||
220 | Issue2807: alignment of line numbers with -l |
|
220 | Issue2807: alignment of line numbers with -l | |
221 |
|
221 | |||
222 | $ echo more >> b |
|
222 | $ echo more >> b | |
223 | $ hg ci -mmore -d '5 0' |
|
223 | $ hg ci -mmore -d '5 0' | |
224 | $ echo more >> b |
|
224 | $ echo more >> b | |
225 | $ hg ci -mmore -d '6 0' |
|
225 | $ hg ci -mmore -d '6 0' | |
226 | $ echo more >> b |
|
226 | $ echo more >> b | |
227 | $ hg ci -mmore -d '7 0' |
|
227 | $ hg ci -mmore -d '7 0' | |
228 | $ hg annotate -nlf b |
|
228 | $ hg annotate -nlf b | |
229 | 0 a: 1: a |
|
229 | 0 a: 1: a | |
230 | 6 b: 2: z |
|
230 | 6 b: 2: z | |
231 | 1 a: 3: a |
|
231 | 1 a: 3: a | |
232 | 3 b: 4: b4 |
|
232 | 3 b: 4: b4 | |
233 | 4 b: 5: c |
|
233 | 4 b: 5: c | |
234 | 3 b: 5: b5 |
|
234 | 3 b: 5: b5 | |
235 | 7 b: 7: d |
|
235 | 7 b: 7: d | |
236 | 8 b: 8: more |
|
236 | 8 b: 8: more | |
237 | 9 b: 9: more |
|
237 | 9 b: 9: more | |
238 | 10 b:10: more |
|
238 | 10 b:10: more | |
239 |
|
239 | |||
240 | linkrev vs rev |
|
240 | linkrev vs rev | |
241 |
|
241 | |||
242 | $ hg annotate -r tip -n a |
|
242 | $ hg annotate -r tip -n a | |
243 | 0: a |
|
243 | 0: a | |
244 | 1: a |
|
244 | 1: a | |
245 | 1: a |
|
245 | 1: a | |
246 |
|
246 | |||
247 | linkrev vs rev with -l |
|
247 | linkrev vs rev with -l | |
248 |
|
248 | |||
249 | $ hg annotate -r tip -nl a |
|
249 | $ hg annotate -r tip -nl a | |
250 | 0:1: a |
|
250 | 0:1: a | |
251 | 1:2: a |
|
251 | 1:2: a | |
252 | 1:3: a |
|
252 | 1:3: a | |
253 |
|
253 | |||
254 | Issue589: "undelete" sequence leads to crash |
|
254 | Issue589: "undelete" sequence leads to crash | |
255 |
|
255 | |||
256 | annotate was crashing when trying to --follow something |
|
256 | annotate was crashing when trying to --follow something | |
257 |
|
257 | |||
258 | like A -> B -> A |
|
258 | like A -> B -> A | |
259 |
|
259 | |||
260 | generate ABA rename configuration |
|
260 | generate ABA rename configuration | |
261 |
|
261 | |||
262 | $ echo foo > foo |
|
262 | $ echo foo > foo | |
263 | $ hg add foo |
|
263 | $ hg add foo | |
264 | $ hg ci -m addfoo |
|
264 | $ hg ci -m addfoo | |
265 | $ hg rename foo bar |
|
265 | $ hg rename foo bar | |
266 | $ hg ci -m renamefoo |
|
266 | $ hg ci -m renamefoo | |
267 | $ hg rename bar foo |
|
267 | $ hg rename bar foo | |
268 | $ hg ci -m renamebar |
|
268 | $ hg ci -m renamebar | |
269 |
|
269 | |||
270 | annotate after ABA with follow |
|
270 | annotate after ABA with follow | |
271 |
|
271 | |||
272 | $ hg annotate --follow foo |
|
272 | $ hg annotate --follow foo | |
273 | foo: foo |
|
273 | foo: foo | |
274 |
|
274 | |||
275 | missing file |
|
275 | missing file | |
276 |
|
276 | |||
277 | $ hg ann nosuchfile |
|
277 | $ hg ann nosuchfile | |
278 | abort: nosuchfile: no such file in rev e9e6b4fa872f |
|
278 | abort: nosuchfile: no such file in rev e9e6b4fa872f | |
279 | [255] |
|
279 | [255] | |
280 |
|
280 | |||
281 | annotate file without '\n' on last line |
|
281 | annotate file without '\n' on last line | |
282 |
|
282 | |||
283 | $ printf "" > c |
|
283 | $ printf "" > c | |
284 | $ hg ci -A -m test -u nobody -d '1 0' |
|
284 | $ hg ci -A -m test -u nobody -d '1 0' | |
285 | adding c |
|
285 | adding c | |
286 | $ hg annotate c |
|
286 | $ hg annotate c | |
287 | $ printf "a\nb" > c |
|
287 | $ printf "a\nb" > c | |
288 | $ hg ci -m test |
|
288 | $ hg ci -m test | |
289 | $ hg annotate c |
|
289 | $ hg annotate c | |
290 | [0-9]+: a (re) |
|
290 | [0-9]+: a (re) | |
291 | [0-9]+: b (re) |
|
291 | [0-9]+: b (re) | |
292 |
|
292 | |||
293 | Issue3841: check annotation of the file of which filelog includes |
|
293 | Issue3841: check annotation of the file of which filelog includes | |
294 | merging between the revision and its ancestor |
|
294 | merging between the revision and its ancestor | |
295 |
|
295 | |||
296 | to reproduce the situation with recent Mercurial, this script uses (1) |
|
296 | to reproduce the situation with recent Mercurial, this script uses (1) | |
297 | "hg debugsetparents" to merge without ancestor check by "hg merge", |
|
297 | "hg debugsetparents" to merge without ancestor check by "hg merge", | |
298 | and (2) the extension to allow filelog merging between the revision |
|
298 | and (2) the extension to allow filelog merging between the revision | |
299 | and its ancestor by overriding "repo._filecommit". |
|
299 | and its ancestor by overriding "repo._filecommit". | |
300 |
|
300 | |||
301 | $ cat > ../legacyrepo.py <<EOF |
|
301 | $ cat > ../legacyrepo.py <<EOF | |
302 | > from mercurial import node, util |
|
302 | > from mercurial import node, util | |
303 | > def reposetup(ui, repo): |
|
303 | > def reposetup(ui, repo): | |
304 | > class legacyrepo(repo.__class__): |
|
304 | > class legacyrepo(repo.__class__): | |
305 | > def _filecommit(self, fctx, manifest1, manifest2, |
|
305 | > def _filecommit(self, fctx, manifest1, manifest2, | |
306 | > linkrev, tr, changelist): |
|
306 | > linkrev, tr, changelist): | |
307 | > fname = fctx.path() |
|
307 | > fname = fctx.path() | |
308 | > text = fctx.data() |
|
308 | > text = fctx.data() | |
309 | > flog = self.file(fname) |
|
309 | > flog = self.file(fname) | |
310 | > fparent1 = manifest1.get(fname, node.nullid) |
|
310 | > fparent1 = manifest1.get(fname, node.nullid) | |
311 | > fparent2 = manifest2.get(fname, node.nullid) |
|
311 | > fparent2 = manifest2.get(fname, node.nullid) | |
312 | > meta = {} |
|
312 | > meta = {} | |
313 | > copy = fctx.renamed() |
|
313 | > copy = fctx.renamed() | |
314 | > if copy and copy[0] != fname: |
|
314 | > if copy and copy[0] != fname: | |
315 | > raise util.Abort('copying is not supported') |
|
315 | > raise util.Abort('copying is not supported') | |
316 | > if fparent2 != node.nullid: |
|
316 | > if fparent2 != node.nullid: | |
317 | > changelist.append(fname) |
|
317 | > changelist.append(fname) | |
318 | > return flog.add(text, meta, tr, linkrev, |
|
318 | > return flog.add(text, meta, tr, linkrev, | |
319 | > fparent1, fparent2) |
|
319 | > fparent1, fparent2) | |
320 | > raise util.Abort('only merging is supported') |
|
320 | > raise util.Abort('only merging is supported') | |
321 | > repo.__class__ = legacyrepo |
|
321 | > repo.__class__ = legacyrepo | |
322 | > EOF |
|
322 | > EOF | |
323 |
|
323 | |||
324 | $ cat > baz <<EOF |
|
324 | $ cat > baz <<EOF | |
325 | > 1 |
|
325 | > 1 | |
326 | > 2 |
|
326 | > 2 | |
327 | > 3 |
|
327 | > 3 | |
328 | > 4 |
|
328 | > 4 | |
329 | > 5 |
|
329 | > 5 | |
330 | > EOF |
|
330 | > EOF | |
331 | $ hg add baz |
|
331 | $ hg add baz | |
332 | $ hg commit -m "baz:0" |
|
332 | $ hg commit -m "baz:0" | |
333 |
|
333 | |||
334 | $ cat > baz <<EOF |
|
334 | $ cat > baz <<EOF | |
335 | > 1 baz:1 |
|
335 | > 1 baz:1 | |
336 | > 2 |
|
336 | > 2 | |
337 | > 3 |
|
337 | > 3 | |
338 | > 4 |
|
338 | > 4 | |
339 | > 5 |
|
339 | > 5 | |
340 | > EOF |
|
340 | > EOF | |
341 | $ hg commit -m "baz:1" |
|
341 | $ hg commit -m "baz:1" | |
342 |
|
342 | |||
343 | $ cat > baz <<EOF |
|
343 | $ cat > baz <<EOF | |
344 | > 1 baz:1 |
|
344 | > 1 baz:1 | |
345 | > 2 baz:2 |
|
345 | > 2 baz:2 | |
346 | > 3 |
|
346 | > 3 | |
347 | > 4 |
|
347 | > 4 | |
348 | > 5 |
|
348 | > 5 | |
349 | > EOF |
|
349 | > EOF | |
350 | $ hg debugsetparents 17 17 |
|
350 | $ hg debugsetparents 17 17 | |
351 | $ hg --config extensions.legacyrepo=../legacyrepo.py commit -m "baz:2" |
|
351 | $ hg --config extensions.legacyrepo=../legacyrepo.py commit -m "baz:2" | |
352 | $ hg debugindexdot .hg/store/data/baz.i |
|
352 | $ hg debugindexdot .hg/store/data/baz.i | |
353 | digraph G { |
|
353 | digraph G { | |
354 | -1 -> 0 |
|
354 | -1 -> 0 | |
355 | 0 -> 1 |
|
355 | 0 -> 1 | |
356 | 1 -> 2 |
|
356 | 1 -> 2 | |
357 | 1 -> 2 |
|
357 | 1 -> 2 | |
358 | } |
|
358 | } | |
359 | $ hg annotate baz |
|
359 | $ hg annotate baz | |
360 | 17: 1 baz:1 |
|
360 | 17: 1 baz:1 | |
361 | 18: 2 baz:2 |
|
361 | 18: 2 baz:2 | |
362 | 16: 3 |
|
362 | 16: 3 | |
363 | 16: 4 |
|
363 | 16: 4 | |
364 | 16: 5 |
|
364 | 16: 5 | |
365 |
|
365 | |||
366 | $ cat > baz <<EOF |
|
366 | $ cat > baz <<EOF | |
367 | > 1 baz:1 |
|
367 | > 1 baz:1 | |
368 | > 2 baz:2 |
|
368 | > 2 baz:2 | |
369 | > 3 baz:3 |
|
369 | > 3 baz:3 | |
370 | > 4 |
|
370 | > 4 | |
371 | > 5 |
|
371 | > 5 | |
372 | > EOF |
|
372 | > EOF | |
373 | $ hg commit -m "baz:3" |
|
373 | $ hg commit -m "baz:3" | |
374 |
|
374 | |||
375 | $ cat > baz <<EOF |
|
375 | $ cat > baz <<EOF | |
376 | > 1 baz:1 |
|
376 | > 1 baz:1 | |
377 | > 2 baz:2 |
|
377 | > 2 baz:2 | |
378 | > 3 baz:3 |
|
378 | > 3 baz:3 | |
379 | > 4 baz:4 |
|
379 | > 4 baz:4 | |
380 | > 5 |
|
380 | > 5 | |
381 | > EOF |
|
381 | > EOF | |
382 | $ hg debugsetparents 19 18 |
|
382 | $ hg debugsetparents 19 18 | |
383 | $ hg --config extensions.legacyrepo=../legacyrepo.py commit -m "baz:4" |
|
383 | $ hg --config extensions.legacyrepo=../legacyrepo.py commit -m "baz:4" | |
384 | $ hg debugindexdot .hg/store/data/baz.i |
|
384 | $ hg debugindexdot .hg/store/data/baz.i | |
385 | digraph G { |
|
385 | digraph G { | |
386 | -1 -> 0 |
|
386 | -1 -> 0 | |
387 | 0 -> 1 |
|
387 | 0 -> 1 | |
388 | 1 -> 2 |
|
388 | 1 -> 2 | |
389 | 1 -> 2 |
|
389 | 1 -> 2 | |
390 | 2 -> 3 |
|
390 | 2 -> 3 | |
391 | 3 -> 4 |
|
391 | 3 -> 4 | |
392 | 2 -> 4 |
|
392 | 2 -> 4 | |
393 | } |
|
393 | } | |
394 | $ hg annotate baz |
|
394 | $ hg annotate baz | |
395 | 17: 1 baz:1 |
|
395 | 17: 1 baz:1 | |
396 | 18: 2 baz:2 |
|
396 | 18: 2 baz:2 | |
397 | 19: 3 baz:3 |
|
397 | 19: 3 baz:3 | |
398 | 20: 4 baz:4 |
|
398 | 20: 4 baz:4 | |
399 | 16: 5 |
|
399 | 16: 5 | |
400 |
|
400 | |||
401 | annotate clean file |
|
401 | annotate clean file | |
402 |
|
402 | |||
403 | $ hg annotate -ncr "wdir()" foo |
|
403 | $ hg annotate -ncr "wdir()" foo | |
404 | 11 472b18db256d : foo |
|
404 | 11 472b18db256d : foo | |
405 |
|
405 | |||
406 | annotate modified file |
|
406 | annotate modified file | |
407 |
|
407 | |||
408 | $ echo foofoo >> foo |
|
408 | $ echo foofoo >> foo | |
409 | $ hg annotate -r "wdir()" foo |
|
409 | $ hg annotate -r "wdir()" foo | |
410 | 11 : foo |
|
410 | 11 : foo | |
411 | 20+: foofoo |
|
411 | 20+: foofoo | |
412 |
|
412 | |||
413 | $ hg annotate -cr "wdir()" foo |
|
413 | $ hg annotate -cr "wdir()" foo | |
414 | 472b18db256d : foo |
|
414 | 472b18db256d : foo | |
415 | b6bedd5477e7+: foofoo |
|
415 | b6bedd5477e7+: foofoo | |
416 |
|
416 | |||
417 | $ hg annotate -ncr "wdir()" foo |
|
417 | $ hg annotate -ncr "wdir()" foo | |
418 | 11 472b18db256d : foo |
|
418 | 11 472b18db256d : foo | |
419 | 20 b6bedd5477e7+: foofoo |
|
419 | 20 b6bedd5477e7+: foofoo | |
420 |
|
420 | |||
421 | $ hg annotate --debug -ncr "wdir()" foo |
|
421 | $ hg annotate --debug -ncr "wdir()" foo | |
422 | 11 472b18db256d1e8282064eab4bfdaf48cbfe83cd : foo |
|
422 | 11 472b18db256d1e8282064eab4bfdaf48cbfe83cd : foo | |
423 | 20 b6bedd5477e797f25e568a6402d4697f3f895a72+: foofoo |
|
423 | 20 b6bedd5477e797f25e568a6402d4697f3f895a72+: foofoo | |
424 |
|
424 | |||
425 | $ hg annotate -udr "wdir()" foo |
|
425 | $ hg annotate -udr "wdir()" foo | |
426 | test Thu Jan 01 00:00:00 1970 +0000: foo |
|
426 | test Thu Jan 01 00:00:00 1970 +0000: foo | |
427 | test [A-Za-z0-9:+ ]+: foofoo (re) |
|
427 | test [A-Za-z0-9:+ ]+: foofoo (re) | |
428 |
|
428 | |||
429 | $ hg annotate -ncr "wdir()" -Tjson foo |
|
429 | $ hg annotate -ncr "wdir()" -Tjson foo | |
430 | [ |
|
430 | [ | |
431 | { |
|
431 | { | |
432 | "line": "foo\n", |
|
432 | "line": "foo\n", | |
433 | "node": "472b18db256d1e8282064eab4bfdaf48cbfe83cd", |
|
433 | "node": "472b18db256d1e8282064eab4bfdaf48cbfe83cd", | |
434 | "rev": 11 |
|
434 | "rev": 11 | |
435 | }, |
|
435 | }, | |
436 | { |
|
436 | { | |
437 | "line": "foofoo\n", |
|
437 | "line": "foofoo\n", | |
438 | "node": null, |
|
438 | "node": null, | |
439 | "rev": null |
|
439 | "rev": null | |
440 | } |
|
440 | } | |
441 | ] |
|
441 | ] | |
442 |
|
442 | |||
443 | annotate added file |
|
443 | annotate added file | |
444 |
|
444 | |||
445 | $ echo bar > bar |
|
445 | $ echo bar > bar | |
446 | $ hg add bar |
|
446 | $ hg add bar | |
447 | $ hg annotate -ncr "wdir()" bar |
|
447 | $ hg annotate -ncr "wdir()" bar | |
448 | 20 b6bedd5477e7+: bar |
|
448 | 20 b6bedd5477e7+: bar | |
449 |
|
449 | |||
450 | annotate renamed file |
|
450 | annotate renamed file | |
451 |
|
451 | |||
452 | $ hg rename foo renamefoo2 |
|
452 | $ hg rename foo renamefoo2 | |
453 | $ hg annotate -ncr "wdir()" renamefoo2 |
|
453 | $ hg annotate -ncr "wdir()" renamefoo2 | |
454 | 11 472b18db256d : foo |
|
454 | 11 472b18db256d : foo | |
455 | 20 b6bedd5477e7+: foofoo |
|
455 | 20 b6bedd5477e7+: foofoo | |
456 |
|
456 | |||
457 | annotate missing file |
|
457 | annotate missing file | |
458 |
|
458 | |||
459 | $ rm baz |
|
459 | $ rm baz | |
|
460 | #if windows | |||
|
461 | $ hg annotate -ncr "wdir()" baz | |||
|
462 | abort: $TESTTMP\repo\baz: The system cannot find the file specified | |||
|
463 | [255] | |||
|
464 | #else | |||
460 | $ hg annotate -ncr "wdir()" baz |
|
465 | $ hg annotate -ncr "wdir()" baz | |
461 | abort: No such file or directory: $TESTTMP/repo/baz |
|
466 | abort: No such file or directory: $TESTTMP/repo/baz | |
462 | [255] |
|
467 | [255] | |
|
468 | #endif | |||
463 |
|
469 | |||
464 | annotate removed file |
|
470 | annotate removed file | |
465 |
|
471 | |||
466 | $ hg rm baz |
|
472 | $ hg rm baz | |
|
473 | #if windows | |||
|
474 | $ hg annotate -ncr "wdir()" baz | |||
|
475 | abort: $TESTTMP\repo\baz: The system cannot find the file specified | |||
|
476 | [255] | |||
|
477 | #else | |||
467 | $ hg annotate -ncr "wdir()" baz |
|
478 | $ hg annotate -ncr "wdir()" baz | |
468 | abort: No such file or directory: $TESTTMP/repo/baz |
|
479 | abort: No such file or directory: $TESTTMP/repo/baz | |
469 | [255] |
|
480 | [255] | |
|
481 | #endif | |||
470 |
|
482 | |||
471 | Test annotate with whitespace options |
|
483 | Test annotate with whitespace options | |
472 |
|
484 | |||
473 | $ cd .. |
|
485 | $ cd .. | |
474 | $ hg init repo-ws |
|
486 | $ hg init repo-ws | |
475 | $ cd repo-ws |
|
487 | $ cd repo-ws | |
476 | $ cat > a <<EOF |
|
488 | $ cat > a <<EOF | |
477 | > aa |
|
489 | > aa | |
478 | > |
|
490 | > | |
479 | > b b |
|
491 | > b b | |
480 | > EOF |
|
492 | > EOF | |
481 | $ hg ci -Am "adda" |
|
493 | $ hg ci -Am "adda" | |
482 | adding a |
|
494 | adding a | |
483 | $ sed 's/EOL$//g' > a <<EOF |
|
495 | $ sed 's/EOL$//g' > a <<EOF | |
484 | > a a |
|
496 | > a a | |
485 | > |
|
497 | > | |
486 | > EOL |
|
498 | > EOL | |
487 | > b b |
|
499 | > b b | |
488 | > EOF |
|
500 | > EOF | |
489 | $ hg ci -m "changea" |
|
501 | $ hg ci -m "changea" | |
490 |
|
502 | |||
491 | Annotate with no option |
|
503 | Annotate with no option | |
492 |
|
504 | |||
493 | $ hg annotate a |
|
505 | $ hg annotate a | |
494 | 1: a a |
|
506 | 1: a a | |
495 | 0: |
|
507 | 0: | |
496 | 1: |
|
508 | 1: | |
497 | 1: b b |
|
509 | 1: b b | |
498 |
|
510 | |||
499 | Annotate with --ignore-space-change |
|
511 | Annotate with --ignore-space-change | |
500 |
|
512 | |||
501 | $ hg annotate --ignore-space-change a |
|
513 | $ hg annotate --ignore-space-change a | |
502 | 1: a a |
|
514 | 1: a a | |
503 | 1: |
|
515 | 1: | |
504 | 0: |
|
516 | 0: | |
505 | 0: b b |
|
517 | 0: b b | |
506 |
|
518 | |||
507 | Annotate with --ignore-all-space |
|
519 | Annotate with --ignore-all-space | |
508 |
|
520 | |||
509 | $ hg annotate --ignore-all-space a |
|
521 | $ hg annotate --ignore-all-space a | |
510 | 0: a a |
|
522 | 0: a a | |
511 | 0: |
|
523 | 0: | |
512 | 1: |
|
524 | 1: | |
513 | 0: b b |
|
525 | 0: b b | |
514 |
|
526 | |||
515 | Annotate with --ignore-blank-lines (similar to no options case) |
|
527 | Annotate with --ignore-blank-lines (similar to no options case) | |
516 |
|
528 | |||
517 | $ hg annotate --ignore-blank-lines a |
|
529 | $ hg annotate --ignore-blank-lines a | |
518 | 1: a a |
|
530 | 1: a a | |
519 | 0: |
|
531 | 0: | |
520 | 1: |
|
532 | 1: | |
521 | 1: b b |
|
533 | 1: b b | |
522 |
|
534 | |||
523 | $ cd .. |
|
535 | $ cd .. | |
524 |
|
536 | |||
525 | Annotate with linkrev pointing to another branch |
|
537 | Annotate with linkrev pointing to another branch | |
526 | ------------------------------------------------ |
|
538 | ------------------------------------------------ | |
527 |
|
539 | |||
528 | create history with a filerev whose linkrev points to another branch |
|
540 | create history with a filerev whose linkrev points to another branch | |
529 |
|
541 | |||
530 | $ hg init branchedlinkrev |
|
542 | $ hg init branchedlinkrev | |
531 | $ cd branchedlinkrev |
|
543 | $ cd branchedlinkrev | |
532 | $ echo A > a |
|
544 | $ echo A > a | |
533 | $ hg commit -Am 'contentA' |
|
545 | $ hg commit -Am 'contentA' | |
534 | adding a |
|
546 | adding a | |
535 | $ echo B >> a |
|
547 | $ echo B >> a | |
536 | $ hg commit -m 'contentB' |
|
548 | $ hg commit -m 'contentB' | |
537 | $ hg up --rev 'desc(contentA)' |
|
549 | $ hg up --rev 'desc(contentA)' | |
538 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
550 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
539 | $ echo unrelated > unrelated |
|
551 | $ echo unrelated > unrelated | |
540 | $ hg commit -Am 'unrelated' |
|
552 | $ hg commit -Am 'unrelated' | |
541 | adding unrelated |
|
553 | adding unrelated | |
542 | created new head |
|
554 | created new head | |
543 | $ hg graft -r 'desc(contentB)' |
|
555 | $ hg graft -r 'desc(contentB)' | |
544 | grafting 1:fd27c222e3e6 "contentB" |
|
556 | grafting 1:fd27c222e3e6 "contentB" | |
545 | $ echo C >> a |
|
557 | $ echo C >> a | |
546 | $ hg commit -m 'contentC' |
|
558 | $ hg commit -m 'contentC' | |
547 | $ hg log -G |
|
559 | $ hg log -G | |
548 | @ changeset: 4:072f1e8df249 |
|
560 | @ changeset: 4:072f1e8df249 | |
549 | | tag: tip |
|
561 | | tag: tip | |
550 | | user: test |
|
562 | | user: test | |
551 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
563 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
552 | | summary: contentC |
|
564 | | summary: contentC | |
553 | | |
|
565 | | | |
554 | o changeset: 3:ff38df03cc4b |
|
566 | o changeset: 3:ff38df03cc4b | |
555 | | user: test |
|
567 | | user: test | |
556 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
568 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
557 | | summary: contentB |
|
569 | | summary: contentB | |
558 | | |
|
570 | | | |
559 | o changeset: 2:62aaf3f6fc06 |
|
571 | o changeset: 2:62aaf3f6fc06 | |
560 | | parent: 0:f0932f74827e |
|
572 | | parent: 0:f0932f74827e | |
561 | | user: test |
|
573 | | user: test | |
562 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
574 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
563 | | summary: unrelated |
|
575 | | summary: unrelated | |
564 | | |
|
576 | | | |
565 | | o changeset: 1:fd27c222e3e6 |
|
577 | | o changeset: 1:fd27c222e3e6 | |
566 | |/ user: test |
|
578 | |/ user: test | |
567 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
579 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
568 | | summary: contentB |
|
580 | | summary: contentB | |
569 | | |
|
581 | | | |
570 | o changeset: 0:f0932f74827e |
|
582 | o changeset: 0:f0932f74827e | |
571 | user: test |
|
583 | user: test | |
572 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
584 | date: Thu Jan 01 00:00:00 1970 +0000 | |
573 | summary: contentA |
|
585 | summary: contentA | |
574 |
|
586 | |||
575 |
|
587 | |||
576 | Annotate should list ancestor of starting revision only |
|
588 | Annotate should list ancestor of starting revision only | |
577 |
|
589 | |||
578 | $ hg annotate a |
|
590 | $ hg annotate a | |
579 | 0: A |
|
591 | 0: A | |
580 | 3: B |
|
592 | 3: B | |
581 | 4: C |
|
593 | 4: C | |
582 |
|
594 | |||
583 | Even when the starting revision is the linkrev-shadowed one: |
|
595 | Even when the starting revision is the linkrev-shadowed one: | |
584 |
|
596 | |||
585 | $ hg annotate a -r 3 |
|
597 | $ hg annotate a -r 3 | |
586 | 0: A |
|
598 | 0: A | |
587 | 3: B |
|
599 | 3: B | |
588 |
|
600 | |||
589 | $ cd .. |
|
601 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now