/breezy/trunk

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/trunk

« back to all changes in this revision

Viewing changes to breezy/tests/blackbox/test_revno.py

Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import os
22
22
 
23
23
from breezy import tests
 
24
from breezy.errors import NoSuchRevision
24
25
from breezy.tests.matchers import ContainsNoVfsCalls
25
26
 
26
27
 
123
124
        self.assertEqual('', err)
124
125
        self.assertEqual('???\n', out)
125
126
 
 
127
    def test_revno_ghost(self):
 
128
        builder = self.make_branch_builder('branch')
 
129
        builder.start_series()
 
130
        revid = builder.build_snapshot([b'aghost'], [
 
131
            ('add', ('', b'root-id', 'directory', None)),
 
132
            ('add', ('file', b'file-id', 'file', b'content\n'))],
 
133
            revision_id=b'A-id', allow_leftmost_as_ghost=True)
 
134
        builder.finish_series()
 
135
        b = builder.get_branch()
 
136
 
 
137
        def revision_id_to_revno(s, r):
 
138
            raise NoSuchRevision(s, r)
 
139
        self.overrideAttr(type(b), 'revision_id_to_dotted_revno', revision_id_to_revno)
 
140
        self.overrideAttr(type(b), 'revision_id_to_revno', revision_id_to_revno)
 
141
        out, err = self.run_bzr('revno branch')
 
142
        self.assertEqual('', err)
 
143
        self.assertEqual('???\n', out)
 
144
 
126
145
    def test_revno_with_revision(self):
127
146
        wt = self.make_branch_and_tree('.')
128
147
        revid1 = wt.commit('rev1')