Reputation: 2145
Hello I want to implement the following flow in my application.(as shown in the pseudocode)
LatestRevision = IsMyFileLatest(); // some method which should check the svn and compare the working copy of the file.
if (! LatestRevision) //this flag compares with the Head Revision
{
//Display error message..The file is not the latest copy
}
else
{
// Commit the file changes in the subversion server
FileCommit(); //commits the file(whichever file im working to the server)
}
For this i need help of the following svn commands executed in the command line.
Any help or pointers regarding the subversion command line is deeply appreciated.
Thanks and Best regards
Upvotes: 0
Views: 922
Reputation: 45083
The VisualSVN site hosts a 'book' on Subversion, located here, which should give you a good starting point - though off the top of my head I'm not sure of the exact commands you'd need to use...
There is a chapter which is a reference for commands:
Explained there is svn info which may help you out well enough.
EDIT:
On the other hand, after reading your altered title, svn status may be what you're looking for?
EDIT 2:
Ok, given that the programming language used in your question is not explicitly stated, and the fact it's such a common syntax that we could liken the guesswork to that of beating a dead horse, here's a little snippet in the universal (in the Windows world) VBScript...
Dim shell, svn
Set shell = CreateObject("WScript.Shell")
Set svn = shell.Exec("svn info [working_copy_path]")
WScript.Sleep 1000
Dim revision
Do While svn.StdOut.AtEndOfStream <> True
revision = svn.StdOut.ReadLine
If left(revision, 8) = "Revision" Then
Exit Do
End If
Loop
WScript.Echo revision
I'm far from proud of the Sleep
mechanism utilised, but luckily I'm not the one with (much of) a responsibility here, so I'll leave generating a clean-cut approach to yourself and just put this out there as an example.
Upvotes: 1