3

I'm using VisualSVN Server to manage a source folder. It's installed on a Windows XP machine, and it has access to a network disk.

On this network disk named W:, I made a checkout on a folder this way:

svn checkout https://server:443/svn/Project W:\Project --username=user --password=pass

I can now update this folder using this command:

svn update W:\Project

The problem is:

I want to add a post-commit hook running this command:

svn update W:\Project

but when I commit, this error appears:

At revision: 123
post-commit hook failed (exit code 1) with output:
svn: E020024: Error resolving case of 'W:\Project'

Any ideas ? I don't know if it's a good practice, my goal is to keep a copy of the project on another disk out of the svn server and back it up.

Elias Platek
  • 1,074
  • 1
  • 9
  • 16
  • Are you attempting to commit to the same working copy you want to `svn update` with a post-commit hook? What's the full hook code? – bahrep Apr 04 '13 at 10:04
  • 1
    You might want to look into using a [Continuous Integration](http://en.wikipedia.org/wiki/Continuous_integration#Software) server instead. Running [TeamCity](http://www.jetbrains.com/teamcity/), [Jenkins](http://jenkins-ci.org/) or [Hudson](http://hudson-ci.org) (for example) would let you do this (and more) without having to add the hooks into SVN. – AlG Apr 04 '13 at 11:40

3 Answers3

4

The W: drive is probably not mapped in the environment that the script is running in. All hook scripts run with no environment variables set. You'll need to explicitly specify the server name for the file share or map the network drive in your script.

jsumrall
  • 111
  • 7
  • The unmapped drive letter isn't because of an empty environment. It's because services don't get drives mapped, as that's done in an interactive user login. – alroc Apr 04 '13 at 12:47
  • Mapped drives are mapped on per-user basis and are not accessible by built-in accounts such as "Network Service". – bahrep Apr 04 '13 at 12:49
1

Ok so actually it is possible to do an update on a post-commit action. The problem is that I try to save my repository on a network folder. The default account of VisualSVN service is NTAUTHORITY\NetworkService that cannot access my disk. So I changed the user to a network account and now it works fine.

Elias Platek
  • 1,074
  • 1
  • 9
  • 16
0

Are you using the same working copy you want to update with the post-commit hook script?

You can't svn update the same working copy you are working on with a post-commit hook. It has to be separate working copy. You may consider using svn export command instead of svn update.

bahrep
  • 29,961
  • 12
  • 103
  • 150
  • You're right about the update that can't be done on the post commit hook. But I've tried using export and I've exactly the same message. It seems like the network folder is not accessible... I edit my question – Elias Platek Apr 04 '13 at 12:29