Rev 2686: Fix ignore caching across unlocks (#129694, Daniel Watkins) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Wed Aug 8 20:52:05 BST 2007
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 2686
revision-id: pqm at pqm.ubuntu.com-20070808195203-8j0f3kmhde2akrhx
parent: pqm at pqm.ubuntu.com-20070808113110-acathx9d9mpfo80z
parent: abentley at panoramicfeedback.com-20070808185624-0tf8gv49z90sjou4
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2007-08-08 20:52:03 +0100
message:
Fix ignore caching across unlocks (#129694, Daniel Watkins)
modified:
NEWS NEWS-20050323055033-4e00b5db738777ff
bzrlib/tests/workingtree_implementations/test_is_ignored.py test_is_ignored.py-20060518083307-a5b383dd4d070083
bzrlib/workingtree.py workingtree.py-20050511021032-29b6ec0a681e02e3
bzrlib/workingtree_4.py workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
------------------------------------------------------------
revno: 2685.1.1
merged: abentley at panoramicfeedback.com-20070808185624-0tf8gv49z90sjou4
parent: pqm at pqm.ubuntu.com-20070808113110-acathx9d9mpfo80z
parent: d.m.watkins at warwick.ac.uk-20070801182648-x2l0w5p43ihajm8p
committer: Aaron Bentley <abentley at panoramicfeedback.com>
branch nick: Aaron's integration
timestamp: Wed 2007-08-08 14:56:24 -0400
message:
Fix ignore caching across unlocks (#129694, Daniel Watkins)
------------------------------------------------------------
revno: 2665.3.4
merged: d.m.watkins at warwick.ac.uk-20070801182648-x2l0w5p43ihajm8p
parent: d.m.watkins at warwick.ac.uk-20070801182329-vf71f4u36kibs0n0
committer: Daniel Watkins <D.M.Watkins at warwick.ac.uk>
branch nick: 129694
timestamp: Wed 2007-08-01 19:26:48 +0100
message:
The cache of ignore definitions is now cleared in WorkingTree.unlock() so that changes to .bzrignore aren't missed, fixing bug #129694.
------------------------------------------------------------
revno: 2665.3.3
merged: d.m.watkins at warwick.ac.uk-20070801182329-vf71f4u36kibs0n0
parent: d.m.watkins at warwick.ac.uk-20070801182222-z4u26hxqji4y2qvr
committer: Daniel Watkins <D.M.Watkins at warwick.ac.uk>
branch nick: 129694
timestamp: Wed 2007-08-01 19:23:29 +0100
message:
Added _cleanup() to the unlock() method of all implementations of WorkingTree so that the cached ignore definitions are wiped when a lock is lost.
------------------------------------------------------------
revno: 2665.3.2
merged: d.m.watkins at warwick.ac.uk-20070801182222-z4u26hxqji4y2qvr
parent: d.m.watkins at warwick.ac.uk-20070801182144-si0ima8ucee99vev
committer: Daniel Watkins <D.M.Watkins at warwick.ac.uk>
branch nick: 129694
timestamp: Wed 2007-08-01 19:22:22 +0100
message:
Created _cleanup() method in WorkingTree.
------------------------------------------------------------
revno: 2665.3.1
merged: d.m.watkins at warwick.ac.uk-20070801182144-si0ima8ucee99vev
parent: pqm at pqm.ubuntu.com-20070801000518-wyeivv59zhkh9cbp
committer: Daniel Watkins <D.M.Watkins at warwick.ac.uk>
branch nick: 129694
timestamp: Wed 2007-08-01 19:21:44 +0100
message:
Added test to ensure that WorkingTree.unknowns() will return an accurate list of unknown files (by way of ensuring that the cached list of ignore definitions in WorkingTree is kept up to date).
=== modified file 'NEWS'
--- a/NEWS 2007-08-08 05:04:16 +0000
+++ b/NEWS 2007-08-08 18:56:24 +0000
@@ -123,6 +123,9 @@
* HTML documentation now use files extension *.html (Alexander Belchenko)
+ * The cache of ignore definitions is now cleared in WorkingTree.unlock()
+ so that changes to .bzrignore aren't missed. (#129694, Daniel Watkins)
+
LIBRARY API BREAKS:
* Deprecated dictionary ``bzrlib.option.SHORT_OPTIONS`` removed.
=== modified file 'bzrlib/tests/workingtree_implementations/test_is_ignored.py'
--- a/bzrlib/tests/workingtree_implementations/test_is_ignored.py 2006-12-08 12:59:11 +0000
+++ b/bzrlib/tests/workingtree_implementations/test_is_ignored.py 2007-08-01 18:21:44 +0000
@@ -206,3 +206,15 @@
self.assertEqual('./foobar.py', tree.is_ignored('foobar.py'))
finally:
ignores._runtime_ignores = orig_runtime
+
+ def test_ignore_caching(self):
+ tree = self.make_branch_and_tree('.')
+ self.build_tree(['ignoreme'])
+
+ self.assertEqual(None, tree.is_ignored('ignoreme'))
+
+ # Bug #129694 specifically references WorkingTree.unknowns()
+ tree.unknowns()
+
+ self.build_tree_contents([('.bzrignore', 'ignoreme')])
+ self.assertEqual('ignoreme', tree.is_ignored('ignoreme'))
=== modified file 'bzrlib/workingtree.py'
--- a/bzrlib/workingtree.py 2007-07-25 21:25:00 +0000
+++ b/bzrlib/workingtree.py 2007-08-01 18:23:29 +0000
@@ -399,6 +399,9 @@
# the basis tree is a ghost so return an empty tree.
return self.branch.repository.revision_tree(None)
+ def _cleanup(self):
+ self._flush_ignore_list_cache()
+
@staticmethod
@deprecated_method(zero_eight)
def create(branch, directory):
@@ -2406,6 +2409,9 @@
raise
def unlock(self):
+ # do non-implementation specific cleanup
+ self._cleanup()
+
# we share control files:
if self._control_files._lock_count == 3:
# _inventory_is_modified is always False during a read lock.
@@ -2477,6 +2483,8 @@
return _mod_conflicts.ConflictList.from_stanzas(RioReader(confile))
def unlock(self):
+ # do non-implementation specific cleanup
+ self._cleanup()
if self._control_files._lock_count == 1:
# _inventory_is_modified is always False during a read lock.
if self._inventory_is_modified:
=== modified file 'bzrlib/workingtree_4.py'
--- a/bzrlib/workingtree_4.py 2007-07-20 20:27:07 +0000
+++ b/bzrlib/workingtree_4.py 2007-08-01 18:23:29 +0000
@@ -1114,6 +1114,9 @@
def unlock(self):
"""Unlock in format 4 trees needs to write the entire dirstate."""
+ # do non-implementation specific cleanup
+ self._cleanup()
+
if self._control_files._lock_count == 1:
# eventually we should do signature checking during read locks for
# dirstate updates.
More information about the bazaar-commits
mailing list