~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2008-09-24 13:43:48 UTC
  • mto: This revision was merged to the branch mainline in revision 3737.
  • Revision ID: v.ladeuil+lp@free.fr-20080924134348-s1tz1xjuxppe2caw
Fix bug #248427 by adding a --change option to log.

* bzrlib/tests/blackbox/test_log.py:
(TestLog.test_log_change_revno,
TestLog.test_log_change_single_revno,
TestLog.test_log_change_incompatible_with_revision):
Add tests specific to log --change behaviour.

* bzrlib/builtins.py:
(cmd_log): Add a 'change' option with a behaviour tailored to log.

Show diffs side-by-side

added added

removed removed

Lines of Context:
138
138
        self.assertTrue('revno: 2\n' not in log)
139
139
        self.assertTrue('branch nick: branch2\n' in log)
140
140
        self.assertTrue('branch nick: branch1\n' not in log)
141
 
        
 
141
 
 
142
    def test_log_change_revno(self):
 
143
        self._prepare()
 
144
        expected_log = self.run_bzr("log -r 1")[0]
 
145
        log = self.run_bzr("log -c 1")[0]
 
146
        self.assertEqualDiff(expected_log, log)
 
147
 
 
148
    def test_log_change_single_revno(self):
 
149
        self._prepare()
 
150
        self.run_bzr_error('bzr: ERROR: Option --change does not'
 
151
                           ' accept revision ranges',
 
152
                           ['log', '--change', '2..3'])
 
153
 
 
154
    def test_log_change_incompatible_with_revision(self):
 
155
        self._prepare()
 
156
        self.run_bzr_error('bzr: ERROR: --revision and --change'
 
157
                           ' are mutually exclusive',
 
158
                           ['log', '--change', '2', '--revision', '3'])
 
159
 
142
160
    def test_log_nonexistent_file(self):
143
161
        # files that don't exist in either the basis tree or working tree
144
162
        # should give an error