/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_branch/test_branch.py

  • Committer: Jelmer Vernooij
  • Date: 2011-03-03 12:50:21 UTC
  • mfrom: (5697 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5703.
  • Revision ID: jelmer@samba.org-20110303125021-ziry6a0qsr9l72x5
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
467
467
        br.set_revision_history([])
468
468
        self.assertEquals(br.revision_history(), [])
469
469
 
 
470
    def test_heads_to_fetch(self):
 
471
        # heads_to_fetch is a method that returns a collection of revids that
 
472
        # need to be fetched to copy this branch into another repo.  At a
 
473
        # minimum this will include the tip.
 
474
        # (In native formats, this is the tip + tags, but other formats may
 
475
        # have other revs needed)
 
476
        tree = self.make_branch_and_tree('a')
 
477
        tree.commit('first commit', rev_id='rev1')
 
478
        tree.commit('second commit', rev_id='rev2')
 
479
        must_fetch, should_fetch = tree.branch.heads_to_fetch()
 
480
        self.assertTrue('rev2' in must_fetch)
 
481
 
 
482
    def test_heads_to_fetch_not_null_revision(self):
 
483
        # NULL_REVISION does not appear in the result of heads_to_fetch, even
 
484
        # for an empty branch.
 
485
        tree = self.make_branch_and_tree('a')
 
486
        must_fetch, should_fetch = tree.branch.heads_to_fetch()
 
487
        self.assertFalse(revision.NULL_REVISION in must_fetch)
 
488
        self.assertFalse(revision.NULL_REVISION in should_fetch)
 
489
 
470
490
 
471
491
class TestBranchFormat(per_branch.TestCaseWithBranch):
472
492