~ubuntu-branches/ubuntu/intrepid/git-core/intrepid-updates

« back to all changes in this revision

Viewing changes to t/t6003-rev-list-topo-order.sh

  • Committer: Package Import Robot
  • Author(s): Gerrit Pape
  • Date: 2007-10-04 08:27:01 UTC
  • mfrom: (1.1.23)
  • Revision ID: package-import@ubuntu.com-20071004082701-rsd058ontoqz4i30
Tags: 1:1.5.3.4-1
new upstream point release (closes: #445188).

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
# Copyright (c) 2005 Jon Seymour
4
4
#
5
5
 
6
 
test_description='Tests git-rev-list --topo-order functionality'
 
6
test_description='Tests git rev-list --topo-order functionality'
7
7
 
8
8
. ./test-lib.sh
9
9
. ../t6000lib.sh # t6xxx specific functions
14
14
}
15
15
 
16
16
date >path0
17
 
git-update-index --add path0
18
 
save_tag tree git-write-tree
 
17
git update-index --add path0
 
18
save_tag tree git write-tree
19
19
on_committer_date "1971-08-16 00:00:00" hide_error save_tag root unique_commit root tree
20
20
on_committer_date "1971-08-16 00:00:01" save_tag l0 unique_commit l0 tree -p root
21
21
on_committer_date "1971-08-16 00:00:02" save_tag l1 unique_commit l1 tree -p l0
77
77
save_tag g3 unique_commit g5 tree -p g2
78
78
save_tag g4 unique_commit g6 tree -p g3 -p h2
79
79
 
80
 
git-update-ref HEAD $(tag l5)
 
80
git update-ref HEAD $(tag l5)
81
81
 
82
 
test_output_expect_success 'rev-list has correct number of entries' 'git-rev-list HEAD | wc -l | tr -d \" \"' <<EOF
 
82
test_output_expect_success 'rev-list has correct number of entries' 'git rev-list HEAD | wc -l | tr -d \" \"' <<EOF
83
83
19
84
84
EOF
85
85
 
86
 
test_output_expect_success 'simple topo order' 'git-rev-list --topo-order  HEAD' <<EOF
 
86
test_output_expect_success 'simple topo order' 'git rev-list --topo-order  HEAD' <<EOF
87
87
l5
88
88
l4
89
89
l3
105
105
root
106
106
EOF
107
107
 
108
 
test_output_expect_success 'two diamonds topo order (g6)' 'git-rev-list --topo-order  g4' <<EOF
 
108
test_output_expect_success 'two diamonds topo order (g6)' 'git rev-list --topo-order  g4' <<EOF
109
109
g4
110
110
h2
111
111
g3
115
115
g0
116
116
EOF
117
117
 
118
 
test_output_expect_success 'multiple heads' 'git-rev-list --topo-order a3 b3 c3' <<EOF
119
 
a3
120
 
a2
121
 
a1
122
 
c3
123
 
c2
124
 
c1
125
 
b3
126
 
b2
127
 
b1
128
 
a0
129
 
l2
130
 
l1
131
 
l0
132
 
root
133
 
EOF
134
 
 
135
 
test_output_expect_success 'multiple heads, prune at a1' 'git-rev-list --topo-order a3 b3 c3 ^a1' <<EOF
136
 
a3
137
 
a2
138
 
c3
139
 
c2
140
 
c1
141
 
b3
142
 
b2
143
 
b1
144
 
EOF
145
 
 
146
 
test_output_expect_success 'multiple heads, prune at l1' 'git-rev-list --topo-order a3 b3 c3 ^l1' <<EOF
147
 
a3
148
 
a2
149
 
a1
150
 
c3
151
 
c2
152
 
c1
153
 
b3
154
 
b2
155
 
b1
156
 
a0
157
 
l2
158
 
EOF
159
 
 
160
 
test_output_expect_success 'cross-epoch, head at l5, prune at l1' 'git-rev-list --topo-order l5 ^l1' <<EOF
161
 
l5
162
 
l4
163
 
l3
164
 
a4
165
 
c3
166
 
c2
167
 
c1
168
 
b4
169
 
a3
170
 
a2
171
 
a1
172
 
b3
173
 
b2
174
 
b1
175
 
a0
176
 
l2
177
 
EOF
178
 
 
179
 
