~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Packman
  • Date: 2011-12-19 10:37:57 UTC
  • mto: This revision was merged to the branch mainline in revision 6394.
  • Revision ID: martin.packman@canonical.com-20111219103757-b85as9n9pb7e6qvn
Add tests for deprecated unicode wrapper functions in win32utils

Show diffs side-by-side

added added

removed removed

Lines of Context:
117
117
        out, err = self.run_bzr('revno --tree checkout_b')
118
118
        self.assertEqual('', err)
119
119
        self.assertEqual('???\n', out)
 
120
 
 
121
    def test_revno_with_revision(self):
 
122
        wt = self.make_branch_and_tree('.')
 
123
        revid1 = wt.commit('rev1')
 
124
        revid2 = wt.commit('rev2')
 
125
 
 
126
        out, err = self.run_bzr('revno -r-2 .')
 
127
        self.assertEqual('1\n', out)
 
128
 
 
129
        out, err = self.run_bzr('revno -rrevid:%s .' % revid1)
 
130
        self.assertEqual('1\n', out)
 
131
 
 
132
    def test_revno_and_tree_mutually_exclusive(self):
 
133
        wt = self.make_branch_and_tree('.')
 
134
        out, err = self.run_bzr('revno -r-2 --tree .', retcode=3)
 
135
        self.assertEqual('', out)
 
136
        self.assertEqual(
 
137
            'bzr: ERROR: --tree and --revision can not be used together\n',
 
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)