Rev 5185: (vila) Various test cleanups and copyright updates in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Mon Apr 26 17:50:38 BST 2010
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 5185 [merge]
revision-id: pqm at pqm.ubuntu.com-20100426165034-e7tdcndfb0jlr11e
parent: pqm at pqm.ubuntu.com-20100424165450-2jfbk8ta0hhznynx
parent: v.ladeuil+lp at free.fr-20100426135213-a1m8r6tq1zv048pg
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2010-04-26 17:50:34 +0100
message:
(vila) Various test cleanups and copyright updates
modified:
bzrlib/ignores.py ignores.py-20060712153832-2von9l0t7p43ixsv-1
bzrlib/merge3.py merge3.py-20050704130834-bf0597094828a2e1
bzrlib/plugins/launchpad/lp_propose.py lp_submit.py-20100120065117-penrmqruf596pui6-1
bzrlib/repofmt/knitrepo.py knitrepo.py-20070206081537-pyy4a00xdas0j4pf-1
bzrlib/repofmt/weaverepo.py presplitout.py-20070125045333-wfav3tsh73oxu3zk-1
bzrlib/tests/blackbox/__init__.py __init__.py-20051128053524-eba30d8255e08dc3
bzrlib/tests/blackbox/test_pack.py test_pack.py-20070712120702-0c7585lh56p894mo-1
bzrlib/tests/per_repository_reference/test_default_stacking.py test_default_stackin-20090311055345-9ajahgm58oq3wh6h-1
bzrlib/tests/test_delta.py test_delta.py-20070110134455-sqpd1y7mbjndelxf-1
bzrlib/tests/test_merge3.py merge3.py-20050704130834-556689114c89e6f2
bzrlib/tests/test_ui.py test_ui.py-20051130162854-458e667a7414af09
=== modified file 'bzrlib/ignores.py'
--- a/bzrlib/ignores.py 2010-04-22 12:54:41 +0000
+++ b/bzrlib/ignores.py 2010-04-26 13:51:08 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2006 Canonical Ltd
+# Copyright (C) 2006-2010 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -59,7 +59,7 @@
# Otherwise go though line by line and pick out the 'good'
# decodable lines
lines = ignore_file.split('\n')
- unicode_lines = []
+ unicode_lines = []
for line_number, line in enumerate(lines):
try:
unicode_lines.append(line.decode('utf-8'))
@@ -67,7 +67,7 @@
# report error about line (idx+1)
warning('.bzrignore: On Line #%d, malformed utf8 character. '
'Ignoring line.' % (line_number+1))
-
+
# Append each line to ignore list if it's not a comment line
for line in unicode_lines:
line = line.rstrip('\r\n')
=== modified file 'bzrlib/merge3.py'
--- a/bzrlib/merge3.py 2010-04-19 05:41:54 +0000
+++ b/bzrlib/merge3.py 2010-04-26 13:51:08 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2005 Canonical Ltd
+# Copyright (C) 2005-2010 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -18,10 +18,11 @@
# mbp: "you know that thing where cvs gives you conflict markers?"
# s: "i hate that."
-
-from bzrlib.errors import CantReprocessAndShowBase
-import bzrlib.patiencediff
-from bzrlib.textfile import check_text_lines
+from bzrlib import (
+ errors,
+ patiencediff,
+ textfile,
+ )
def intersect(ra, rb):
@@ -81,9 +82,9 @@
objects.
"""
if not allow_objects:
- check_text_lines(base)
- check_text_lines(a)
- check_text_lines(b)
+ textfile.check_text_lines(base)
+ textfile.check_text_lines(a)
+ textfile.check_text_lines(b)
self.base = base
self.a = a
self.b = b
@@ -107,7 +108,7 @@
elif self.a[0].endswith('\r'):
newline = '\r'
if base_marker and reprocess:
- raise CantReprocessAndShowBase()
+ raise errors.CantReprocessAndShowBase()
if name_a:
start_marker = start_marker + ' ' + name_a
if name_b:
@@ -298,7 +299,7 @@
def _refine_cherrypick_conflict(self, zstart, zend, astart, aend, bstart, bend):
"""When cherrypicking b => a, ignore matches with b and base."""
# Do not emit regions which match, only regions which do not match
- matches = bzrlib.patiencediff.PatienceSequenceMatcher(None,
+ matches = patiencediff.PatienceSequenceMatcher(None,
self.base[zstart:zend], self.b[bstart:bend]).get_matching_blocks()
last_base_idx = 0
last_b_idx = 0
@@ -348,7 +349,7 @@
type, iz, zmatch, ia, amatch, ib, bmatch = region
a_region = self.a[ia:amatch]
b_region = self.b[ib:bmatch]
- matches = bzrlib.patiencediff.PatienceSequenceMatcher(
+ matches = patiencediff.PatienceSequenceMatcher(
None, a_region, b_region).get_matching_blocks()
next_a = ia
next_b = ib
@@ -379,9 +380,9 @@
"""
ia = ib = 0
- amatches = bzrlib.patiencediff.PatienceSequenceMatcher(
+ amatches = patiencediff.PatienceSequenceMatcher(
None, self.base, self.a).get_matching_blocks()
- bmatches = bzrlib.patiencediff.PatienceSequenceMatcher(
+ bmatches = patiencediff.PatienceSequenceMatcher(
None, self.base, self.b).get_matching_blocks()
len_a = len(amatches)
len_b = len(bmatches)
@@ -434,9 +435,9 @@
def find_unconflicted(self):
"""Return a list of ranges in base that are not conflicted."""
- am = bzrlib.patiencediff.PatienceSequenceMatcher(
+ am = patiencediff.PatienceSequenceMatcher(
None, self.base, self.a).get_matching_blocks()
- bm = bzrlib.patiencediff.PatienceSequenceMatcher(
+ bm = patiencediff.PatienceSequenceMatcher(
None, self.base, self.b).get_matching_blocks()
unc = []
=== modified file 'bzrlib/plugins/launchpad/lp_propose.py'
--- a/bzrlib/plugins/launchpad/lp_propose.py 2010-04-21 08:46:15 +0000
+++ b/bzrlib/plugins/launchpad/lp_propose.py 2010-04-26 13:51:08 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2009, 2010 Canonical Ltd
+# Copyright (C) 2010 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -20,9 +20,9 @@
from bzrlib import (
errors,
+ hooks,
msgeditor,
)
-from bzrlib.hooks import HookPoint, Hooks
from bzrlib.plugins.launchpad import (
lp_api,
lp_registration,
@@ -31,19 +31,19 @@
from lazr.restfulclient import errors as restful_errors
-class ProposeMergeHooks(Hooks):
+class ProposeMergeHooks(hooks.Hooks):
"""Hooks for proposing a merge on Launchpad."""
def __init__(self):
- Hooks.__init__(self)
+ hooks.Hooks.__init__(self)
self.create_hook(
- HookPoint(
+ hooks.HookPoint(
'get_prerequisite',
"Return the prerequisite branch for proposing as merge.",
(2, 1), None),
)
self.create_hook(
- HookPoint(
+ hooks.HookPoint(
'merge_proposal_body',
"Return an initial body for the merge proposal message.",
(2, 1), None),
=== modified file 'bzrlib/repofmt/knitrepo.py'
--- a/bzrlib/repofmt/knitrepo.py 2010-03-24 14:35:25 +0000
+++ b/bzrlib/repofmt/knitrepo.py 2010-04-26 13:51:08 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2006, 2007 Canonical Ltd
+# Copyright (C) 2007-2010 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -24,6 +24,7 @@
lockdir,
osutils,
revision as _mod_revision,
+ trace,
transactions,
versionedfile,
xml5,
@@ -42,7 +43,6 @@
RepositoryFormat,
RootCommitBuilder,
)
-from bzrlib.trace import mutter, mutter_callsite
class _KnitParentsProvider(object):
@@ -342,7 +342,7 @@
:param shared: If true the repository will be initialized as a shared
repository.
"""
- mutter('creating repository in %s.', a_bzrdir.transport.base)
+ trace.mutter('creating repository in %s.', a_bzrdir.transport.base)
dirs = ['knits']
files = []
utf8_files = [('format', self.get_format_string())]
=== modified file 'bzrlib/repofmt/weaverepo.py'
--- a/bzrlib/repofmt/weaverepo.py 2010-03-24 14:35:25 +0000
+++ b/bzrlib/repofmt/weaverepo.py 2010-04-26 13:51:08 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd
+# Copyright (C) 2007-2010 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -39,6 +39,7 @@
lockdir,
osutils,
revision as _mod_revision,
+ trace,
urlutils,
versionedfile,
weave,
@@ -53,7 +54,6 @@
RepositoryFormat,
)
from bzrlib.store.text import TextStore
-from bzrlib.trace import mutter
from bzrlib.tuned_gzip import GzipFile, bytes_to_gzip
from bzrlib.versionedfile import (
AbsentContentFactory,
@@ -106,7 +106,8 @@
def _all_possible_ids(self):
"""Return all the possible revisions that we could find."""
if 'evil' in debug.debug_flags:
- mutter_callsite(3, "_all_possible_ids scales with size of history.")
+ trace.mutter_callsite(
+ 3, "_all_possible_ids scales with size of history.")
return [key[-1] for key in self.inventories.keys()]
@needs_read_lock
@@ -199,7 +200,8 @@
def _all_possible_ids(self):
"""Return all the possible revisions that we could find."""
if 'evil' in debug.debug_flags:
- mutter_callsite(3, "_all_possible_ids scales with size of history.")
+ trace.mutter_callsite(
+ 3, "_all_possible_ids scales with size of history.")
return [key[-1] for key in self.inventories.keys()]
@needs_read_lock
@@ -286,7 +288,7 @@
weavefile.write_weave_v5(weave.Weave(), sio)
empty_weave = sio.getvalue()
- mutter('creating repository in %s.', a_bzrdir.transport.base)
+ trace.mutter('creating repository in %s.', a_bzrdir.transport.base)
# FIXME: RBC 20060125 don't peek under the covers
# NB: no need to escape relative paths that are url safe.
@@ -526,7 +528,7 @@
weavefile.write_weave_v5(weave.Weave(), sio)
empty_weave = sio.getvalue()
- mutter('creating repository in %s.', a_bzrdir.transport.base)
+ trace.mutter('creating repository in %s.', a_bzrdir.transport.base)
dirs = ['revision-store', 'weaves']
files = [('inventory.weave', StringIO(empty_weave)),
]
=== modified file 'bzrlib/tests/blackbox/__init__.py'
--- a/bzrlib/tests/blackbox/__init__.py 2010-03-25 09:39:03 +0000
+++ b/bzrlib/tests/blackbox/__init__.py 2010-04-26 13:51:08 +0000
@@ -23,7 +23,7 @@
"""
-from bzrlib.tests import TestCaseWithTransport
+from bzrlib import tests
def load_tests(basic_tests, module, loader):
@@ -123,7 +123,7 @@
return suite
-class ExternalBase(TestCaseWithTransport):
+class ExternalBase(tests.TestCaseWithTransport):
def check_output(self, output, *args):
"""Verify that the expected output matches what bzr says.
=== modified file 'bzrlib/tests/blackbox/test_pack.py'
--- a/bzrlib/tests/blackbox/test_pack.py 2010-03-25 08:20:15 +0000
+++ b/bzrlib/tests/blackbox/test_pack.py 2010-04-26 13:51:08 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Canonical Ltd
+# Copyright (C) 2007, 2009, 2010 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -18,11 +18,10 @@
"""Tests of the 'bzr pack' command."""
import os
-from bzrlib.tests.blackbox import ExternalBase
-from bzrlib.workingtree import WorkingTree
-
-
-class TestPack(ExternalBase):
+from bzrlib import tests
+
+
+class TestPack(tests.TestCaseWithTransport):
def _make_versioned_file(self, path, line_prefix='line', total_lines=10):
self._make_file(path, line_prefix, total_lines, versioned=True)
=== modified file 'bzrlib/tests/per_repository_reference/test_default_stacking.py'
--- a/bzrlib/tests/per_repository_reference/test_default_stacking.py 2010-04-16 02:51:37 +0000
+++ b/bzrlib/tests/per_repository_reference/test_default_stacking.py 2010-04-26 13:51:08 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Canonical Ltd
+# Copyright (C) 2009, 2010 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,10 +15,10 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from bzrlib.tests.per_repository import TestCaseWithRepository
-
-
-class TestDefaultStackingPolicy(TestCaseWithRepository):
+from bzrlib.tests import per_repository
+
+
+class TestDefaultStackingPolicy(per_repository.TestCaseWithRepository):
def test_sprout_to_smart_server_stacking_policy_handling(self):
"""Obey policy where possible, ignore otherwise."""
=== modified file 'bzrlib/tests/test_delta.py'
--- a/bzrlib/tests/test_delta.py 2010-03-30 17:40:31 +0000
+++ b/bzrlib/tests/test_delta.py 2010-04-26 13:51:08 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Canonical Ltd
+# Copyright (C) 2007-2010 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
=== modified file 'bzrlib/tests/test_merge3.py'
--- a/bzrlib/tests/test_merge3.py 2010-04-22 14:03:56 +0000
+++ b/bzrlib/tests/test_merge3.py 2010-04-26 13:51:08 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2005 Canonical Ltd
+# Copyright (C) 2005-2010 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,7 +15,11 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from bzrlib.tests import TestCaseInTempDir, TestCase
+from bzrlib import (
+ errors,
+ merge3,
+ tests,
+ )
from bzrlib.merge3 import Merge3
from bzrlib.errors import CantReprocessAndShowBase, BinaryFile
@@ -91,13 +95,13 @@
>>>>>>> TAO
""")
-class TestMerge3(TestCase):
+class TestMerge3(tests.TestCase):
def test_no_changes(self):
"""No conflicts because nothing changed"""
- m3 = Merge3(['aaa', 'bbb'],
- ['aaa', 'bbb'],
- ['aaa', 'bbb'])
+ m3 = merge3.Merge3(['aaa', 'bbb'],
+ ['aaa', 'bbb'],
+ ['aaa', 'bbb'])
self.assertEquals(m3.find_unconflicted(),
[(0, 2)])
@@ -115,9 +119,9 @@
[('unchanged', ['aaa', 'bbb'])])
def test_front_insert(self):
- m3 = Merge3(['zz'],
- ['aaa', 'bbb', 'zz'],
- ['zz'])
+ m3 = merge3.Merge3(['zz'],
+ ['aaa', 'bbb', 'zz'],
+ ['zz'])
# todo: should use a sentinal at end as from get_matching_blocks
# to match without zz
@@ -134,9 +138,9 @@
('unchanged', ['zz'])])
def test_null_insert(self):
- m3 = Merge3([],
- ['aaa', 'bbb'],
- [])
+ m3 = merge3.Merge3([],
+ ['aaa', 'bbb'],
+ [])
# todo: should use a sentinal at end as from get_matching_blocks
# to match without zz
self.assertEquals(list(m3.find_sync_regions()),
@@ -150,9 +154,9 @@
def test_no_conflicts(self):
"""No conflicts because only one side changed"""
- m3 = Merge3(['aaa', 'bbb'],
- ['aaa', '111', 'bbb'],
- ['aaa', 'bbb'])
+ m3 = merge3.Merge3(['aaa', 'bbb'],
+ ['aaa', '111', 'bbb'],
+ ['aaa', 'bbb'])
self.assertEquals(m3.find_unconflicted(),
[(0, 1), (1, 2)])
@@ -168,33 +172,33 @@
('unchanged', 1, 2),])
def test_append_a(self):
- m3 = Merge3(['aaa\n', 'bbb\n'],
- ['aaa\n', 'bbb\n', '222\n'],
- ['aaa\n', 'bbb\n'])
+ m3 = merge3.Merge3(['aaa\n', 'bbb\n'],
+ ['aaa\n', 'bbb\n', '222\n'],
+ ['aaa\n', 'bbb\n'])
self.assertEquals(''.join(m3.merge_lines()),
'aaa\nbbb\n222\n')
def test_append_b(self):
- m3 = Merge3(['aaa\n', 'bbb\n'],
- ['aaa\n', 'bbb\n'],
- ['aaa\n', 'bbb\n', '222\n'])
+ m3 = merge3.Merge3(['aaa\n', 'bbb\n'],
+ ['aaa\n', 'bbb\n'],
+ ['aaa\n', 'bbb\n', '222\n'])
self.assertEquals(''.join(m3.merge_lines()),
'aaa\nbbb\n222\n')
def test_append_agreement(self):
- m3 = Merge3(['aaa\n', 'bbb\n'],
- ['aaa\n', 'bbb\n', '222\n'],
- ['aaa\n', 'bbb\n', '222\n'])
+ m3 = merge3.Merge3(['aaa\n', 'bbb\n'],
+ ['aaa\n', 'bbb\n', '222\n'],
+ ['aaa\n', 'bbb\n', '222\n'])
self.assertEquals(''.join(m3.merge_lines()),
'aaa\nbbb\n222\n')
def test_append_clash(self):
- m3 = Merge3(['aaa\n', 'bbb\n'],
- ['aaa\n', 'bbb\n', '222\n'],
- ['aaa\n', 'bbb\n', '333\n'])
+ m3 = merge3.Merge3(['aaa\n', 'bbb\n'],
+ ['aaa\n', 'bbb\n', '222\n'],
+ ['aaa\n', 'bbb\n', '333\n'])
ml = m3.merge_lines(name_a='a',
name_b='b',
@@ -213,9 +217,9 @@
''')
def test_insert_agreement(self):
- m3 = Merge3(['aaa\n', 'bbb\n'],
- ['aaa\n', '222\n', 'bbb\n'],
- ['aaa\n', '222\n', 'bbb\n'])
+ m3 = merge3.Merge3(['aaa\n', 'bbb\n'],
+ ['aaa\n', '222\n', 'bbb\n'],
+ ['aaa\n', '222\n', 'bbb\n'])
ml = m3.merge_lines(name_a='a',
name_b='b',
@@ -227,9 +231,9 @@
def test_insert_clash(self):
"""Both try to insert lines in the same place."""
- m3 = Merge3(['aaa\n', 'bbb\n'],
- ['aaa\n', '111\n', 'bbb\n'],
- ['aaa\n', '222\n', 'bbb\n'])
+ m3 = merge3.Merge3(['aaa\n', 'bbb\n'],
+ ['aaa\n', '111\n', 'bbb\n'],
+ ['aaa\n', '222\n', 'bbb\n'])
self.assertEquals(m3.find_unconflicted(),
[(0, 1), (1, 2)])
@@ -267,9 +271,9 @@
def test_replace_clash(self):
"""Both try to insert lines in the same place."""
- m3 = Merge3(['aaa', '000', 'bbb'],
- ['aaa', '111', 'bbb'],
- ['aaa', '222', 'bbb'])
+ m3 = merge3.Merge3(['aaa', '000', 'bbb'],
+ ['aaa', '111', 'bbb'],
+ ['aaa', '222', 'bbb'])
self.assertEquals(m3.find_unconflicted(),
[(0, 1), (2, 3)])
@@ -281,9 +285,9 @@
def test_replace_multi(self):
"""Replacement with regions of different size."""
- m3 = Merge3(['aaa', '000', '000', 'bbb'],
- ['aaa', '111', '111', '111', 'bbb'],
- ['aaa', '222', '222', '222', '222', 'bbb'])
+ m3 = merge3.Merge3(['aaa', '000', '000', 'bbb'],
+ ['aaa', '111', '111', '111', 'bbb'],
+ ['aaa', '222', '222', '222', '222', 'bbb'])
self.assertEquals(m3.find_unconflicted(),
[(0, 1), (3, 4)])
@@ -296,7 +300,7 @@
def test_merge_poem(self):
"""Test case from diff3 manual"""
- m3 = Merge3(TZU, LAO, TAO)
+ m3 = merge3.Merge3(TZU, LAO, TAO)
ml = list(m3.merge_lines('LAO', 'TAO'))
self.log('merge result:')
self.log(''.join(ml))
@@ -307,7 +311,7 @@
base_text = ("a\n" * 20).splitlines(True)
this_text = ("a\n"*10+"b\n" * 10).splitlines(True)
other_text = ("a\n"*10+"c\n"+"b\n" * 8 + "c\n").splitlines(True)
- m3 = Merge3(base_text, other_text, this_text)
+ m3 = merge3.Merge3(base_text, other_text, this_text)
m_lines = m3.merge_lines('OTHER', 'THIS', reprocess=True)
merged_text = "".join(list(m_lines))
optimal_text = ("a\n" * 10 + "<<<<<<< OTHER\nc\n"
@@ -323,7 +327,7 @@
base_text = add_newline("abcdefghijklm")
this_text = add_newline("abcdefghijklmNOPQRSTUVWXYZ")
other_text = add_newline("abcdefghijklm1OPQRSTUVWXY2")
- m3 = Merge3(base_text, other_text, this_text)
+ m3 = merge3.Merge3(base_text, other_text, this_text)
m_lines = m3.merge_lines('OTHER', 'THIS', reprocess=True)
merged_text = "".join(list(m_lines))
optimal_text = ''.join(add_newline("abcdefghijklm")
@@ -341,7 +345,7 @@
base_text = add_newline("abacddefgghij")
this_text = add_newline("abacddefgghijkalmontfprz")
other_text = add_newline("abacddefgghijknlmontfprd")
- m3 = Merge3(base_text, other_text, this_text)
+ m3 = merge3.Merge3(base_text, other_text, this_text)
m_lines = m3.merge_lines('OTHER', 'THIS', reprocess=True)
merged_text = "".join(list(m_lines))
optimal_text = ''.join(add_newline("abacddefgghijk")
@@ -356,20 +360,21 @@
base_text = ("a\n" * 20).splitlines(True)
this_text = ("a\n"*10+"b\n" * 10).splitlines(True)
other_text = ("a\n"*10+"c\n"+"b\n" * 8 + "c\n").splitlines(True)
- m3 = Merge3(base_text, other_text, this_text)
+ m3 = merge3.Merge3(base_text, other_text, this_text)
m_lines = m3.merge_lines('OTHER', 'THIS', reprocess=True,
base_marker='|||||||')
self.assertRaises(CantReprocessAndShowBase, list, m_lines)
def test_binary(self):
- self.assertRaises(BinaryFile, Merge3, ['\x00'], ['a'], ['b'])
+ self.assertRaises(BinaryFile, merge3.Merge3, ['\x00'], ['a'], ['b'])
def test_dos_text(self):
base_text = 'a\r\n'
this_text = 'b\r\n'
other_text = 'c\r\n'
- m3 = Merge3(base_text.splitlines(True), other_text.splitlines(True),
- this_text.splitlines(True))
+ m3 = merge3.Merge3(base_text.splitlines(True),
+ other_text.splitlines(True),
+ this_text.splitlines(True))
m_lines = m3.merge_lines('OTHER', 'THIS')
self.assertEqual('<<<<<<< OTHER\r\nc\r\n=======\r\nb\r\n'
'>>>>>>> THIS\r\n'.splitlines(True), list(m_lines))
@@ -378,8 +383,9 @@
base_text = 'a\r'
this_text = 'b\r'
other_text = 'c\r'
- m3 = Merge3(base_text.splitlines(True), other_text.splitlines(True),
- this_text.splitlines(True))
+ m3 = merge3.Merge3(base_text.splitlines(True),
+ other_text.splitlines(True),
+ this_text.splitlines(True))
m_lines = m3.merge_lines('OTHER', 'THIS')
self.assertEqual('<<<<<<< OTHER\rc\r=======\rb\r'
'>>>>>>> THIS\r'.splitlines(True), list(m_lines))
@@ -389,15 +395,17 @@
this_text = "a\n"
other_text = "a\nb\nc\n"
# When cherrypicking, lines in base are not part of the conflict
- m3 = Merge3(base_text.splitlines(True), this_text.splitlines(True),
- other_text.splitlines(True), is_cherrypick=True)
+ m3 = merge3.Merge3(base_text.splitlines(True),
+ this_text.splitlines(True),
+ other_text.splitlines(True), is_cherrypick=True)
m_lines = m3.merge_lines()
self.assertEqualDiff('a\n<<<<<<<\n=======\nc\n>>>>>>>\n',
''.join(m_lines))
# This is not symmetric
- m3 = Merge3(base_text.splitlines(True), other_text.splitlines(True),
- this_text.splitlines(True), is_cherrypick=True)
+ m3 = merge3.Merge3(base_text.splitlines(True),
+ other_text.splitlines(True),
+ this_text.splitlines(True), is_cherrypick=True)
m_lines = m3.merge_lines()
self.assertEqualDiff('a\n<<<<<<<\nb\nc\n=======\n>>>>>>>\n',
''.join(m_lines))
@@ -407,8 +415,9 @@
this_text = 'a\nb\nq\n'
other_text = 'a\nb\nc\nd\nf\ne\ng\n'
# When cherrypicking, lines in base are not part of the conflict
- m3 = Merge3(base_text.splitlines(True), this_text.splitlines(True),
- other_text.splitlines(True), is_cherrypick=True)
+ m3 = merge3.Merge3(base_text.splitlines(True),
+ this_text.splitlines(True),
+ other_text.splitlines(True), is_cherrypick=True)
m_lines = m3.merge_lines()
self.assertEqualDiff('a\n'
'b\n'
@@ -433,7 +442,7 @@
base = [(x,x) for x in 'abcde']
a = [(x,x) for x in 'abcdef']
b = [(x,x) for x in 'Zabcde']
- m3 = Merge3(base, a, b, allow_objects=True)
+ m3 = merge3.Merge3(base, a, b, allow_objects=True)
self.assertEqual(
[('b', 0, 1),
('unchanged', 0, 5),
=== modified file 'bzrlib/tests/test_ui.py'
--- a/bzrlib/tests/test_ui.py 2010-03-25 07:34:15 +0000
+++ b/bzrlib/tests/test_ui.py 2010-04-26 13:51:08 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2008, 2009, 2010 Canonical Ltd
+# Copyright (C) 2005-2010 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
More information about the bazaar-commits
mailing list