Rev 5899: (mbp) In log output, in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu May 19 14:45:49 UTC 2011


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

------------------------------------------------------------
revno: 5899 [merge]
revision-id: pqm at pqm.ubuntu.com-20110519144540-rdtq66i05j07d8sb
parent: pqm at pqm.ubuntu.com-20110519132257-mssx0kli5k6db7r5
parent: nmb at wartburg.edu-20110519014212-d48xtqqeauq164al
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2011-05-19 14:45:40 +0000
message:
  (mbp) In log output,
   allow the author field width to grow as the line gets longer. (Neil
   Martinsen-Burrell)
modified:
  bzrlib/log.py                  log.py-20050505065812-c40ce11702fe5fb1
  bzrlib/tests/blackbox/test_logformats.py test_logformats.py-20060216104208-ba5a16c83480b7e4
  doc/en/release-notes/bzr-2.4.txt bzr2.4.txt-20110114053217-k7ym9jfz243fddjm-1
=== modified file 'bzrlib/log.py'
--- a/bzrlib/log.py	2011-05-19 09:32:38 +0000
+++ b/bzrlib/log.py	2011-05-19 14:45:40 +0000
@@ -1743,7 +1743,10 @@
         if revno:
             # show revno only when is not None
             out.append("%s:" % revno)
-        out.append(self.truncate(self.short_author(rev), 20))
+        if max_chars is not None:
+            out.append(self.truncate(self.short_author(rev), (max_chars+3)/4))
+        else:
+            out.append(self.short_author(rev))
         out.append(self.date_string(rev))
         if len(rev.parent_ids) > 1:
             out.append('[merge]')

=== modified file 'bzrlib/tests/blackbox/test_logformats.py'
--- a/bzrlib/tests/blackbox/test_logformats.py	2009-05-05 15:31:34 +0000
+++ b/bzrlib/tests/blackbox/test_logformats.py	2011-05-19 01:37:00 +0000
@@ -107,3 +107,18 @@
 
 """
         self.assertEqualDiff(expected, log)
+
+    def test_logformat_line_wide(self):
+        """Author field should get larger for column widths over 80"""
+        wt = self.make_branch_and_tree('.')
+        wt.commit('revision with a long author', committer='Person with' 
+                  ' long name SENTINEL')
+        log, err = self.run_bzr('log --line')
+        self.assertNotContainsString(log, 'SENTINEL')
+        self.overrideEnv('BZR_COLUMNS', '116')
+        log, err = self.run_bzr('log --line')
+        self.assertContainsString(log, 'SENT...')
+        self.overrideEnv('BZR_COLUMNS', '0')
+        log, err = self.run_bzr('log --line')
+        self.assertContainsString(log, 'SENTINEL')
+

=== modified file 'doc/en/release-notes/bzr-2.4.txt'
--- a/doc/en/release-notes/bzr-2.4.txt	2011-05-18 12:18:39 +0000
+++ b/doc/en/release-notes/bzr-2.4.txt	2011-05-19 14:45:40 +0000
@@ -43,6 +43,10 @@
   more efficiently.  For a simple branch it reduces the number of
   round-trips by about 20%.  (Andrew Bennetts)
 
+* ``bzr log --line`` scales the width of the author field with the size of
+  the line.  This means that the full author name is shown when the
+  environment variable BZR_COLUMNS=0.  (Neil Martinsen-Burrell)
+
 * ``bzr pull`` now properly triggers the fast
   ``CHKInventory.iter_changes`` rather than the slow generic
   inter-Inventory changes. It used to use a ``DirStateRevisionTree`` as




More information about the bazaar-commits mailing list