git-as-svn / git-as-svn

Subversion frontend server for Git repositories

Home Page:https://git-as-svn.github.io/git-as-svn/htmlsingle/git-as-svn.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

svn lock doesn't have svn semantics (lfsMode)

DavidGrundberg opened this issue · comments

Hello, first of all, thanks for sharing a terrific piece of software! It could really become useful for me

I realize that git-as-svn only mirrors what git-lfs locking does. (Which IMHO is fundamentally broken, but that's beside the point.) What's important to me is that the svn clients expect the file to be up to date when they have a lock, and today that's not the case with git-as-svn, unfortunately.

Running git-as-svn with the gitlab backend.

What I do:

$ svn checkout svn://gitlab.example.com/my/repo/master checkout1
$ cd checkout1
$ echo "test" > myfile.txt # create a file
$ svn add myfile.txt
$ svn commit myfile.txt
$ cd ..
$ svn checkout svn://gitlab.example.com/my/repo/master checkout2
$ cd checkout1
$ echo "test" >> myfile.txt
$ svn commit
$ cd ../checkout2
$ svn lock myfile.txt

What I expect to happen when I run the lock command:

$ svn lock myfile.txt
svn: warning: W160042: Lock failed: newer version of '/myfile.txt' exists
svn: E200009: One or more locks could not be obtained
$ svn status -uv | grep myfile.txt
        *        8        8 john.doe myfile.txt # file is not locked!
$ 

What happens today with git-as-svn:

$ svn lock myfile.txt
'myfile.txt' locked by user 'john.doe'
$ svn status -uv | grep myfile.txt
     K  *       12       12 john.doe myfile.txt # file is locked, despite being out of date
$ 

I've been looking through the code and fixed another issue (with the strings used as names for the locks), with some pointers I might be able to fix this too