~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_branch.py

  • Committer: Vincent Ladeuil
  • Date: 2011-10-31 22:11:59 UTC
  • mfrom: (6236 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6252.
  • Revision ID: v.ladeuil+lp@free.fr-20111031221159-zmbd6izz1flzyisa
Merge trunk before submission

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
        """See BzrBranchFormat.get_format_string()."""
113
113
        return "Sample branch format."
114
114
 
115
 
    def initialize(self, a_bzrdir, name=None, repository=None):
 
115
    def initialize(self, a_bzrdir, name=None, repository=None,
 
116
                   append_revisions_only=None):
116
117
        """Format 4 branches cannot be created."""
117
118
        t = a_bzrdir.get_branch_transport(self, name=name)
118
119
        t.put_bytes('format', self.get_format_string())
137
138
        """See BzrBranchFormat.get_format_string()."""
138
139
        return SampleSupportedBranchFormatString
139
140
 
140
 
    def initialize(self, a_bzrdir, name=None):
 
141
    def initialize(self, a_bzrdir, name=None, append_revisions_only=None):
141
142
        t = a_bzrdir.get_branch_transport(self, name=name)
142
143
        t.put_bytes('format', self.get_format_string())
143
144
        return 'A branch'
540
541
        self.assertEqual(('path3', 'location3'),
541
542
                         branch.get_reference_info('file-id'))
542
543
 
 
544
    def _recordParentMapCalls(self, repo):
 
545
        self._parent_map_calls = []
 
546
        orig_get_parent_map = repo.revisions.get_parent_map
 
547
        def get_parent_map(q):
 
548
            q = list(q)
 
549
            self._parent_map_calls.extend([e[0] for e in q])
 
550
            return orig_get_parent_map(q)
 
551
        repo.revisions.get_parent_map = get_parent_map
 
552
 
 
553
 
543
554
class TestBranchReference(tests.TestCaseWithTransport):
544
555
    """Tests for the branch reference facility."""
545
556
 
652
663
        if value is not None:
653
664
            self.config.set_user_option('append_revisions_only', value)
654
665
        self.assertEqual(expected_value,
655
 
                         self.branch._get_append_revisions_only())
 
666
                         self.branch.get_append_revisions_only())
656
667
 
657
668
    def test_valid_append_revisions_only(self):
658
669
        self.assertEquals(None,