Rev 5735: (jelmer) Add tests for using log on branches with ghosts in mainline. in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Wed Mar 23 12:41:02 UTC 2011
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 5735 [merge]
revision-id: pqm at pqm.ubuntu.com-20110323124059-jqxxfxum3f6loxdx
parent: pqm at pqm.ubuntu.com-20110323111500-d3u1esqnwwt38wsa
parent: jelmer at samba.org-20110323103454-44jd38ehatutfvxk
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2011-03-23 12:40:59 +0000
message:
(jelmer) Add tests for using log on branches with ghosts in mainline.
(Jelmer Vernooij)
modified:
bzrlib/tests/blackbox/test_log.py test_log.py-20060112090212-78f6ea560c868e24
bzrlib/tests/test_log.py testlog.py-20050728115707-1a514809d7d49309
=== modified file 'bzrlib/tests/blackbox/test_log.py'
--- a/bzrlib/tests/blackbox/test_log.py 2010-07-09 16:16:11 +0000
+++ b/bzrlib/tests/blackbox/test_log.py 2011-03-23 10:34:22 +0000
@@ -19,7 +19,6 @@
from itertools import izip
import os
-import re
from bzrlib import (
branchbuilder,
@@ -29,7 +28,6 @@
tests,
)
from bzrlib.tests import (
- script,
test_log,
)
@@ -924,3 +922,30 @@
self.prepare_tree()
os.chdir("dir1")
self.assertLogRevnos(['dir2', 'file5'], ['5', '3'])
+
+
+class MainlineGhostTests(TestLogWithLogCatcher):
+
+ def setUp(self):
+ super(MainlineGhostTests, self).setUp()
+ tree = self.make_branch_and_tree('')
+ tree.set_parent_ids(["spooky"], allow_leftmost_as_ghost=True)
+ tree.add('')
+ tree.commit('msg1', rev_id='rev1')
+ tree.commit('msg2', rev_id='rev2')
+
+ def test_log_range(self):
+ self.assertLogRevnos(["-r1..2"], ["2", "1"])
+
+ def test_log_norange(self):
+ self.assertLogRevnos([], ["2", "1"])
+
+ def test_log_range_open_begin(self):
+ raise tests.KnownFailure("log with ghosts fails. bug #726466")
+ (stdout, stderr) = self.run_bzr(['log', '-r..2'], retcode=3)
+ self.assertEqual(["2", "1"],
+ [r.revno for r in self.get_captured_revisions()])
+ self.assertEquals("bzr: ERROR: Further revision history missing.", stderr)
+
+ def test_log_range_open_end(self):
+ self.assertLogRevnos(["-r1.."], ["2", "1"])
=== modified file 'bzrlib/tests/test_log.py'
--- a/bzrlib/tests/test_log.py 2011-03-21 12:18:10 +0000
+++ b/bzrlib/tests/test_log.py 2011-03-23 10:34:54 +0000
@@ -117,6 +117,7 @@
branch.tags.set_tag('v1.0', 'rev-3')
return wt
+
class LogCatcher(log.LogFormatter):
"""Pull log messages into a list rather than displaying them.
@@ -1755,6 +1756,7 @@
""")
+
class TestLogExcludeAncestry(tests.TestCaseWithTransport):
def make_branch_with_alternate_ancestries(self, relpath='.'):
More information about the bazaar-commits
mailing list