Rev 5632: Start fleshing out the design. Something weird is causing my tests to all fail. in http://bazaar.launchpad.net/~jameinel/bzr/2.4-reset-checkout
John Arbash Meinel
john at arbash-meinel.com
Mon Jan 24 21:50:11 UTC 2011
At http://bazaar.launchpad.net/~jameinel/bzr/2.4-reset-checkout
------------------------------------------------------------
revno: 5632
revision-id: john at arbash-meinel.com-20110124214959-x3t0myzpa3ncxh2l
parent: john at arbash-meinel.com-20110124212640-hpmofodjjqp81kt9
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.4-reset-checkout
timestamp: Mon 2011-01-24 15:49:59 -0600
message:
Start fleshing out the design. Something weird is causing my tests to all fail.
-------------- next part --------------
=== added file 'bzrlib/tests/blackbox/test_reset_workingtree.py'
--- a/bzrlib/tests/blackbox/test_reset_workingtree.py 1970-01-01 00:00:00 +0000
+++ b/bzrlib/tests/blackbox/test_reset_workingtree.py 2011-01-24 21:49:59 +0000
@@ -0,0 +1,32 @@
+# Copyright (C) 2011 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+import os
+
+from bzrlib.tests import TestCaseWithTransport
+from bzrlib.workingtree import WorkingTree
+
+
+class TestResetWorkingTree(TestCaseWithTransport):
+
+ def test_reset_noop(self):
+ tree = self.make_branch_and_tree('tree')
+ self.build_tree(['tree/foo', 'tree/dir/', 'tree/dir/bar'])
+ tree.add(['foo', 'dir', 'dir/bar'])
+ tree.commit('first')
+ self.run_bzr('reset-workingtree')
+
=== modified file 'bzrlib/tests/per_workingtree/__init__.py'
--- a/bzrlib/tests/per_workingtree/__init__.py 2010-10-26 13:53:31 +0000
+++ b/bzrlib/tests/per_workingtree/__init__.py 2011-01-24 21:49:59 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2006-2010 Canonical Ltd
+# Copyright (C) 2006-2011 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
@@ -83,6 +83,7 @@
'break_lock',
'changes_from',
'check',
+ 'check_state',
'content_filters',
'commit',
'eol_conversion',
=== added file 'bzrlib/tests/per_workingtree/test_check_state.py'
--- a/bzrlib/tests/per_workingtree/test_check_state.py 1970-01-01 00:00:00 +0000
+++ b/bzrlib/tests/per_workingtree/test_check_state.py 2011-01-24 21:49:59 +0000
@@ -0,0 +1,31 @@
+# Copyright (C) 2011 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+"""Tests for WorkingTree.check_state."""
+
+from bzrlib import (
+ tests,
+ )
+from bzrlib.tests.per_workingtree import TestCaseWithWorkingTree
+
+
+class TestCheckState(TestCaseWithWorkingTree):
+
+ def test_check_state(self):
+ tree = self.make_branch_and_tree('tree')
+ # Everything should be fine with an unmodified tree, no exception
+ # should be raised.
+ # tree.check_state()
=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py 2011-01-19 20:04:23 +0000
+++ b/bzrlib/workingtree.py 2011-01-24 21:49:59 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005-2010 Canonical Ltd
+# Copyright (C) 2005-2011 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
@@ -2675,6 +2675,10 @@
"""
return
+ # @needs_tree_write_lock
+ # def check_state(self):
+ # """Check that the working state is/isn't valid."""
+
def _get_rules_searcher(self, default_searcher):
"""See Tree._get_rules_searcher."""
if self._rules_searcher is None:
More information about the bazaar-commits
mailing list