~bzr/ubuntu/maverick/bzr-svn/bzr-ppa

« back to all changes in this revision

Viewing changes to tests/test_branch.py

  • Committer: Jelmer Vernooij
  • Date: 2008-05-11 19:29:26 UTC
  • mfrom: (220.36.144 0.4)
  • Revision ID: jelmer@samba.org-20080511192926-7mh02j45r25qmzkz
Merge 0.4 branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
5
 
# the Free Software Foundation; either version 2 of the License, or
 
5
# the Free Software Foundation; either version 3 of the License, or
6
6
# (at your option) any later version.
7
7
 
8
8
# This program is distributed in the hope that it will be useful,
20
20
from bzrlib.bzrdir import BzrDir
21
21
from bzrlib.errors import NoSuchFile, NoSuchRevision, NotBranchError
22
22
from bzrlib.repository import Repository
 
23
from bzrlib.revision import NULL_REVISION
23
24
from bzrlib.trace import mutter
24
25
 
25
26
import os
27
28
 
28
29
from branch import FakeControlFiles, SvnBranchFormat
29
30
from convert import load_dumpfile
30
 
from mapping import (SVN_PROP_BZR_REVISION_ID, BzrSvnMappingv3FileProps)
31
 
from scheme import TrunkBranchingScheme
 
31
from mapping import SVN_PROP_BZR_REVISION_ID
 
32
from mapping3 import BzrSvnMappingv3FileProps
 
33
from mapping3.scheme import TrunkBranchingScheme
32
34
from tests import TestCaseWithSubversionRepository
33
35
 
34
36
class WorkingSubversionBranch(TestCaseWithSubversionRepository):
192
194
        """The None revid should map to revno 0."""
193
195
        repos_url = self.make_client('a', 'dc')
194
196
        branch = Branch.open(repos_url)
195
 
        self.assertEquals(0, branch.revision_id_to_revno(None))
 
197
        self.assertEquals(0, branch.revision_id_to_revno(NULL_REVISION))
196
198
 
197
199
    def test_revision_id_to_revno_nonexistant(self):
198
200
        """revision_id_to_revno() should raise NoSuchRevision if
502
504
        weave = newbranch.repository.weave_store.get_weave(
503
505
            tree.inventory.path2id("hosts"),
504
506
            newbranch.repository.get_transaction())
 
507
 
505
508
        self.assertEqual(set([
506
509
            oldbranch.generate_revision_id(6),
507
510
            oldbranch.generate_revision_id(7)]),
711
714
        newdir.find_repository().get_revision_inventory(
712
715
                newdir.open_branch().last_revision())
713
716
 
 
717
 
714
718
class TestFakeControlFiles(TestCase):
715
719
    def test_get_utf8(self):
716
720
        f = FakeControlFiles()
721
725
        f = FakeControlFiles()
722
726
        self.assertRaises(NoSuchFile, f.get, "foobla")
723
727
 
 
728
 
724
729
class BranchFormatTests(TestCase):
725
730
    def setUp(self):
726
731
        self.format = SvnBranchFormat()