You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Sean McGrath <se...@propylon.com> on 2008/12/29 17:55:48 UTC

Locking problem with the putfile.py from tools/examples

Hello there,

I am trying to get two standalone Python scripts together for locking 
and unlocking files in a repository. The idea is for these to work 
directly on the repository - not on a working copy. The are analogous to 
putfile.py from tools/examples in that respect.

Using Kevin Gillette's notes on 
http://jtauber.com/python_subversion_binding/ I have created a lockfile.py.

The problem is that once a file is locked, I can no longer use 
putfile.py to update the file using the same identity that holds the lock.

The exception thrown is svn.core.SubversionException: (
  "Cannot verify lock on path '/testing'; no username available", 160034)

Kevin Gillette's notes on http://jtauber.com/python_subversion_binding/ 
speak about associating a username with the repos pointer like this:

    access = fs.create_access(username)
    fs.set_access(fs_ptr, access)

Adding these to putfile.py before creating the transaction 
improves/changes matters. The exception changes to:
  svn.core.SubversionException: (
  Cannot verify lock on path '/testing'; no matching lock-token available)

I'm guessing that the issue comes down to putfile.py having to provide a 
lock token as well as an identity (something that a working copy client 
would do automatically.)

Does this sound plausible? Is there a mechanism through the Python APIs 
for me to provide the lock token?

I have a self contained zip that illustrates the problem if anybody is 
interested.

Is this a bit low level for the users list? Should I move this to dev?

thanks,
Sean

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=995184

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].