Rev 2484: Add a test with a merged revision in http://bzr.arbash-meinel.com/branches/bzr/0.17-dev/log_short_merges_83887

John Arbash Meinel john at arbash-meinel.com
Tue May 8 20:31:41 BST 2007


At http://bzr.arbash-meinel.com/branches/bzr/0.17-dev/log_short_merges_83887

------------------------------------------------------------
revno: 2484
revision-id: john at arbash-meinel.com-20070508193100-64xg2gv8oc40tiri
parent: pqm at pqm.ubuntu.com-20070507175017-mvwcdqzq0w4z36lr
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: log_short_merges_83887
timestamp: Tue 2007-05-08 14:31:00 -0500
message:
  Add a test with a merged revision
  now we need to figure out what it should look like :)
modified:
  bzrlib/tests/test_log.py       testlog.py-20050728115707-1a514809d7d49309
-------------- next part --------------
=== modified file 'bzrlib/tests/test_log.py'
--- a/bzrlib/tests/test_log.py	2007-04-18 22:37:59 +0000
+++ b/bzrlib/tests/test_log.py	2007-05-08 19:31:00 +0000
@@ -285,6 +285,37 @@
         log_contents = logfile.read()
         self.assertEqualDiff(log_contents, '1: Line-Log-Formatte... 2005-11-23 add a\n')
 
+    def test_short_log_with_merges(self):
+        wt = self.make_branch_and_memory_tree('.')
+        wt.lock_write()
+        try:
+            wt.add('')
+            wt.commit('rev-1', rev_id='rev-1',
+                      timestamp=1132586655, timezone=36000,
+                      committer='Joe Foo <joe at foo.com>')
+            wt.commit('rev-merged', rev_id='rev-2a',
+                      timestamp=1132586700, timezone=36000,
+                      committer='Joe Foo <joe at foo.com>')
+            wt.set_parent_ids(['rev-1', 'rev-2a'])
+            wt.branch.set_last_revision_info(1, 'rev-1')
+            wt.commit('rev-2', rev_id='rev-2b',
+                      timestamp=1132586800, timezone=36000,
+                      committer='Joe Foo <joe at foo.com>')
+            logfile = StringIO()
+            formatter = ShortLogFormatter(to_file=logfile)
+            show_log(wt.branch, formatter)
+            logfile.flush()
+            self.assertEqualDiff("""\
+    2 Joe Foo\t2005-11-22
+      rev-2
+
+    1 Joe Foo\t2005-11-22
+      rev-1
+
+""", logfile.getvalue())
+        finally:
+            wt.unlock()
+
     def make_tree_with_commits(self):
         """Create a tree with well-known revision ids"""
         wt = self.make_branch_and_tree('tree1')



More information about the bazaar-commits mailing list