Rev 2628: Merge Kent's work for left alignment of log output for merge only revisions in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Jul 19 07:22:14 BST 2007


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

------------------------------------------------------------
revno: 2628
revision-id: pqm at pqm.ubuntu.com-20070719062212-492i9t2j91oiwjxy
parent: pqm at pqm.ubuntu.com-20070719011840-ewngzmxi6tct4vs3
parent: ian.clatworthy at internode.on.net-20070719034054-5yccb10yeari6b7u
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2007-07-19 07:22:12 +0100
message:
  Merge Kent's work for left alignment of log output for merge only revisions
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/log.py                  log.py-20050505065812-c40ce11702fe5fb1
  bzrlib/tests/blackbox/test_log.py test_log.py-20060112090212-78f6ea560c868e24
    ------------------------------------------------------------
    revno: 2627.1.1
    merged: ian.clatworthy at internode.on.net-20070719034054-5yccb10yeari6b7u
    parent: pqm at pqm.ubuntu.com-20070719011840-ewngzmxi6tct4vs3
    parent: kent at ispirenetworks.com-20070707032028-abmivg21e6bdva3c
    committer: Ian Clatworthy <ian.clatworthy at internode.on.net>
    branch nick: ianc-integration
    timestamp: Thu 2007-07-19 13:40:54 +1000
    message:
      Merge Kent's work for left alignment of log output for merge only revisions
    ------------------------------------------------------------
    revno: 2466.8.1.3.3
    merged: kent at ispirenetworks.com-20070707032028-abmivg21e6bdva3c
    parent: warthog618 at gmail.com-20070507095504-h218h9pfkcftmaqt
    committer: Kent Gibson <kent at ispirenetworks.com>
    branch nick: log_range
    timestamp: Sat 2007-07-07 11:20:28 +0800
    message:
      Fix JAM's review comments for left align patch
    ------------------------------------------------------------
    revno: 2466.8.1.3.2
    merged: warthog618 at gmail.com-20070507095504-h218h9pfkcftmaqt
    parent: warthog618 at gmail.com-20070504104926-dmz6x2gw7ydb8i7p
    committer: Kent Gibson <warthog618 at gmail.com>
    branch nick: log_range
    timestamp: Mon 2007-05-07 17:55:04 +0800
    message:
      shift log output with only merge revisions to the left margin
=== modified file 'NEWS'
--- a/NEWS	2007-07-19 01:18:40 +0000
+++ b/NEWS	2007-07-19 03:40:54 +0000
@@ -34,6 +34,9 @@
       branch revision history for ui display unless -v is supplied.
       (Robert Collins)
 
+    * ``bzr log -rA..B`` output shifted to the left margin if the log only 
+      contains merge revisions. (Kent Gibson) 
+
   LIBRARY API BREAKS:
 
     * Deprecated dictionary ``bzrlib.option.SHORT_OPTIONS`` removed.

=== modified file 'bzrlib/log.py'
--- a/bzrlib/log.py	2007-07-04 03:12:37 +0000
+++ b/bzrlib/log.py	2007-07-19 03:40:54 +0000
@@ -42,7 +42,7 @@
 
 In verbose mode we show a summary of what changed in each particular
 revision.  Note that this is the delta for changes in that revision
-relative to its mainline parent, not the delta relative to the last
+relative to its left-most parent, not the delta relative to the last
 logged revision.  So for example if you ask for a verbose log of
 changes touching hello.c you will get a list of those revisions also
 listing other things that were changed in the same revision, but not
@@ -243,6 +243,13 @@
                                                          mainline_revs,
                                                          view_revisions)
 
+    # rebase merge_depth - unless there are no revisions or 
+    # either the first or last revision have merge_depth = 0.
+    if view_revisions and view_revisions[0][2] and view_revisions[-1][2]:
+        min_depth = min([d for r,n,d in view_revisions])
+        if min_depth != 0:
+            view_revisions = [(r,n,d-min_depth) for r,n,d in view_revisions]
+        
     rev_tag_dict = {}
     generate_tags = getattr(lf, 'supports_tags', False)
     if generate_tags:
@@ -560,7 +567,7 @@
     - supports_delta must be True if this log formatter supports delta.
         Otherwise the delta attribute may not be populated.
     - supports_merge_revisions must be True if this log formatter supports 