test_output_expect_success 'duplicated head arguments' 'git-rev-list --topo-order l5 l5 ^l1' <<EOF
180
 
l5
181
 
l4
182
 
l3
183
 
a4
184
 
c3
185
 
c2
186
 
c1
187
 
b4
188
 
a3
189
 
a2
190
 
a1
191
 
b3
192
 
b2
193
 
b1
194
 
a0
195
 
l2
196
 
EOF
197
 
 
198
 
test_output_expect_success 'prune near topo' 'git-rev-list --topo-order a4 ^c3' <<EOF
199
 
a4
200
 
b4
201
 
a3
202
 
a2
203
 
a1
204
 
b3
205
 
EOF
206
 
 
207
 
test_output_expect_success "head has no parent" 'git-rev-list --topo-order  root' <<EOF
208
 
root
209
 
EOF
210
 
 
211
 
test_output_expect_success "two nodes - one head, one base" 'git-rev-list --topo-order  l0' <<EOF
212
 
l0
213
 
root
214
 
EOF
215
 
 
216
 
test_output_expect_success "three nodes one head, one internal, one base" 'git-rev-list --topo-order  l1' <<EOF
217
 
l1
218
 
l0
219
 
root
220
 
EOF
221
 
 
222
 
test_output_expect_success "linear prune l2 ^root" 'git-rev-list --topo-order  l2 ^root' <<EOF
223
 
l2
224
 
l1
225
 
l0
226
 
EOF
227
 
 
228
 
test_output_expect_success "linear prune l2 ^l0" 'git-rev-list --topo-order  l2 ^l0' <<EOF
229
 
l2
230
 
l1
231
 
EOF
232
 
 
233
 
test_output_expect_success "linear prune l2 ^l1" 'git-rev-list --topo-order  l2 ^l1' <<EOF
234
 
l2
235
 
EOF
236
 
 
237
 
test_output_expect_success "linear prune l5 ^a4" 'git-rev-list --topo-order  l5 ^a4' <<EOF
238
 
l5
239
 
l4
240
 
l3
241
 
EOF
242
 
 
243
 
test_output_expect_success "linear prune l5 ^l3" 'git-rev-list --topo-order  l5 ^l3' <<EOF
244
 
l5
245
 
l4
246
 
EOF
247
 
 
248
 
test_output_expect_success "linear prune l5 ^l4" 'git-rev-list --topo-order  l5 ^l4' <<EOF
249
 
l5
250
 
EOF
251
 
 
252
 
test_output_expect_success "max-count 10 - topo order" 'git-rev-list --topo-order  --max-count=10 l5' <<EOF
253
 
l5
254
 
l4
255
 
l3
256
 
a4
257
 
c3
258
 
c2
259
 
c1
260
 
b4
261
 
a3
262
 
a2
263
 
EOF
264
 
 
265
 
test_output_expect_success "max-count 10 - non topo order" 'git-rev-list --max-count=10 l5' <<EOF
266
 
l5
267
 
l4
268
 
l3
269
 
a4
270
 
b4
271
 
a3
272
 
a2
273
 
c3
274
 
c2
275
 
b3
276
 
EOF
277
 
 
278
 
test_output_expect_success '--max-age=c3, no --topo-order' "git-rev-list --max-age=$(commit_date c3) l5" <<EOF
 
118
test_output_expect_success 'multiple heads' 'git rev-list --topo-order a3 b3 c3' <<EOF
 
119
a3
 
120
a2
 
121
a1
 
122
c3
 
123
c2
 
124
c1
 
125
b3
 
126
b2
 
127
b1
 
128
a0
 
129
l2
 
130
l1
 
131
l0
 
132
root
 
133
EOF
 
134
 
 
135
test_output_expect_success 'multiple heads, prune at a1' 'git rev-list --topo-order a3 b3 c3 ^a1' <<EOF
 
136
a3
 
137
a2
 
138
c3
 
139
c2
 
140
c1
 
141
b3
 
142
b2
 
143
b1
 
144
EOF
 
145
 
 
146
test_output_expect_success 'multiple heads, prune at l1' 'git rev-list --topo-order a3 b3 c3 ^l1' <<EOF
 
147
a3
 
148
a2
 
149
a1
 
150
c3
 
151
c2
 
152
c1
 
153
b3
 
