Rev 5327: (jameinel) locking for cmd_ignore is now in add_cleanup. (Parth Malwankar) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Jun 30 23:21:20 BST 2010


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5327 [merge]
revision-id: pqm at pqm.ubuntu.com-20100630222119-m3e9znqsecsm4tiy
parent: pqm at pqm.ubuntu.com-20100630101241-gj9gnm31gj0ptaj7
parent: parth.malwankar at gmail.com-20100630121314-amye0gr5oi2rjso2
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2010-06-30 23:21:19 +0100
message:
  (jameinel) locking for cmd_ignore is now in add_cleanup. (Parth Malwankar)
modified:
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2010-06-23 08:19:28 +0000
+++ b/bzrlib/builtins.py	2010-06-30 12:13:14 +0000
@@ -2721,14 +2721,13 @@
         ignores.tree_ignores_add_patterns(tree, name_pattern_list)
         ignored = globbing.Globster(name_pattern_list)
         matches = []
-        tree.lock_read()
+        self.add_cleanup(tree.lock_read().unlock)
         for entry in tree.list_files():
             id = entry[3]
             if id is not None:
                 filename = entry[0]
                 if ignored.match(filename):
                     matches.append(filename)
-        tree.unlock()
         if len(matches) > 0:
             self.outf.write("Warning: the following files are version controlled and"
                   " match your ignore pattern:\n%s"




More information about the bazaar-commits mailing list