~jelmer/bzr-svn/svn-1.5

« back to all changes in this revision

Viewing changes to tests/test_repository.py

  • Committer: Jelmer Vernooij
  • Date: 2008-07-07 11:29:11 UTC
  • mfrom: (1196.1.245 0.4)
  • Revision ID: jelmer@samba.org-20080707112911-fca6wpxr457n690x
MergeĀ 0.4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
401
401
        self.assertEquals(urlutils.join(repos.base, "branches/branchab"), 
402
402
                          branches[0].base)
403
403
 
 
404
    def test_find_tags(self):
 
405
        repos_url = self.make_repository('a')
 
406
 
 
407
        dc = self.get_commit_editor(repos_url)
 
408
        tags = dc.add_dir("tags")
 
409
        tags.add_dir("tags/brancha").add_file("tags/brancha/data").modify()
 
410
        tags.add_dir("tags/branchab").add_file("tags/branchab/data").modify()
 
411
        dc.close()
 
412
 
 
413
        repos = Repository.open(repos_url)
 
414
        set_branching_scheme(repos, TrunkBranchingScheme())
 
415
        tags = repos.find_tags()
 
416
        self.assertEquals({"brancha": repos.generate_revision_id(1, "tags/brancha", repos.get_mapping()),
 
417
                           "branchab": repos.generate_revision_id(1, "tags/branchab", repos.get_mapping())}, tags)
 
418
 
 
419
    def test_find_tags_unmodified(self):
 
420
        repos_url = self.make_repository('a')
 
421
 
 
422
        dc = self.get_commit_editor(repos_url)
 
423
        dc.add_dir("trunk").add_file("trunk/data").modify()
 
424
        dc.close()
 
425
 
 
426
        dc = self.get_commit_editor(repos_url)
 
427
        tags = dc.add_dir("tags")
 
428
        tags.add_dir("tags/brancha", "trunk")
 
429
        dc.close()
 
430
 
 
431
        repos = Repository.open(repos_url)
 
432
        set_branching_scheme(repos, TrunkBranchingScheme())
 
433
        tags = repos.find_tags()
 
434
        self.assertEquals({"brancha": repos.generate_revision_id(1, "trunk", repos.get_mapping())}, tags)
 
435
 
 
436
    def test_find_tags_modified(self):
 
437
        repos_url = self.make_repository('a')
 
438
 
 
439
        dc = self.get_commit_editor(repos_url)
 
440
        dc.add_dir("trunk").add_file("trunk/data").modify()
 
441
        dc.close()
 
442
 
 
443
        dc = self.get_commit_editor(repos_url)
 
444
        tags = dc.add_dir("tags")
 
445
        tags.add_dir("tags/brancha", "trunk")
 
446
        dc.close()
 
447
 
 
448
        dc = self.get_commit_editor(repos_url)
 
449
        tags = dc.open_dir("tags")
 
450
        brancha = tags.open_dir("tags/brancha")
 
451
        brancha.add_file("tags/brancha/release-notes").modify()
 
452
        dc.close()
 
453
 
 
454
        repos = Repository.open(repos_url)
 
455
        set_branching_scheme(repos, TrunkBranchingScheme())
 
456
        tags = repos.find_tags()
 
457
        self.assertEquals({"brancha": repos.generate_revision_id(3, "tags/brancha", repos.get_mapping())}, tags)
 
458
 
404
459
    def test_find_branchpaths_moved(self):
405
460
        repos_url = self.make_client("a", "dc")
406
461
        self.build_tree({