154
b2
 
155
b1
 
156
a0
 
157
l2
 
158
EOF
 
159
 
 
160
test_output_expect_success 'cross-epoch, head at l5, prune at l1' 'git rev-list --topo-order l5 ^l1' <<EOF
 
161
l5
 
162
l4
 
163
l3
 
164
a4
 
165
c3
 
166
c2
 
167
c1
 
168
b4
 
169
a3
 
170
a2
 
171
a1
 
172
b3
 
173
b2
 
174
b1
 
175
a0
 
176
l2
 
177
EOF
 
178
 
 
179
test_output_expect_success 'duplicated head arguments' 'git rev-list --topo-order l5 l5 ^l1' <<EOF
 
180
l5
 
181
l4
 
182
l3
 
183
a4
 
184
c3
 
185
c2
 
186
c1
 
187
b4
 
188
a3
 
189
a2
 
190
a1
 
191
b3
 
192
b2
 
193
b1
 
194
a0
 
195
l2
 
196
EOF
 
197
 
 
198
test_output_expect_success 'prune near topo' 'git rev-list --topo-order a4 ^c3' <<EOF
 
199
a4
 
200
b4
 
201
a3
 
202
a2
 
203
a1
 
204
b3
 
205
EOF
 
206
 
 
207
test_output_expect_success "head has no parent" 'git rev-list --topo-order  root' <<EOF
 
208
root
 
209
EOF
 
210
 
 
211
test_output_expect_success "two nodes - one head, one base" 'git rev-list --topo-order  l0' <<EOF
 
212
l0
 
213
root
 
214
EOF
 
215
 
 
216
test_output_expect_success "three nodes one head, one internal, one base" 'git rev-list --topo-order  l1' <<EOF
 
217
l1
 
218
l0
 
219
root
 
220
EOF
 
221
 
 
222
test_output_expect_success "linear prune l2 ^root" 'git rev-list --topo-order  l2 ^root' <<EOF
 
223
l2
 
224
l1
 
225
l0
 
226
EOF
 
227
 
 
228
test_output_expect_success "linear prune l2 ^l0" 'git rev-list --topo-order  l2 ^l0' <<EOF
 
229
l2
 
230
l1
 
231
EOF
 
232
 
 
233
test_output_expect_success "linear prune l2 ^l1" 'git rev-list --topo-order  l2 ^l1' <<EOF
 
234
l2
 
235
EOF
 
236
 
 
237
test_output_expect_success "linear prune l5 ^a4" 'git rev-list --topo-order  l5 ^a4' <<EOF
 
238
l5
 
239
l4
 
240
l3
 
241
EOF
 
242
 
 
243
test_output_expect_success "linear prune l5 ^l3" 'git rev-list --topo-order  l5 ^l3' <<EOF
 
244
l5
 
245
l4
 
246
EOF
 
247
 
 
248
test_output_expect_success "linear prune l5 ^l4" 'git rev-list --topo-order  l5 ^l4' <<EOF
 
249
l5
 
250
EOF
 
251
 
 
252
test_output_expect_success "max-count 10 - topo order" 'git rev-list --topo-order  --max-count=10 l5' <<EOF
 
253
l5
 
254
l4
 
255
l3
 
256
a4
 
257
c3
 
258
c2
 
259
c1
 
260
b4
 
261
a3
 
262
a2
 
263
EOF
 
264
 
 
265
test_output_expect_success "max-count 10 - non topo order" 'git rev-list --max-count=10 l5' <<EOF
 
266
l5
 
267
l4
 
268
l3
 
269
a4
 
270
b4
 
271
a3
 
272
a2
 
273
c3
 
274
c2
 
275
b3
 
276
EOF
 
277
 
 
278
test_output_expect_success '--max-age=c3, no --topo-order' "git rev-list --max-age=$(commit_date c3) l5" <<EOF
279
279
l5
280
280
l4
281
281
l3
289
289
#
290
290
# this test fails on --topo-order - a fix is required
291
291
#
292
 
#test_output_expect_success '--max-age=c3, --topo-order' "git-rev-list --topo-order --max-age=$(commit_date c3) l5" <<EOF
 
292
#test_output_expect_success '--max-age=c3, --topo-order' "git rev-list --topo-order --max-age=$(commit_date c3) l5" <<EOF
293
293
#l5
294
294
#l4
295
295
#l3
300
300
#a2
301
301
#EOF
302
302
 
