Rev 5127: (mbp, for gagern) show first apparent author in gnu changelog in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Apr 1 01:40:34 BST 2010


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5127 [merge]
revision-id: pqm at pqm.ubuntu.com-20100401004031-pc7s84z6ahqunmy2
parent: pqm at pqm.ubuntu.com-20100331004226-11lgm5jnty8y82et
parent: martin.vgagern at gmx.net-20100325082735-f6q4g558o0m0uzlo
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2010-04-01 01:40:31 +0100
message:
  (mbp, for gagern) show first apparent author in gnu changelog
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/log.py                  log.py-20050505065812-c40ce11702fe5fb1
  bzrlib/tests/test_log.py       testlog.py-20050728115707-1a514809d7d49309
=== modified file 'NEWS'
--- a/NEWS	2010-03-30 04:09:15 +0000
+++ b/NEWS	2010-04-01 00:40:31 +0000
@@ -187,6 +187,9 @@
   better with sudo.
   (Parth Malwankar, #376388)
 
+* Use first apparent author not committer in GNU Changelog format.
+  (Martin von Gagern, #513322)
+
 API Changes
 ***********
 

=== modified file 'bzrlib/log.py'
--- a/bzrlib/log.py	2010-03-31 00:42:26 +0000
+++ b/bzrlib/log.py	2010-04-01 00:40:31 +0000
@@ -1683,7 +1683,7 @@
                                self.show_timezone,
                                date_fmt='%Y-%m-%d',
                                show_offset=False)
-        committer_str = revision.rev.committer.replace (' <', '  <')
+        committer_str = revision.rev.get_apparent_authors()[0].replace (' <', '  <')
         to_file.write('%s  %s\n\n' % (date_str,committer_str))
 
         if revision.delta is not None and revision.delta.has_changed():

=== modified file 'bzrlib/tests/test_log.py'
--- a/bzrlib/tests/test_log.py	2010-02-23 07:43:11 +0000
+++ b/bzrlib/tests/test_log.py	2010-03-25 08:14:04 +0000
@@ -877,6 +877,43 @@
             formatter_kwargs=dict(levels=0))
 
 
+class TestGnuChangelogFormatter(TestCaseForLogFormatter):
+
+    def test_gnu_changelog(self):
+        wt = self.make_standard_commit('nicky', authors=[])
+        self.assertFormatterResult('''\
+2005-11-22  Lorem Ipsum  <test at example.com>
+
+\tadd a
+
+''',
+            wt.branch, log.GnuChangelogLogFormatter)
+
+    def test_with_authors(self):
+        wt = self.make_standard_commit('nicky',
+            authors=['Fooa Fooz <foo at example.com>',
+                     'Bari Baro <bar at example.com>'])
+        self.assertFormatterResult('''\
+2005-11-22  Fooa Fooz  <foo at example.com>
+
+\tadd a
+
+''',
+            wt.branch, log.GnuChangelogLogFormatter)
+
+    def test_verbose(self):
+        wt = self.make_standard_commit('nicky')
+        self.assertFormatterResult('''\
+2005-11-22  John Doe  <jdoe at example.com>
+
+\t* a:
+
+\tadd a
+
+''',
+            wt.branch, log.GnuChangelogLogFormatter,
+            show_log_kwargs=dict(verbose=True))
+
 class TestGetViewRevisions(tests.TestCaseWithTransport, TestLogMixin):
 
     def _get_view_revisions(self, *args, **kwargs):




More information about the bazaar-commits mailing list