Indefero

Indefero Commit Details


Date:2011-04-12 16:47:44 (13 years 8 months ago)
Author:Thomas Keller
Branch:develop, feature-issue_links, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, release-1.2, release-1.3
Commit:67b80ee11c3184ca54dfa725b0249e20942a7d48
Parents: 0afa07b2bda73f3cfea735243eb4582f5e2b2829
Message:Continue with the mtn interface tests

- getPathInfo(), disambiguateRevision() and validateRevision() are done
- we no longer need to check / skip a format_version stanza for the extended
manifest (there is no such stanza outputted)
Changes:

File differences

src/IDF/Scm/Monotone.php
536536
537537
538538
539
540
541
542539
543540
544541
$stanzas = IDF_Scm_Monotone_BasicIO::parse($out);
foreach ($stanzas as $stanza) {
if ($stanza[0]['key'] == 'format_version')
continue;
if ($stanza[0]['values'][0] != $file)
continue;
test/IDF/Scm/MonotoneTest.php
140140
141141
142142
143
143144
144145
145146
......
171172
172173
173174
175
174176
175177
176178
177179
178180
181
179182
180183
181184
......
186189
187190
188191
192
189193
190194
191195
192196
193197
198
194199
195200
196201
......
200205
201206
202207
203
208
209
210
211
212
213
214
215
216
217
218
219
204220
205221
206222
207223
208
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
209267
210268
211269
212270
213
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
214385
215386
216387
217388
218389
390
219391
220392
221393
222394
223395
396
224397
225398
226399
227400
228401
229402
403
230404
231405
232406
233407
234408
409
235410
236411
237412
238413
239414
415
240416
241417
242418
......
244420
245421
246422
423
247424
248425
249426
public function testInBranches()
{
// returns the branches the given commit is in
$this->markTestIncomplete();
}
public function testGetTags()
public function testInTags()
{
// returns the tags that are attached to the given commit
$this->markTestIncomplete();
}
public function testGetTree()
{
// test root and sub tree fetching
$this->markTestIncomplete();
}
public function testFindAuthor()
public function testGetAnonymousAccessUrl()
{
// test the generation of the anonymous remote URL
$this->markTestIncomplete();
}
public function testGetAuthAccessUrl()
{
// test the generation of the authenticated remote URL (only really visible for SSH)
$this->markTestIncomplete();
}
public function testFactory()
public function testValidateRevision()
{
// test valid, invalid and ambigious
$stdio = "\n";
$instance = $this->createMock(array('select', 't:123'), array(), $stdio);
$this->assertEquals(IDF_Scm::REVISION_INVALID, $instance->validateRevision('t:123'));
$stdio = "1234567890123456789012345678901234567890\n";
$instance->getStdio()->setExpectedOutput(array('select', 't:123'), array(), $stdio);
$this->assertEquals(IDF_Scm::REVISION_VALID, $instance->validateRevision('t:123'));
$stdio = "1234567890123456789012345678901234567890\n".
"1234567890123456789012345678901234567891\n";
$instance->getStdio()->setExpectedOutput(array('select', 't:123'), array(), $stdio);
$this->assertEquals(IDF_Scm::REVISION_AMBIGUOUS, $instance->validateRevision('t:123'));
}
public function testDisambiguateRevision()
{
// test for array of commit objects
$instance = $this->createMock();
$stdio = "1234567890123456789012345678901234567890\n";
$instance->getStdio()->setExpectedOutput(array('select', 't:123'), array(), $stdio);
$stdio =<<<END
key [1aaecf3a7c227e5545b0504aea5d3716d3128117]
signature "ok"
name "author"
value "me@thomaskeller.biz"
trust "trusted"
key [1aaecf3a7c227e5545b0504aea5d3716d3128117]
signature "ok"
name "branch"
value "net.venge.monotone"
trust "trusted"
key [1aaecf3a7c227e5545b0504aea5d3716d3128117]
signature "ok"
name "changelog"
value "* po/de.po: German translation updated
"
trust "trusted"
key [1aaecf3a7c227e5545b0504aea5d3716d3128117]
signature "ok"
name "date"
value "2011-03-19T13:59:47"
trust "trusted"
END;
$instance->getStdio()->setExpectedOutput(array('certs', '1234567890123456789012345678901234567890'), array(), $stdio);
$ret = $instance->disambiguateRevision('t:123');
$this->assertTrue(is_array($ret));
$this->assertEquals(1, count($ret));
$this->assertTrue($ret[0] instanceof stdClass);
$this->assertEquals('me@thomaskeller.biz', $ret[0]->author);
$this->assertEquals('net.venge.monotone', $ret[0]->branch);
$this->assertEquals('* po/de.po: German translation updated', $ret[0]->title);
$this->assertEquals('1234567890123456789012345678901234567890', $ret[0]->commit);
$this->assertEquals('2011-03-19 13:59:47', $ret[0]->date);
}
public function testGetPathInfo()
{
// return the info (creation date, last commit, et cetera) for a single file and commit
$instance = $this->createMock();
//
// non-existing revision
//
$this->assertFalse($instance->getPathInfo('AUTHORS', 'foo'));
$stdio = "1234567890123456789012345678901234567890\n";
$instance->getStdio()->setExpectedOutput(array('select', 't:123'), array(), $stdio);
$stdio =<<<END
dir ""
birth [276264b0b3f1e70fc1835a700e6e61bdbe4c3f2f]
path_mark [276264b0b3f1e70fc1835a700e6e61bdbe4c3f2f]
dir "doc"
birth [a10037b1aa8a905018b72e6bd96fb8f8475f0f65]
path_mark [a10037b1aa8a905018b72e6bd96fb8f8475f0f65]
file "doc/AUTHORS"
content [de9ed2fffe2e8c0094bf51bb66d1c1ff2deeaa03]
size "17024"
birth [276264b0b3f1e70fc1835a700e6e61bdbe4c3f2f]
path_mark [276264b0b3f1e70fc1835a700e6e61bdbe4c3f2f]
content_mark [fdb579b6682d78fac24912e7a82a8209b9a54099]
END;
$instance->getStdio()->setExpectedOutput(array('get_extended_manifest_of', '1234567890123456789012345678901234567890'), array(), $stdio);
//
// non-existing file
//
$this->assertFalse($instance->getPathInfo('foo', 't:123'));
//
// existing file file
//
$stdio =<<<END
key [1aaecf3a7c227e5545b0504aea5d3716d3128117]
signature "ok"
name "author"
value "me@thomaskeller.biz"
trust "trusted"
key [1aaecf3a7c227e5545b0504aea5d3716d3128117]
signature "ok"
name "branch"
value "net.venge.monotone.source-tree-cleanup"
trust "trusted"
key [1aaecf3a7c227e5545b0504aea5d3716d3128117]
signature "ok"
name "changelog"
value "update the source paths
"
trust "trusted"
key [1aaecf3a7c227e5545b0504aea5d3716d3128117]
signature "ok"
name "date"
value "2011-01-24T00:00:23"
trust "trusted"
END;
$instance->getStdio()->setExpectedOutput(array('certs', 'fdb579b6682d78fac24912e7a82a8209b9a54099'), array(), $stdio);
$file = $instance->getPathInfo('doc/AUTHORS', 't:123');
$this->assertEquals('doc/AUTHORS', $file->fullpath);
$this->assertEquals('doc/AUTHORS', $file->efullpath);
$this->assertEquals('AUTHORS', $file->file);
$this->assertEquals('blob', $file->type);
$this->assertEquals(17024, $file->size);
$this->assertEquals('fdb579b6682d78fac24912e7a82a8209b9a54099', $file->rev);
$this->assertEquals('me@thomaskeller.biz', $file->author);
$this->assertEquals('2011-01-24 00:00:23', $file->date);
$this->assertEquals('update the source paths', $file->log);
//
// existing directory
//
$stdio =<<<END
key [10b5b36b4aadc46c0a946b6e76e087ccdddf8b86]
signature "ok"
name "author"
value "graydon@pobox.com"
trust "trusted"
key [10b5b36b4aadc46c0a946b6e76e087ccdddf8b86]
signature "ok"
name "branch"
value "net.venge.monotone.visualc8"
trust "trusted"
key [10b5b36b4aadc46c0a946b6e76e087ccdddf8b86]
signature "ok"
name "changelog"
value "initial build working"
trust "trusted"
key [10b5b36b4aadc46c0a946b6e76e087ccdddf8b86]
signature "ok"
name "date"
value "2006-03-13T08:06:22"
trust "trusted"
END;
$instance->getStdio()->setExpectedOutput(array('certs', 'a10037b1aa8a905018b72e6bd96fb8f8475f0f65'), array(), $stdio);
$file = $instance->getPathInfo('doc', 't:123');
$this->assertEquals('doc', $file->fullpath);
$this->assertEquals('doc', $file->efullpath);
$this->assertEquals('doc', $file->file);
$this->assertEquals('tree', $file->type);
$this->assertEquals(0, $file->size);
$this->assertEquals('a10037b1aa8a905018b72e6bd96fb8f8475f0f65', $file->rev);
$this->assertEquals('graydon@pobox.com', $file->author);
$this->assertEquals('2006-03-13 08:06:22', $file->date);
$this->assertEquals('initial build working', $file->log);
}
public function testGetFile()
{
// test cmd_only and full file fetching
$this->markTestIncomplete();
}
public function testGetChanges()
{
// test retrieving the changes of a specific revision
$this->markTestIncomplete();
}
public function testGetCommit()
{
// test get commit information with and without a diff text
// test multiple branches, dates, authors, aso
$this->markTestIncomplete();
}
public function testGetExtraProperties()
{
// test array('parents' => array(rev1, rev2, ...)) or array() if root revision
$this->markTestIncomplete();
}
public function testIsCommitLarge()
{
// test for true / false with commits with more than 100 changes
$this->markTestIncomplete();
}
public function testGetChangeLog()
// test with no commit, empty $n
// test logging stops at unknown branches
// test logging stops at $n
$this->markTestIncomplete();
}
}

Archive Download the corresponding diff file

Page rendered in 0.25613s using 13 queries.