Rev 4138: (kikuyo) Small improvements to the GNU ChangeLog formatter. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Mar 13 01:01:39 GMT 2009


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

------------------------------------------------------------
revno: 4138
revision-id: pqm at pqm.ubuntu.com-20090313010135-3huetgz68wxrhsb3
parent: pqm at pqm.ubuntu.com-20090312152735-08tf1fguf6b7mpaw
parent: james.westby at canonical.com-20090313001311-qbjce58f0fcke5p4
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2009-03-13 01:01:35 +0000
message:
  (kikuyo) Small improvements to the GNU ChangeLog formatter.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/log.py                  log.py-20050505065812-c40ce11702fe5fb1
    ------------------------------------------------------------
    revno: 4137.1.1
    revision-id: james.westby at canonical.com-20090313001311-qbjce58f0fcke5p4
    parent: pqm at pqm.ubuntu.com-20090312152735-08tf1fguf6b7mpaw
    parent: eof at kiyuko.org-20090312125654-lo1f1y0s9ef0w7mq
    committer: James Westby <james.westby at canonical.com>
    branch nick: jamesw-integration
    timestamp: Fri 2009-03-13 10:13:11 +1000
    message:
      Small improvements to the GNU ChangeLog formatter.
      
      Add NEWS and fix PEP-8 nit.
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/log.py                  log.py-20050505065812-c40ce11702fe5fb1
    ------------------------------------------------------------
    revno: 4129.1.3
    revision-id: eof at kiyuko.org-20090312125654-lo1f1y0s9ef0w7mq
    parent: eof at kiyuko.org-20090312125545-rxltuhw1im92fvma
    committer: Andrea Bolognani <eof at kiyuko.org>
    branch nick: gnu-changelog
    timestamp: Thu 2009-03-12 13:56:54 +0100
    message:
      Don't print an extra line if there are no changes in the delta.
    modified:
      bzrlib/log.py                  log.py-20050505065812-c40ce11702fe5fb1
    ------------------------------------------------------------
    revno: 4129.1.2
    revision-id: eof at kiyuko.org-20090312125545-rxltuhw1im92fvma
    parent: eof at kiyuko.org-20090312125344-sy02m2o640453ha0
    committer: Andrea Bolognani <eof at kiyuko.org>
    branch nick: gnu-changelog
    timestamp: Thu 2009-03-12 13:55:45 +0100
    message:
      The GNU ChangeLog formatter doesn't support tags.
    modified:
      bzrlib/log.py                  log.py-20050505065812-c40ce11702fe5fb1
    ------------------------------------------------------------
    revno: 4129.1.1
    revision-id: eof at kiyuko.org-20090312125344-sy02m2o640453ha0
    parent: pqm at pqm.ubuntu.com-20090312091731-9trx3k1cehgpwhbm
    committer: Andrea Bolognani <eof at kiyuko.org>
    branch nick: gnu-changelog
    timestamp: Thu 2009-03-12 13:53:44 +0100
    message:
      Renamed the ChangeLogLogFormatter class to GnuChangelogLogFormatter.
    modified:
      bzrlib/log.py                  log.py-20050505065812-c40ce11702fe5fb1
=== modified file 'NEWS'
--- a/NEWS	2009-03-12 14:02:53 +0000
+++ b/NEWS	2009-03-13 00:13:11 +0000
@@ -36,6 +36,10 @@
       stackable-format branch with an unstackable-format repository to a
       destination with a default stacking policy.  (Andrew Bennetts)
 
+    * The GNU Changelog formatter is slightly improved in the case where
+      the delta is empty, and now correctly claims not to support tags.
+      (Andrea Bolognani)
+
   DOCUMENTATION:
 
     * The generated manpage now explicitly lists aliases as commands.

=== modified file 'bzrlib/log.py'
--- a/bzrlib/log.py	2009-03-11 08:58:17 +0000
+++ b/bzrlib/log.py	2009-03-13 00:13:11 +0000
@@ -1374,11 +1374,10 @@
         return self.truncate(prefix + " ".join(out).rstrip('\n'), max_chars)
 
 
-class ChangeLogLogFormatter(LogFormatter):
+class GnuChangelogLogFormatter(LogFormatter):
 
     supports_merge_revisions = True
     supports_delta = True
-    supports_tags = True
 
     def log_revision(self, revision):
         """Log a revision, either merged or not."""
@@ -1392,7 +1391,7 @@
         committer_str = revision.rev.committer.replace (' <', '  <')
         to_file.write('%s  %s\n\n' % (date_str,committer_str))
 
-        if revision.delta is not None:
+        if revision.delta is not None and revision.delta.has_changed():
             for c in revision.delta.added + revision.delta.removed + revision.delta.modified:
                 path, = c[:1]
                 to_file.write('\t* %s:\n' % (path,))
@@ -1440,9 +1439,8 @@
                                 'Detailed log format')
 log_formatter_registry.register('line', LineLogFormatter,
                                 'Log format with one line per revision')
-log_formatter_registry.register(
-    'gnu-changelog', ChangeLogLogFormatter,
-    'Format used by GNU ChangeLog files')
+log_formatter_registry.register('gnu-changelog', GnuChangelogLogFormatter,
+                                'Format used by GNU ChangeLog files')
 
 
 def register_formatter(name, formatter):




More information about the bazaar-commits mailing list