Rev 3394: Fix the line endings on test_check and test_reconcile in http://bzr.arbash-meinel.com/branches/bzr/1.5-dev/reconcile_rev_history_177855
John Arbash Meinel
john at arbash-meinel.com
Tue Apr 29 17:50:03 BST 2008
At http://bzr.arbash-meinel.com/branches/bzr/1.5-dev/reconcile_rev_history_177855
------------------------------------------------------------
revno: 3394
revision-id: john at arbash-meinel.com-20080429164314-n3q4obl92y7suwah
parent: john at arbash-meinel.com-20080429163438-scr993idmrty20bv
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: reconcile_rev_history_177855
timestamp: Tue 2008-04-29 11:43:14 -0500
message:
Fix the line endings on test_check and test_reconcile
modified:
bzrlib/tests/branch_implementations/test_check.py test_check.py-20080429151303-1sbfclxhddpz0tnj-1
bzrlib/tests/branch_implementations/test_reconcile.py test_reconcile.py-20080429161555-qlmccuyeyt6pvho7-1
-------------- next part --------------
=== modified file 'bzrlib/tests/branch_implementations/test_check.py'
--- a/bzrlib/tests/branch_implementations/test_check.py 2008-04-29 15:53:30 +0000
+++ b/bzrlib/tests/branch_implementations/test_check.py 2008-04-29 16:43:14 +0000
@@ -1,65 +1,65 @@
-# Copyright (C) 2008 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
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-"""Tests for branch implementations - tests a branch format."""
-
-from bzrlib import errors
-from bzrlib.tests.branch_implementations import TestCaseWithBranch
-
-
-class TestBranchCheck(TestCaseWithBranch):
-
- def test_check_detects_invalid_revhistory(self):
- # Different formats have different ways of handling invalid revision
- # histories, so the setup portion is customized
- tree = self.make_branch_and_tree('test')
- r1 = tree.commit('one')
- r2 = tree.commit('two')
- r3 = tree.commit('three')
- r4 = tree.commit('four')
- # create an alternate branch
- tree.set_parent_ids([r1])
- tree.branch.set_last_revision_info(1, r1)
- r2b = tree.commit('two-b')
-
- # now go back and merge the commit
- tree.set_parent_ids([r4, r2b])
- tree.branch.set_last_revision_info(4, r4)
-
- r5 = tree.commit('five')
- # Now, try to set an invalid history
- try:
- tree.branch.set_revision_history([r1, r2b, r5])
- except errors.NotLefthandHistory:
- # Branch5 allows set_revision_history to be wrong
- # Branch6 raises NotLefthandHistory, but we can force bogus stuff
- # with set_last_revision_info
- tree.branch.set_last_revision_info(3, r5)
-
- e = self.assertRaises(errors.BzrCheckError,
- tree.branch.check)
- self.assertEqual('Internal check failed:'
- ' revno does not match len(mainline) 3 != 5', str(e))
-
- def test_check_branch_report_results(self):
- """Checking a branch produces results which can be printed"""
- branch = self.make_branch('.')
- result = branch.check()
- # reports results through logging
- result.report_results(verbose=True)
- result.report_results(verbose=False)
-
-
+# Copyright (C) 2008 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
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+"""Tests for branch implementations - tests a branch format."""
+
+from bzrlib import errors
+from bzrlib.tests.branch_implementations import TestCaseWithBranch
+
+
+class TestBranchCheck(TestCaseWithBranch):
+
+ def test_check_detects_invalid_revhistory(self):
+ # Different formats have different ways of handling invalid revision
+ # histories, so the setup portion is customized
+ tree = self.make_branch_and_tree('test')
+ r1 = tree.commit('one')
+ r2 = tree.commit('two')
+ r3 = tree.commit('three')
+ r4 = tree.commit('four')
+ # create an alternate branch
+ tree.set_parent_ids([r1])
+ tree.branch.set_last_revision_info(1, r1)
+ r2b = tree.commit('two-b')
+
+ # now go back and merge the commit
+ tree.set_parent_ids([r4, r2b])
+ tree.branch.set_last_revision_info(4, r4)
+
+ r5 = tree.commit('five')
+ # Now, try to set an invalid history
+ try:
+ tree.branch.set_revision_history([r1, r2b, r5])
+ except errors.NotLefthandHistory:
+ # Branch5 allows set_revision_history to be wrong
+ # Branch6 raises NotLefthandHistory, but we can force bogus stuff
+ # with set_last_revision_info
+ tree.branch.set_last_revision_info(3, r5)
+
+ e = self.assertRaises(errors.BzrCheckError,
+ tree.branch.check)
+ self.assertEqual('Internal check failed:'
+ ' revno does not match len(mainline) 3 != 5', str(e))
+
+ def test_check_branch_report_results(self):
+ """Checking a branch produces results which can be printed"""
+ branch = self.make_branch('.')
+ result = branch.check()
+ # reports results through logging
+ result.report_results(verbose=True)
+ result.report_results(verbose=False)
+
+
=== modified file 'bzrlib/tests/branch_implementations/test_reconcile.py'
--- a/bzrlib/tests/branch_implementations/test_reconcile.py 2008-04-29 16:31:58 +0000
+++ b/bzrlib/tests/branch_implementations/test_reconcile.py 2008-04-29 16:43:14 +0000
@@ -1,67 +1,67 @@
-# Copyright (C) 2008 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
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-"""Tests for branch implementations - test reconcile() functionality"""
-
-from bzrlib import errors, reconcile
-from bzrlib.tests.branch_implementations import TestCaseWithBranch
-
-
-class TestBranchReconcile(TestCaseWithBranch):
-
- def test_reconcile_fixes_invalid_revhistory(self):
- # Different formats have different ways of handling invalid revision
- # histories, so the setup portion is customized
- tree = self.make_branch_and_tree('test')
- r1 = tree.commit('one')
- r2 = tree.commit('two')
- r3 = tree.commit('three')
- r4 = tree.commit('four')
- # create an alternate branch
- tree.set_parent_ids([r1])
- tree.branch.set_last_revision_info(1, r1)
- r2b = tree.commit('two-b')
-
- # now go back and merge the commit
- tree.set_parent_ids([r4, r2b])
- tree.branch.set_last_revision_info(4, r4)
-
- r5 = tree.commit('five')
- # Now, try to set an invalid history
- try:
- tree.branch.set_revision_history([r1, r2b, r5])
- except errors.NotLefthandHistory:
- # Branch5 allows set_revision_history to be wrong
- # Branch6 raises NotLefthandHistory, but we can force bogus stuff
- # with set_last_revision_info
- tree.branch.set_last_revision_info(3, r5)
-
- self.assertEqual((3, r5), tree.branch.last_revision_info())
- reconciler = tree.branch.reconcile()
- self.assertEqual((5, r5), tree.branch.last_revision_info())
- self.assertIs(True, reconciler.fixed_history)
-
- def test_reconcile_returns_reconciler(self):
- a_branch = self.make_branch('a_branch')
- result = a_branch.reconcile()
- self.assertIsInstance(result, reconcile.BranchReconciler)
- # No history to fix
- self.assertIs(False, result.fixed_history)
-
- def test_reconcile_supports_thorough(self):
- a_branch = self.make_branch('a_branch')
- a_branch.reconcile(thorough=False)
- a_branch.reconcile(thorough=True)
+# Copyright (C) 2008 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
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+"""Tests for branch implementations - test reconcile() functionality"""
+
+from bzrlib import errors, reconcile
+from bzrlib.tests.branch_implementations import TestCaseWithBranch
+
+
+class TestBranchReconcile(TestCaseWithBranch):
+
+ def test_reconcile_fixes_invalid_revhistory(self):
+ # Different formats have different ways of handling invalid revision
+ # histories, so the setup portion is customized
+ tree = self.make_branch_and_tree('test')
+ r1 = tree.commit('one')
+ r2 = tree.commit('two')
+ r3 = tree.commit('three')
+ r4 = tree.commit('four')
+ # create an alternate branch
+ tree.set_parent_ids([r1])
+ tree.branch.set_last_revision_info(1, r1)
+ r2b = tree.commit('two-b')
+
+ # now go back and merge the commit
+ tree.set_parent_ids([r4, r2b])
+ tree.branch.set_last_revision_info(4, r4)
+
+ r5 = tree.commit('five')
+ # Now, try to set an invalid history
+ try:
+ tree.branch.set_revision_history([r1, r2b, r5])
+ except errors.NotLefthandHistory:
+ # Branch5 allows set_revision_history to be wrong
+ # Branch6 raises NotLefthandHistory, but we can force bogus stuff
+ # with set_last_revision_info
+ tree.branch.set_last_revision_info(3, r5)
+
+ self.assertEqual((3, r5), tree.branch.last_revision_info())
+ reconciler = tree.branch.reconcile()
+ self.assertEqual((5, r5), tree.branch.last_revision_info())
+ self.assertIs(True, reconciler.fixed_history)
+
+ def test_reconcile_returns_reconciler(self):
+ a_branch = self.make_branch('a_branch')
+ result = a_branch.reconcile()
+ self.assertIsInstance(result, reconcile.BranchReconciler)
+ # No history to fix
+ self.assertIs(False, result.fixed_history)
+
+ def test_reconcile_supports_thorough(self):
+ a_branch = self.make_branch('a_branch')
+ a_branch.reconcile(thorough=False)
+ a_branch.reconcile(thorough=True)
More information about the bazaar-commits
mailing list