ObjectNotLocked. What I should do?

James Westby jw+debian at jameswestby.net
Wed Mar 28 19:36:43 BST 2007


On (28/03/07 11:31), Olexandr Byelchenko wrote:
> I have plugin x-bit that help me to control executable bit
> in working tree on win32. This plugin operate with inventory.
> 
> Today (after upgrade one of my branch to WT4) I've got error:
> 
> E:\work\ping-test>bzr x-bit dtr_sync.py
> bzr: ERROR: bzrlib.errors.ObjectNotLocked: <WorkingTree4 of E:/work/ping-test> is not locked
> 
> The code in question:
> 
>     def run(self, files_list, set=False, clear=False):
>         from bzrlib.workingtree import WorkingTree
> 
>         tree = WorkingTree.open_containing(files_list[0])[0]
          
          tree.lock_read()
          try:

>         inv = tree.read_working_inventory()

          finally:
            tree.unlock()

> 
> Error raised on last line.
> What I do wrong? And what I need to change to make my plugin works
> with both WT3 and WT4?
> 

That is completely untested, and I'm not sure that it keeps
compatibility with old releases of bzr.

Thanks,

James

-- 
  James Westby   --    GPG Key ID: B577FE13    --     http://jameswestby.net/
  seccure key - (3+)k7|M*edCX/.A:n*N!>|&7U.L#9E)Tu)T0>AM - secp256r1/nistp256



More information about the bazaar mailing list