~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testbranch.py

  • Committer: Robert Collins
  • Date: 2005-10-02 22:47:02 UTC
  • mto: This revision was merged to the branch mainline in revision 1397.
  • Revision ID: robertc@robertcollins.net-20051002224701-8a8b20b90de559a6
support ghosts in commits

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
from bzrlib.selftest import TestCaseInTempDir
23
23
from bzrlib.trace import mutter
24
24
 
 
25
 
25
26
class TestBranch(TestCaseInTempDir):
26
27
 
27
28
    def test_append_revisions(self):
101
102
        self.assertTrue(os.path.exists('b/one'))
102
103
        self.assertFalse(os.path.exists('b/two'))
103
104
        
 
105
 
 
106
    def test_record_initial_ghost_merge(self):
 
107
        """A pending merge with no revision present is still a merge."""
 
108
        branch = Branch.initialize('.')
 
109
        branch.add_pending_merge('non:existent@rev--ision--0--2')
 
110
        branch.commit('pretend to merge nonexistent-revision', rev_id='first')
 
111
        rev = branch.get_revision(branch.last_revision())
 
112
        self.assertEqual(len(rev.parent_ids), 1)
 
113
        # parent_sha1s is not populated now, WTF. rbc 20051003
 
114
        self.assertEqual(len(rev.parent_sha1s), 0)
 
115
        self.assertEqual(rev.parent_ids[0], 'non:existent@rev--ision--0--2')
 
116
 
 
117
# TODO:
 
118
# compare the gpg-to-sign info for a commit with a ghost and 
 
119
#     an identical tree without a ghost
 
120
# fetch missing should rewrite the TOC of weaves to list newly available parents.
104
121
        
105
122
# TODO: rewrite this as a regular unittest, without relying on the displayed output        
106
123
#         >>> from bzrlib.commit import commit