~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-06-15 11:36:05 UTC
  • mto: This revision was merged to the branch mainline in revision 5975.
  • Revision ID: v.ladeuil+lp@free.fr-20110615113605-p7zyyfry9wy1hquc
Make ContentConflict resolution more robust

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,
116
 
                   append_revisions_only=None):
 
115
    def initialize(self, a_bzrdir, name=None, repository=None):
117
116
        """Format 4 branches cannot be created."""
118
117
        t = a_bzrdir.get_branch_transport(self, name=name)
119
118
        t.put_bytes('format', self.get_format_string())
138
137
        """See BzrBranchFormat.get_format_string()."""
139
138
        return SampleSupportedBranchFormatString
140
139
 
141
 
    def initialize(self, a_bzrdir, name=None, append_revisions_only=None):
 
140
    def initialize(self, a_bzrdir, name=None):
142
141
        t = a_bzrdir.get_branch_transport(self, name=name)
143
142
        t.put_bytes('format', self.get_format_string())
144
143
        return 'A branch'
541
540
        self.assertEqual(('path3', 'location3'),
542
541
                         branch.get_reference_info('file-id'))
543
542
 
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
 
 
554
543
class TestBranchReference(tests.TestCaseWithTransport):
555
544
    """Tests for the branch reference facility."""
556
545
 
663
652
        if value is not None:
664
653
            self.config.set_user_option('append_revisions_only', value)
665
654
        self.assertEqual(expected_value,
666
 
                         self.branch.get_append_revisions_only())
 
655
                         self.branch._get_append_revisions_only())
667
656
 
668
657
    def test_valid_append_revisions_only(self):
669
658
        self.assertEquals(None,
720
709
        r.new_revid = "same-revid"
721
710
        f = StringIO()
722
711
        r.report(f)
723
 
        self.assertEqual("No revisions or tags to pull.\n", f.getvalue())
 
712
        self.assertEqual("No revisions to pull.\n", f.getvalue())
724
713