Rev 35: Refactor a bit. Don't use a helper as creating the MemoryTree directly is cleaner. in lp:~jameinel/+junk/file_locking

John Arbash Meinel john at arbash-meinel.com
Wed Sep 23 04:10:35 BST 2009


At lp:~jameinel/+junk/file_locking

------------------------------------------------------------
revno: 35
revision-id: john at arbash-meinel.com-20090923031025-29l2sznhmmp0akvb
parent: john at arbash-meinel.com-20090923030703-83thv9ikkvh4fhvi
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: file_locking
timestamp: Tue 2009-09-22 22:10:25 -0500
message:
  Refactor a bit. Don't use a helper as creating the MemoryTree directly is cleaner.
-------------- next part --------------
=== modified file 'tests/test_file_lock.py'
--- a/tests/test_file_lock.py	2009-09-23 03:07:03 +0000
+++ b/tests/test_file_lock.py	2009-09-23 03:10:25 +0000
@@ -21,6 +21,7 @@
 
 from bzrlib import (
     errors,
+    memorytree,
     rio,
     tests,
     )
@@ -271,12 +272,11 @@
             ('add', ('b', 'b-id', 'directory', None)),
             ('add', ('b/c', 'c-id', 'file', 'content\n')),
             ])
-        tree, manager = self.make_tree_and_manager('tree')
-        tree.branch.pull(builder.get_branch())
-        # Refresh the memory tree
-        tree.unlock()
-        tree._branch_revision_id = 'A'
+        b = builder.get_branch()
+        tree = memorytree.MemoryTree.create_on_branch(b)
         tree.lock_write()
+        self.addCleanup(tree.unlock)
+        manager = file_lock.FileLockManager(tree)
         manager.initialize_lock_store(self.get_transport('lock-store'))
         manager.track_paths(['b'])
         self.assertFalse(manager.is_locked('b'))



More information about the bazaar-commits mailing list