Ravi Kishore
Ravi Kishore

Reputation: 9

how to validate svn credentials using ant script

I have to commit some code to the svn using ant script, Before committing to the SVN i should validate the credentials ,Is there any command in svn for validating the username and password from ant script

Upvotes: 0

Views: 509

Answers (1)

Lazy Badger
Lazy Badger

Reputation: 97325

No, special command for validating credentials does not exist in SVN

but: you can to use any SVN command for accessing remote repository and use --username and --password option in it

but BEWARE: 1) nor successful nor failed command doesn't return exit-code|error-code to caller, you have to validate and *check output 2) even successful READ command doesn't mean "OK" for WRITE command (you can test on URL with anonymous read access or user can have only read-access to test-URL)

I think, best solution (dirty hack) for testing will be complex of

  • Special "blackhole" URL, with $authenticated = rw permissions on it
  • Pre-commit hook, which block all commits to $BLACKHOLE (you don't want to have useless commits in repo)
  • svn ci $BLACKHOLE --username ... --password ... as test-tool

Upvotes: 1

Related Questions