Rev 3378: fix the line endigs for test_get_parent_map.py in http://bzr.arbash-meinel.com/branches/bzr/1.4-dev/dont_log_view_none_211661
John Arbash Meinel
john at arbash-meinel.com
Mon May 19 17:29:50 BST 2008
At http://bzr.arbash-meinel.com/branches/bzr/1.4-dev/dont_log_view_none_211661
------------------------------------------------------------
revno: 3378
revision-id: john at arbash-meinel.com-20080519162930-ymox3xd3rjrd1qbi
parent: john at arbash-meinel.com-20080509161919-j2s1ymi8cm1me5ay
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: dont_log_view_none_211661
timestamp: Mon 2008-05-19 11:29:30 -0500
message:
fix the line endigs for test_get_parent_map.py
modified:
bzrlib/tests/repository_implementations/test_get_parent_map.py test_get_parent_map.-20080421172708-x1z6ot341osr0jq1-1
-------------- next part --------------
=== modified file 'bzrlib/tests/repository_implementations/test_get_parent_map.py'
--- a/bzrlib/tests/repository_implementations/test_get_parent_map.py 2008-04-21 17:32:54 +0000
+++ b/bzrlib/tests/repository_implementations/test_get_parent_map.py 2008-05-19 16:29:30 +0000
@@ -1,73 +1,73 @@
-# 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 the get_parent_map API."""
-
-from bzrlib import revision
-from bzrlib.tests.repository_implementations import TestCaseWithRepository
-
-
-class TestGetParentMap(TestCaseWithRepository):
-
- def test_missing_revision(self):
- tree = self.make_branch_and_tree('.')
- repo = tree.branch.repository
- repo.lock_read()
- self.addCleanup(repo.unlock)
- self.assertEqual({}, repo.get_parent_map(['non-existant']))
-
- def test_multiple_parents(self):
- tree = self.make_branch_and_tree('.')
- rev1 = tree.commit('first')
- rev2 = tree.commit('second')
- tree.set_parent_ids([rev1, rev2])
- tree.branch.set_last_revision_info(1, rev1)
- rev3 = tree.commit('third')
- repo = tree.branch.repository
- repo.lock_read()
- self.addCleanup(repo.unlock)
- self.assertEqual({rev3:(rev1, rev2)},
- repo.get_parent_map([rev3]))
- self.assertEqual({rev1:(revision.NULL_REVISION,),
- rev2:(rev1,),
- rev3:(rev1, rev2),
- }, repo.get_parent_map([rev1, rev2, rev3]))
-
- def test_no_parents(self):
- tree = self.make_branch_and_tree('.')
- rev1 = tree.commit('first')
- repo = tree.branch.repository
- repo.lock_read()
- self.addCleanup(repo.unlock)
- self.assertEqual({rev1:(revision.NULL_REVISION,)},
- repo.get_parent_map([rev1]))
-
- def test_none(self):
- tree = self.make_branch_and_tree('.')
- rev1 = tree.commit('first')
- repo = tree.branch.repository
- repo.lock_read()
- self.addCleanup(repo.unlock)
- self.assertRaises(ValueError,
- repo.get_parent_map, [None])
-
- def test_null_revision(self):
- tree = self.make_branch_and_tree('.')
- repo = tree.branch.repository
- repo.lock_read()
- self.addCleanup(repo.unlock)
- self.assertEqual({revision.NULL_REVISION:()},
- repo.get_parent_map([revision.NULL_REVISION]))
+# 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 the get_parent_map API."""
+
+from bzrlib import revision
+from bzrlib.tests.repository_implementations import TestCaseWithRepository
+
+
+class TestGetParentMap(TestCaseWithRepository):
+
+ def test_missing_revision(self):
+ tree = self.make_branch_and_tree('.')
+ repo = tree.branch.repository
+ repo.lock_read()
+ self.addCleanup(repo.unlock)
+ self.assertEqual({}, repo.get_parent_map(['non-existant']))
+
+ def test_multiple_parents(self):
+ tree = self.make_branch_and_tree('.')
+ rev1 = tree.commit('first')
+ rev2 = tree.commit('second')
+ tree.set_parent_ids([rev1, rev2])
+ tree.branch.set_last_revision_info(1, rev1)
+ rev3 = tree.commit('third')
+ repo = tree.branch.repository
+ repo.lock_read()
+ self.addCleanup(repo.unlock)
+ self.assertEqual({rev3:(rev1, rev2)},
+ repo.get_parent_map([rev3]))
+ self.assertEqual({rev1:(revision.NULL_REVISION,),
+ rev2:(rev1,),
+ rev3:(rev1, rev2),
+ }, repo.get_parent_map([rev1, rev2, rev3]))
+
+ def test_no_parents(self):
+ tree = self.make_branch_and_tree('.')
+ rev1 = tree.commit('first')
+ repo = tree.branch.repository
+ repo.lock_read()
+ self.addCleanup(repo.unlock)
+ self.assertEqual({rev1:(revision.NULL_REVISION,)},
+ repo.get_parent_map([rev1]))
+
+ def test_none(self):
+ tree = self.make_branch_and_tree('.')
+ rev1 = tree.commit('first')
+ repo = tree.branch.repository
+ repo.lock_read()
+ self.addCleanup(repo.unlock)
+ self.assertRaises(ValueError,
+ repo.get_parent_map, [None])
+
+ def test_null_revision(self):
+ tree = self.make_branch_and_tree('.')
+ repo = tree.branch.repository
+ repo.lock_read()
+ self.addCleanup(repo.unlock)
+ self.assertEqual({revision.NULL_REVISION:()},
+ repo.get_parent_map([revision.NULL_REVISION]))
More information about the bazaar-commits
mailing list