Hi,
I'm... actually I'm not sure where to start explaining all this. I'm writing a Java class that implements custom SourceVault functionality via the command line - this will eventually get called from within an Ant task. And if that makes sense to anyone, I'd be grateful if they could explain it to me...
Anyway, one thing I need to implement is an "update" method, which will basically checkout a file without overwriting the local copy, then check it back in. All in one smooth movement. I know that sounds a bit mad but... I don't request the stuff, I just build it
I'm clear on CHECKOUT, and COMMIT - I think. I've also discovered BATCH but I'm not exactly sure how to use it; I don't want to call a list of commands contained within a seperate file (as the commands are going to be dynamic)
So can someone tell me if it's possible - and more essentially give me an example of what such a line would look like - to construct a single command line that uses Vault's BATCH command to run both a CHECKOUT (without overwriting local) and a COMMIT, all at once?
Umm. Thanks
batch example?
Moderator: SourceGear
Unfortunately, the BATCH command is the only way to invoke two (or more) commands for a single command line client call. There is no single command that allows you to checkout and checkin with the same command.
If these are dynamic, you could always dynamically create the batch file, and then call the batch command the same way every time.
If these are dynamic, you could always dynamically create the batch file, and then call the batch command the same way every time.
Sooo... I can use BATCH to run those two commands together? Without using an external batch file? (Even a dynamically created one?) Sorry, but could you give me an example of that? I'm getting this from the internal documentation:
"Use - (hyphen) to specify the batch commands can be found on standard input"
...and maybe it's just my befuddled Monday brain but I can't for the life of me work out how to read that sentence?
"Use - (hyphen) to specify the batch commands can be found on standard input"
...and maybe it's just my befuddled Monday brain but I can't for the life of me work out how to read that sentence?
I can provide an example for "one command" from the command line.
@echo LISTREPOSITORIES | vault BATCH - -host localhost -user user -password pwd
Of course this example won't work with multiple commands because a command line cannot separate each command w/ a new line. You could however, launch your own process of the CLC, providing multiple commands on standard input.
@echo LISTREPOSITORIES | vault BATCH - -host localhost -user user -password pwd
Of course this example won't work with multiple commands because a command line cannot separate each command w/ a new line. You could however, launch your own process of the CLC, providing multiple commands on standard input.
Jeff Clausius
SourceGear
SourceGear
A quick question -
- Will the file be the current version at the time of the checkout?
- Is the file you plan on checking out / committing already modifed?
- Is there any reason you cannot checkout, edit, and then commit the file?
From the description of your post, you might want to research the "Needs merged" status. Unless you take proper precautions (such as GET and auto-merge), it looks like you are headed down the road where commits may fail because they need to be merged with the server.
Just a heads up.
- Will the file be the current version at the time of the checkout?
- Is the file you plan on checking out / committing already modifed?
- Is there any reason you cannot checkout, edit, and then commit the file?
From the description of your post, you might want to research the "Needs merged" status. Unless you take proper precautions (such as GET and auto-merge), it looks like you are headed down the road where commits may fail because they need to be merged with the server.
Just a heads up.
Jeff Clausius
SourceGear
SourceGear