-        merge revisions.  If not, only revisions mainline revisions (those 
+        merge revisions.  If not, only mainline revisions (those 
         with merge_depth == 0) will be passed to the formatter.
     - supports_tags must be True if this log formatter supports tags.
         Otherwise the tags attribute may not be populated.

=== modified file 'bzrlib/tests/blackbox/test_log.py'
--- a/bzrlib/tests/blackbox/test_log.py	2007-07-05 00:29:29 +0000
+++ b/bzrlib/tests/blackbox/test_log.py	2007-07-19 03:40:54 +0000
@@ -155,7 +155,7 @@
         log = self.run_bzr("log -r-1")[0]
         self.assertContainsRe(log, r'    tags: tag1')
         log = self.run_bzr("log -r3.1.1")[0]
-        self.assertContainsRe(log, r'    tags: tag1')
+        self.assertContainsRe(log, r'tags: tag1')
 
     def test_log_limit(self):
         self._prepare()
@@ -243,32 +243,32 @@
         out,err = self.run_bzr('log -r1.1.2')
         # the log will look something like:
 #        self.assertEqual("""\
+#------------------------------------------------------------
+#revno: 1.1.2  
+#committer: Robert Collins <foo at example.com>
+#branch nick: child
+#timestamp: Tue 2006-03-28 22:31:40 +1100
+#message:
+#  merge branch 2
 #    ------------------------------------------------------------
-#    revno: 1.1.2  
+#    revno: 1.1.1.1
 #    committer: Robert Collins <foo at example.com>
-#    branch nick: child
+#    branch nick: smallerchild
 #    timestamp: Tue 2006-03-28 22:31:40 +1100
 #    message:
-#      merge branch 2
-#        ------------------------------------------------------------
-#        revno: 1.1.1.1
-#        committer: Robert Collins <foo at example.com>
-#        branch nick: smallerchild
-#        timestamp: Tue 2006-03-28 22:31:40 +1100
-#        message:
-#          branch 2
+#      branch 2
 #""", out)
         # but we dont have a nice pattern matcher hooked up yet, so:
         # we check for the indenting of the commit message and the 
         # revision numbers 
         self.assertTrue('revno: 2' not in out)
         self.assertTrue('  merge branch 1' not in out)
-        self.assertTrue('    revno: 1.1.2' in out)
-        self.assertTrue('      merge branch 2' in out)
-        self.assertTrue('        revno: 1.1.1.1' in out)
-        self.assertTrue('          branch 2' in out)
-        self.assertTrue('    revno: 1.1.1\n' not in out)
-        self.assertTrue('      branch 1' not in out)
+        self.assertTrue('revno: 1.1.2' in out)
+        self.assertTrue('  merge branch 2' in out)
+        self.assertTrue('    revno: 1.1.1.1' in out)
+        self.assertTrue('      branch 2' in out)
+        self.assertTrue('revno: 1.1.1\n' not in out)
+        self.assertTrue('  branch 1' not in out)
         self.assertTrue('revno: 1\n' not in out)
         self.assertTrue('  first post' not in out)
         self.assertEqual('', err)
@@ -278,39 +278,39 @@
         out,err = self.run_bzr('log -r1.1.1..1.1.2')
         # the log will look something like:
 #        self.assertEqual("""\
-#    ------------------------------------------------------------
-#    revno: 1.1.2  
-#    committer: Robert Collins <foo at example.com>
-#    branch nick: child
-#    timestamp: Tue 2006-03-28 22:31:40 +1100
-#    message:
-#      merge branch 2
-#        ------------------------------------------------------------
-#        revno: 1.1.1.1
-#        committer: Robert Collins <foo at example.com>
-#        branch nick: smallerchild
-#        timestamp: Tue 2006-03-28 22:31:40 +1100
-#        message:
-#          branch 2
-#    ------------------------------------------------------------
-#    revno: 1.1.1
-#    committer: Robert Collins <foo at example.com>
-#    branch nick: child
-#    timestamp: Tue 2006-03-28 22:31:40 +1100
-#    message:
-#      branch 1
+#------------------------------------------------------------
+#revno: 1.1.2  
+#committer: Robert Collins <foo at example.com>
+#branch nick: child
+#timestamp: Tue 2006-03-28 22:31:40 +1100
+#message:
+#  merge branch 2
+#    ------------------------------------------------------------
+#    revno: 1.1.1.1
+#    committer: Robert Collins <foo at example.com>
+#    branch nick: smallerchild
+#    timestamp: Tue 2006-03-28 22:31:40 +1100
+#    message:
+#      branch 2
+#------------------------------------------------------------
+#revno: 1.1.1
+#committer: Robert Collins <foo at example.com>
+#branch nick: child
+#timestamp: Tue 2006-03-28 22:31:40 +1100
+#message:
+#  branch 1
 #""", out)
         # but we dont have a nice pattern matcher hooked up yet, so:
         # we check for the indenting of the commit message and the 
         # revision numbers 
         self.assertTrue('revno: 2' not in out)
         self.assertTrue('  merge branch 1' not in out)
-        self.assertTrue('    revno: 1.1.2' in out)
-        self.assertTrue('      merge branch 2' in out)
-        self.assertTrue('        revno: 1.1.1.1' in out)
-        self.assertTrue('          branch 2' in out)
-        self.assertTrue('    revno: 1.1.1' in out)
-        self.assertTrue('      branch 1' in out)
+        self.assertTrue('revno: 1.1.2' in out)
+        self.assertTrue('  merge branch 2' in out)
+        self.assertTrue('    revno: 1.1.1.1' in out)
+        self.assertTrue('      branch 2' in out)
+        self.assertTrue('revno: 1.1.1' in out)
+        self.assertTrue('  branch 1' in out)
         self.assertTrue('revno: 1\n' not in out)
         self.assertTrue('  first post' not in out)
         self.assertEqual('', err)




More information about the bazaar-commits mailing list