[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Bug report: Deleting a file and keeping the lock to it

From: John Hutchinson <john.hutchinson_at_fp.co.nz>
Date: 2006-02-16 04:49:00 CET

What I did: got a lock for a file, deleted it with --no-unlock, then
couldn't delete the parent directory, cos the orphaned lock still existed

Please note that this sounds silly cos why would you check Keep locks if you
are just deleting. However you may be doing lots of things one of which is
deleting and you just want to keep working on everything in that folder.

What I wanted to happen: delete the file and the directory and any locks
that I owned for deleted files were deleted as well

What actually happened: when I deleted the file and kept the lock, the lock
was indeed kept and the file deleted. This one reference (i.e. the lock) to
the file meant the folder couldn't be deleted.

Below is a script that reproduces the problem, followed by the result of
running the script (sim.bat):

mkdir test
svn add test
cd test
dir > sample.txt
svn add sample.txt
svn propset needs-lock * sample.txt
cd ..
svn ci -m "Store sample"
cd test
svn lock sample.txt
svn del sample.txt
svn ci --no-unlock -m "Create problem!"
cd ..
svn del test
svn up
svn ci -m "This won't work cos of orphaned lock for sample.txt"

----------------------------------------------------------------------------
--------------------------------

C:\svnt\John\LastLockingTest>sim.bat

C:\svnt\John\LastLockingTest>mkdir test

C:\svnt\John\LastLockingTest>svn add test
A test

C:\svnt\John\LastLockingTest>cd test

C:\svnt\John\LastLockingTest\test>dir 1>sample.txt

C:\svnt\John\LastLockingTest\test>svn add sample.txt
A sample.txt

C:\svnt\John\LastLockingTest\test>svn propset needs-lock * sample.txt
property 'needs-lock' set on 'sample.txt'
property 'needs-lock' set on 'sample.txt'

C:\svnt\John\LastLockingTest\test>cd ..

C:\svnt\John\LastLockingTest>svn ci -m "Store sample"
Authentication realm: <svn://etc57783:3690> Temp Micro Code Respository
Username: John
Password for 'John': ****
Adding LastLockingTest\test
Adding LastLockingTest\test\sample.txt
Transmitting file data .
Committed revision 692.

C:\svnt\John\LastLockingTest>cd test

C:\svnt\John\LastLockingTest\test>svn lock sample.txt
Authentication realm: <svn://etc57783:3690> Temp Micro Code Respository
Username: John
Password for 'John': ****
'sample.txt' locked by user 'John'.

C:\svnt\John\LastLockingTest\test>svn del sample.txt
D sample.txt

C:\svnt\John\LastLockingTest\test>svn ci --no-unlock -m "Create problem!"
Authentication realm: <svn://etc57783:3690> Temp Micro Code Respository
Username: John
Password for 'John': ****
Deleting test\sample.txt

Committed revision 693.

C:\svnt\John\LastLockingTest\test>cd ..

C:\svnt\John\LastLockingTest>svn del test
D test

C:\svnt\John\LastLockingTest>svn up
At revision 693.

C:\svnt\John\LastLockingTest>svn ci -m "This won't work cos of orphaned lock
for sample.txt"
Authentication realm: <svn://etc57783:3690> Temp Micro Code Respository
Password for 'hutchij':
Authentication realm: <svn://etc57783:3690> Temp Micro Code Respository
Username: John
Password for 'John': ****
Deleting LastLockingTest\test
svn: Commit failed (details follow):
svn: Cannot verify lock on path
'/Practice/John/LastLockingTest/test/sample.txt'; no matching lock-token
available

C:\svnt\John\LastLockingTest>

----------------------------------------------------------------------------
--------------------------------

Below is a list of the locks on the test server used:

C:\SVNRepo\MicroCode>svnadmin lslocks .\
Path: /Practice/John/LastLockingTest/test/sample.txt
UUID Token: opaquelocktoken:a952b1f2-b841-b041-9a35-656604acf3f6
Owner: John
Created: 2006-02-16 16:34:56 +1300 (Thu, 16 Feb 2006)
Expires:
Comment (0 lines):

----------------------------------------------------------------------------
--------------------------------

I am using Windows 2000:

C:\svnt\John\LastLockingTest>svn --version
svn, version 1.3.0 (r17949)
   compiled Jan 15 2006, 23:18:48

Copyright (C) 2000-2005 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet
(http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
  - handles 'http' scheme
  - handles 'https' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme

My SVN test server is running on Window's NT 4 workstation, running svnserve
only:

C:\SVNRepo\MicroCode>svnserve --version
svnserve, version 1.3.0 (r17949)
   compiled Jan 15 2006, 23:18:48

Copyright (C) 2000-2005 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet
(http://www.Collab.Net/).

The following repository back-end (FS) modules are available:

* fs_base : Module for working with a Berkeley DB repository.
* fs_fs : Module for working with a plain file (FSFS) repository.

John Hutchinson

PS: I'm not subscribed to the mailing list, can you please CC me in any
responses to this, thanks :-)
PPS: I have looked through the archives and at the issue list and not seen
this issue mentioned, sorry if I missed it and wasted peoples time reading
this.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Feb 16 05:13:47 2006

This is an archived mail posted to the Subversion Users mailing list.