303
 
test_output_expect_success 'one specified head reachable from another a4, c3, --topo-order' "list_duplicates git-rev-list --topo-order a4 c3" <<EOF
304
 
EOF
305
 
 
306
 
test_output_expect_success 'one specified head reachable from another c3, a4, --topo-order' "list_duplicates git-rev-list --topo-order c3 a4" <<EOF
307
 
EOF
308
 
 
309
 
test_output_expect_success 'one specified head reachable from another a4, c3, no --topo-order' "list_duplicates git-rev-list a4 c3" <<EOF
310
 
EOF
311
 
 
312
 
test_output_expect_success 'one specified head reachable from another c3, a4, no --topo-order' "list_duplicates git-rev-list c3 a4" <<EOF
313
 
EOF
314
 
 
315
 
test_output_expect_success 'graph with c3 and a4 parents of head' "list_duplicates git-rev-list m1" <<EOF
316
 
EOF
317
 
 
318
 
test_output_expect_success 'graph with a4 and c3 parents of head' "list_duplicates git-rev-list m2" <<EOF
319
 
EOF
320
 
 
321
 
test_expect_success "head ^head --topo-order" 'git-rev-list --topo-order  a3 ^a3' <<EOF
322
 
EOF
323
 
 
324
 
test_expect_success "head ^head no --topo-order" 'git-rev-list a3 ^a3' <<EOF
325
 
EOF
326
 
 
327
 
test_output_expect_success 'simple topo order (l5r1)' 'git-rev-list --topo-order  l5r1' <<EOF
 
303
test_output_expect_success 'one specified head reachable from another a4, c3, --topo-order' "list_duplicates git rev-list --topo-order a4 c3" <<EOF
 
304
EOF
 
305
 
 
306
test_output_expect_success 'one specified head reachable from another c3, a4, --topo-order' "list_duplicates git rev-list --topo-order c3 a4" <<EOF
 
307
EOF
 
308
 
 
309
test_output_expect_success 'one specified head reachable from another a4, c3, no --topo-order' "list_duplicates git rev-list a4 c3" <<EOF
 
310
EOF
 
311
 
 
312
test_output_expect_success 'one specified head reachable from another c3, a4, no --topo-order' "list_duplicates git rev-list c3 a4" <<EOF
 
313
EOF
 
314
 
 
315
test_output_expect_success 'graph with c3 and a4 parents of head' "list_duplicates git rev-list m1" <<EOF
 
316
EOF
 
317
 
 
318
test_output_expect_success 'graph with a4 and c3 parents of head' "list_duplicates git rev-list m2" <<EOF
 
319
EOF
 
320
 
 
321
test_expect_success "head ^head --topo-order" 'git rev-list --topo-order  a3 ^a3' <<EOF
 
322
EOF
 
323
 
 
324
test_expect_success "head ^head no --topo-order" 'git rev-list a3 ^a3' <<EOF
 
325
EOF
 
326
 
 
327
test_output_expect_success 'simple topo order (l5r1)' 'git rev-list --topo-order  l5r1' <<EOF
328
328
l5r1
329
329
r1
330
330
r0
350
350
root
351
351
EOF
352
352
 
353
 
test_output_expect_success 'simple topo order (r1l5)' 'git-rev-list --topo-order  r1l5' <<EOF
 
353
test_output_expect_success 'simple topo order (r1l5)' 'git rev-list --topo-order  r1l5' <<EOF
354
354
r1l5
355
355
l5
356
356
l4
376
376
alt_root
377
377
EOF
378
378
 
379
 
test_output_expect_success "don't print things unreachable from one branch" "git-rev-list a3 ^b3 --topo-order" <<EOF
 
379
test_output_expect_success "don't print things unreachable from one branch" "git rev-list a3 ^b3 --topo-order" <<EOF
380
380
a3
381
381
a2
382
382
a1
383
383
EOF
384
384
 
385
 
test_output_expect_success "--topo-order a4 l3" "git-rev-list --topo-order a4 l3" <<EOF
 
385
test_output_expect_success "--topo-order a4 l3" "git rev-list --topo-order a4 l3" <<EOF
386
386
l3
387
387
a4
388
388
c3