~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Mark Hammond
  • Date: 2008-12-28 05:21:23 UTC
  • mfrom: (3920 +trunk)
  • mto: (3932.1.1 prepare-1.11)
  • mto: This revision was merged to the branch mainline in revision 3937.
  • Revision ID: mhammond@skippinet.com.au-20081228052123-f78xs5sbdkotshwf
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
140
140
        self.assertTrue('branch nick: branch2\n' in log)
141
141
        self.assertTrue('branch nick: branch1\n' not in log)
142
142
 
 
143
    def test_log_nonexistent_revno(self):
 
144
        self._prepare()
 
145
        (out, err) = self.run_bzr_error(args="log -r 1234",
 
146
            error_regexes=["bzr: ERROR: Requested revision: '1234' "
 
147
                "does not exist in branch:"])
 
148
 
 
149
    def test_log_nonexistent_dotted_revno(self):
 
150
        self._prepare()
 
151
        (out, err) = self.run_bzr_error(args="log -r 123.123",
 
152
            error_regexes=["bzr: ERROR: Requested revision: '123.123' "
 
153
                "does not exist in branch:"])
 
154
 
143
155
    def test_log_change_revno(self):
144
156
        self._prepare()
145
157
        expected_log = self.run_bzr("log -r 1")[0]
146
158
        log = self.run_bzr("log -c 1")[0]
147
159
        self.assertEqualDiff(expected_log, log)
148
160
 
 
161
    def test_log_change_nonexistent_revno(self):
 
162
        self._prepare()
 
163
        (out, err) = self.run_bzr_error(args="log -c 1234",
 
164
            error_regexes=["bzr: ERROR: Requested revision: '1234' "
 
165
                "does not exist in branch:"])
 
166
 
 
167
    def test_log_change_nonexistent_dotted_revno(self):
 
168
        self._prepare()
 
169
        (out, err) = self.run_bzr_error(args="log -c 123.123",
 
170
            error_regexes=["bzr: ERROR: Requested revision: '123.123' "
 
171
                "does not exist in branch:"])
 
172
 
149
173
    def test_log_change_single_revno(self):
150
174
        self._prepare()
151
175
        self.run_bzr_error('bzr: ERROR: Option --change does not'
220
244
        self.assertContainsRe(log, r'revno: 3\n')
221
245
 
222
246
 
 
247
class TestLogVerbose(TestCaseWithTransport):
 
248
 
 
249
    def setUp(self):
 
250
        super(TestLogVerbose, self).setUp()
 
251
        tree = self.make_branch_and_tree('.')
 
252
        self.build_tree(['hello.txt'])
 
253
        tree.add('hello.txt')
 
254
        tree.commit(message='message1')
 
255
 
 
256
    def assertUseShortDeltaFormat(self, cmd):
 
257
        log = self.run_bzr(cmd)[0]
 
258
        # Check that we use the short status format
 
259
        self.assertContainsRe(log, '(?m)^A  hello.txt$')
 
260
        self.assertNotContainsRe(log, '(?m)^added:$')
 
261
 
 
262
    def assertUseLongDeltaFormat(self, cmd):
 
263
        log = self.run_bzr(cmd)[0]
 
264
        # Check that we use the long status format
 
265
        self.assertNotContainsRe(log, '(?m)^A  hello.txt$')
 
266
        self.assertContainsRe(log, '(?m)^added:$')
 
267
 
 
268
    def test_log_short_verbose(self):
 
269
        self.assertUseShortDeltaFormat(['log', '--short', '-v'])
 
270
 
 
271
    def test_log_short_verbose_verbose(self):
 
272
        self.assertUseLongDeltaFormat(['log', '--short', '-vv'])
 
273
 
 
274
    def test_log_long_verbose(self):
 
275
        # Check that we use the long status format, ignoring the verbosity
 
276
        # level
 
277
        self.assertUseLongDeltaFormat(['log', '--long', '-v'])
 
278
 
 
279
    def test_log_long_verbose_verbose(self):
 
280
        # Check that we use the long status format, ignoring the verbosity
 
281
        # level
 
282
        self.assertUseLongDeltaFormat(['log', '--long', '-vv'])
 
283
 
 
284
 
223
285
class TestLogMerges(TestCaseWithoutPropsHandler):
224
286
 
225
287
    def _prepare(self):