/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/blackbox/test_revno.py

  • Committer: Jelmer Vernooij
  • Date: 2012-01-02 14:27:58 UTC
  • mfrom: (6410 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6441.
  • Revision ID: jelmer@samba.org-20120102142758-hl7xrn7m5hjhecdv
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import os
22
22
 
23
23
from bzrlib import tests
 
24
from bzrlib.tests.matchers import ContainsNoVfsCalls
 
25
 
24
26
 
25
27
class TestRevno(tests.TestCaseWithTransport):
26
28
 
136
138
        self.assertEqual(
137
139
            'bzr: ERROR: --tree and --revision can not be used together\n',
138
140
            err)
 
141
 
 
142
 
 
143
class TestSmartServerRevno(tests.TestCaseWithTransport):
 
144
 
 
145
    def test_simple_branch_revno(self):
 
146
        self.setup_smart_server_with_call_log()
 
147
        t = self.make_branch_and_tree('branch')
 
148
        self.build_tree_contents([('branch/foo', 'thecontents')])
 
149
        t.add("foo")
 
150
        revid = t.commit("message")
 
151
        self.reset_smart_call_log()
 
152
        out, err = self.run_bzr(['revno', self.get_url('branch')])
 
153
        # This figure represent the amount of work to perform this use case. It
 
154
        # is entirely ok to reduce this number if a test fails due to rpc_count
 
155
        # being too low. If rpc_count increases, more network roundtrips have
 
156
        # become necessary for this use case. Please do not adjust this number
 
157
        # upwards without agreement from bzr's network support maintainers.
 
158
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
 
159
        self.assertLength(1, self.hpss_connections)
 
160
        self.assertLength(6, self.hpss_calls)
 
161
 
 
162
    def test_simple_branch_revno_lookup(self):
 
163
        self.setup_smart_server_with_call_log()
 
164
        t = self.make_branch_and_tree('branch')
 
165
        self.build_tree_contents([('branch/foo', 'thecontents')])
 
166
        t.add("foo")
 
167
        revid1 = t.commit("message")
 
168
        revid2 = t.commit("message")
 
169
        self.reset_smart_call_log()
 
170
        out, err = self.run_bzr(['revno', '-rrevid:' + revid1,
 
171
            self.get_url('branch')])
 
172
        # This figure represent the amount of work to perform this use case. It
 
173
        # is entirely ok to reduce this number if a test fails due to rpc_count
 
174
        # being too low. If rpc_count increases, more network roundtrips have
 
175
        # become necessary for this use case. Please do not adjust this number
 
176
        # upwards without agreement from bzr's network support maintainers.
 
177
        self.assertLength(5, self.hpss_calls)
 
178
        self.assertLength(1, self.hpss_connections)
 
179
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)