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
Asked
Active
Viewed 475 times
0
-
2What do you mean by "validate"? – zb226 Oct 19 '16 at 12:40
-
it is going to fail otherwise, right? what is the issue? – Rao Oct 19 '16 at 18:12
-
Before doing the update or commit from svn i need to check whether that credentials are valid or not..? – Ravi Kishore Oct 20 '16 at 03:44
1 Answers
1
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

Lazy Badger
- 94,711
- 9
- 78
- 110