On Wed, Feb 23, 2011 at 2:55 PM, W. Trevor King <[email protected]> wrote:

> On Wed, Feb 23, 2011 at 11:42:18AM -0700, Michael Chaffin wrote:
> > C:\Temp\testdir>be init
> > Traceback (most recent call last):
> >   ...
> >   File "C:\PROGRA~1\Python26\lib\site-packages\libbe\command\init.py",
> line
> > 95, in _run
> >     storage.init()
> >   File "C:\PROGRA~1\Python26\lib\site-packages\libbe\storage\base.py",
> line
> > 194, in init
> >     return self._init()
> >   File
> "C:\PROGRA~1\Python26\lib\site-packages\libbe\storage\vcs\base.py",
> > line 602, in _init
> >     self._vcs_add(self._u_rel_path(self.be_dir))
> >   File "C:\PROGRA~1\Python26\lib\site-packages\libbe\storage\vcs\bzr.py",
> > line 159, in _vcs_add
> >     cmd.run(file_list=[path], file_ids_from=self.repo)
> >   File "C:\PROGRA~1\Python26\lib\site-packages\bzrlib\commands.py", line
> > 705, in run
> >     return self._operation.run_simple(*args, **kwargs)
> >   ...
> > bzrlib.errors.LockContention: Could not acquire lock
> > "C:/Temp/testdir/.bzr/checkout/dirstate":
> > (32, 'CreateFileW', 'The process cannot access the file because it is
> being
> > used by another process.')
> ...
> So we're getting though the intial detection.  Looking at
> ....
> Lock successfully opened and we're moving on through
> bzrlib.dirstate.lock_write().  Your setup crashes trying to intialize
> the WriteLock.  I think the reason it works for you but not for me is
> a Windows/Linux difference, since the guts of bzrlib.lock are system
> dependent (you're running _w32c_WriteLock).
>
> Boiling the troublesome code down to a minimal test case we get
> something like the file I've attached.  Running it on my sytem gives:
>
>    $ python bzr-be-test.py
>    working in /tmp/tmp-bbtMJijPe
>    initialize Bazaar repo
>    Created a standalone tree (format: 2a)
>    create a dummy file a_file
>    add the file via Python
>    adding a_file
>    success
>    cleanup test directory
>
> Does it also run successfully on your system?
>
> Wow, there is some really good stuff in this email I need to go back and
re-read it, maybe I can learn something about how to debug and trace python
scripts. Thanks ... but to the point

King > ... Lock successfully opened and we're moving on through
King > bzrlib.dirstate.lock_write().  Your setup crashes trying to intialize
King > the WriteLock.  I think the reason it works for you but not for me is
King > a Windows/Linux difference, since the guts of bzrlib.lock are system
King > dependent (you're running _w32c_WriteLock).

I think that is backwards, it works for you on Linux but not me on Win32
because of bzrlib.locks. dependency on _w32c_WriteLock. Do you agree?

King > Does it also successfully on your system?

Here is a copy of the output from trying your attached script on my Win32
(Windows XP Sp3) machine running ActivePython 2.6.5.14 with BzrLib 2.2.3

** SNIP **
C:\Temp>bzr-be-test.py
working in c:\windows\temp\tmp-bbtuqtiq1
initialize Bazaar repo
Created a standalone tree (format: 2a)
create a dummy file a_file
add the file via Python
cleanup test directory
Traceback (most recent call last):
  File "C:\Temp\bzr-be-test.py", line 26, in <module>
    cmd.run([new_file], file_ids_from='.')
  File "C:\PROGRA~1\Python26\lib\site-packages\bzrlib\commands.py", line
705, in run
    return self._operation.run_simple(*args, **kwargs)
  File "C:\PROGRA~1\Python26\lib\site-packages\bzrlib\cleanup.py", line 135,
in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "C:\PROGRA~1\Python26\lib\site-packages\bzrlib\cleanup.py", line 165,
in _do_with_cleanups
    result = func(*args, **kwargs)
  File "C:\PROGRA~1\Python26\lib\site-packages\bzrlib\builtins.py", line
690, in run
    no_recurse, action=action, save=not dry_run)
  File "C:\PROGRA~1\Python26\lib\site-packages\bzrlib\mutabletree.py", line
48, in tree_write_locked
    self.lock_tree_write()
  File "C:\PROGRA~1\Python26\lib\site-packages\bzrlib\workingtree_4.py",
line 622, in lock_tree_write
    return self._lock_self_write()
  File "C:\PROGRA~1\Python26\lib\site-packages\bzrlib\workingtree_4.py",
line 602, in _lock_self_write
    state.lock_write()
  File "C:\PROGRA~1\Python26\lib\site-packages\bzrlib\dirstate.py", line
3065, in lock_write
    self._lock_token = lock.WriteLock(self._filename)
  File "C:\PROGRA~1\Python26\lib\site-packages\bzrlib\lock.py", line 413, in
__init__
    os.O_RDWR, "rb+")
  File "C:\PROGRA~1\Python26\lib\site-packages\bzrlib\lock.py", line 371, in
_open
    raise errors.LockContention(filename, e)
bzrlib.errors.LockContention: Could not acquire lock
"C:/windows/temp/tmp-bbtuqtiq1/.bzr/checkout/dirstate":
(32, 'CreateFileW', 'The process cannot access the file because it is being
used by another process.')
...
** SNIP **

I was going to try the new 'python -m trace --trace' trick ... on the output
of 'bzr-be'test.py' ... but the file is 20Mb.

I will re-read your email and try to help out from my end.
_______________________________________________
Be-devel mailing list
[email protected]
http://void.printf.net/cgi-bin/mailman/listinfo/be-devel

Reply via email to