~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2011-11-25 17:54:52 UTC
  • mfrom: (6303 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6321.
  • Revision ID: jelmer@samba.org-20111125175452-v0uwwxqcp97tzuzv
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

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