~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testlog.py

Fix regression of 'bzr log -v' - it wasn't showing changed files at all.  (#4676)

Show diffs side-by-side

added added

removed removed

Lines of Context:
173
173
        committed_msg = lf.logs[0].rev.message
174
174
        self.log("escaped commit message: %r", committed_msg)
175
175
        self.assert_(msg == committed_msg)
 
176
 
 
177
    def test_verbose_log(self):
 
178
        """Verbose log includes changed files
 
179
        
 
180
        bug #4676
 
181
        """
 
182
        b = Branch.initialize('.')
 
183
        self.build_tree(['a'])
 
184
        wt = b.working_tree()
 
185
        b.add('a')
 
186
        # XXX: why does a longer nick show up?
 
187
        b.nick = 'test_verbose_log'
 
188
        wt.commit(message='add a', 
 
189
                  timestamp=1132711707, 
 
190
                  timezone=36000,
 
191
                  committer='Lorem Ipsum <test@example.com>')
 
192
        logfile = file('out.tmp', 'w+')
 
193
        formatter = LongLogFormatter(to_file=logfile)
 
194
        show_log(b, formatter, verbose=True)
 
195
        logfile.flush()
 
196
        logfile.seek(0)
 
197
        log_contents = logfile.read()
 
198
        self.assertEqualDiff(log_contents, '''\
 
199
------------------------------------------------------------
 
200
revno: 1
 
201
committer: Lorem Ipsum <test@example.com>
 
202
branch nick: test_verbose_log
 
203
timestamp: Wed 2005-11-23 12:08:27 +1000
 
204
message:
 
205
  add a
 
206
added:
 
207
  a
 
208
''')