2

All I'm trying to do is have a shared repository between a mac and a windows machine. The repository is on the windows machine, and I have a homegroup to share it with the mac. Updating the project to Mac works, but committing from mac doesn't as it results in.

svn: E000045: Commit failed (details follow):
svn: E000045: Can't get exclusive lock on file '/Volumes/[reponame]/db/txn-current-lock': Operation not supported

So is the problem that it can't make sure that no one else is tampering the file?

Now someone will probably comment that sharing a folder like this isn't the right way to do things, and can cause problems. But my usage is limited to sharing between these two computers, so I just need a simple solution.

So my question is: is it just impossible to make the locking to work or to make svn to ignore the lock requirement? And if so, how can I do this otherwise?

Jeffed
  • 163
  • 2
  • 11
  • 1
    This use scenario is very explicitly unsupported and recommended against by the SVN developers. Either set up a real server using SVN, use a public hosting service like Google Code or SourceForge, or switch version control systems to something like Mercurial or Git. – Ben Jan 03 '15 at 17:16
  • Thanks for the comment Ben. Google Code seems to be for open source projects only, so that won't do. Huh, I was almost sure I'd need to either battle with this for a very long while, or ask for further instructions, but setting up a server using VisualSVN was actually very easy. Things are working nicely now! Thanks! – Jeffed Jan 03 '15 at 20:02

2 Answers2

2

@Ben is right: Subversion repository can be stored on network disk, but it requires specific locking features to be available. Which seems to be unsupported by Mac computer when shared folder stored in Windows machine.

Installing Subversion server on Windows is extremely simple using VisualSVN Server: just download the install package and click Next several times. After installing your Subversion repository will be accessible using http:// protocol.

Ivan Zhakov
  • 3,981
  • 28
  • 24
  • 1
    Thanks Ivan for the direct hint to use VisualSVN. I didn't notice your comment yesterday, even though it seems like you posted that before my comment to Ben. In any case I had already ended up setting up VisualSVN Server nevertheless, after first thinking that I'd had to do it the harder way by manually configuring svn and Apache to work together. – Jeffed Jan 04 '15 at 08:12
1

This sounds like you're using the file:/// protocol. Don't. This protocol is for very, very, specific circumstances. If you share a repository between users or between machines, you cannot use it.

Use the svnserve or the Apache httpd server instead. Setting these up is explained in Chapter 6 of the on line Subversion book.

The svnserve is fast and simple. You can probably set up the svnserve process in a matter of minutes. There are even directions for setting up svnserve as a Windows service. This means that as soon as you turn on your Windows machine, your repository is available, and you can do your checkout on your Mac. The only downside is that your network or firewall maybe filtering out port 3690 which is used by svnserve by default. (This can be changed, but you'll have to make sure your clients know the correct port number).

You can also use something like VisualSVN Server which will setup Apache httpd and configure the subversion module for you. It's GUI setup, and it uses port 80 by default which usually isn't blocked.

The only time you should be using file:/// is when you first initially play around with Subversion in order to learn it, or for some web-based clients that allow you to see (but not modify) information in your repository (and mainly because that's the only way you can configure them). Otherwise, even if you're using Subversion all by your self on a single machine, you still shouldn't be using it.

If you have network issues which makes using an always up version control system impossible to use, use a distributed system like Git instead. Git is a bit more complex to use, but because the repository is kept in multiple places (there's no master copy), you can still do your work when there's no network connectivity, and merge your changes into the other repos when you do have connectivity.


One more thing

I found this post on using Git with Dropbox. You cannot do this with Subversion -- even with svnserve (although see note below). This may be the best way for you to work. You put your repo on Dropbox, but never work directly with your repo. Instead, you clone it elsewhere, and then push your changes back to the Dropbox repo.

The Note Below

I want you to understand that you did not hear this from me. If you are ever interrogated by the police, I will deny everything, and round up eye witnesses who will put me far, far from the scene of the crime:

I've seen people put their Subversion repository on Dropbox, then run svnserve on their machine to access that repository. They've successfully done this in mixed Mac, Windows, and Linux environments. However, note they're running svnserve. Note this is their private repository. Note that no one else is using it. Note that they never access that repository from more than one machine at a time. Note that I am denying I ever stated this. Note that this is sold as is with no implied warranty.

If you really, really want to use Subversion, and you really, really need access to multiple systems, and you don't have a good way to do the networking, and you understand that this is not supported and everything is done at your own risk, you can give this a try. No guarantees, but there are people who do this.

Community
  • 1
  • 1
David W.
  • 105,218
  • 39
  • 216
  • 337