Command line client GET -workingfolder

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

ymett
Posts: 12
Joined: Tue Jul 13, 2010 2:03 am

Command line client GET -workingfolder

Post by ymett » Thu Mar 10, 2011 4:30 am

What is the difference between doing a command line GET with -workingfolder and with -nonworkingfolder?

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Command line client GET -workingfolder

Post by Beth » Thu Mar 10, 2011 9:26 am

The cache watches the working folder and not the non working folder. When something is in a working folder, it is watched for changes and a status can be determined.
Beth Kieler
SourceGear Technical Support

ymett
Posts: 12
Joined: Tue Jul 13, 2010 2:03 am

Re: Command line client GET -workingfolder

Post by ymett » Sun Mar 13, 2011 12:58 am

I don't seem able to check in a file got with -workingfolder unless I get it to the working folder which was set earlier, and the docs do say "The working folder specified is temporary, used only for this get request", so I don't understand what it's doing.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Command line client GET -workingfolder

Post by Beth » Mon Mar 14, 2011 9:17 am

Was the item checked out to a different path? You can only check in from the same path an item was checked out to.
Beth Kieler
SourceGear Technical Support

ymett
Posts: 12
Joined: Tue Jul 13, 2010 2:03 am

Re: Command line client GET -workingfolder

Post by ymett » Tue Mar 15, 2011 1:06 am

The file wasn't checked out -- I have "Require Check Out before Check In" unchecked. If I GET the file to the working folder I can commit it whether I use -workingfolder or -nonworkingfolder. If I GET the file to somewhere else I can't commit it whether I use -workingfolder or -nonworkingfolder, so I can't see the difference.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Command line client GET -workingfolder

Post by Beth » Tue Mar 15, 2011 10:20 am

The is no way to check in from a nonworking folder.

Are you using check outs, or do you work in CVS mode?

What are you trying to accomplish?
Beth Kieler
SourceGear Technical Support

ymett
Posts: 12
Joined: Tue Jul 13, 2010 2:03 am

Re: Command line client GET -workingfolder

Post by ymett » Wed Mar 16, 2011 1:58 am

We work in CVS mode.

I have written a script which gets a file, modifies it, and checks it in. This script can be run by any user, so all users have to have the working folder set to the same path so the script knows where the file to modify is. I came across the options -workingfolder and -nonworkingfolder, and couldn't find any practical difference between them, hence my question.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Command line client GET -workingfolder

Post by Beth » Wed Mar 16, 2011 9:05 am

If the users use the Vault GUI client as well, they won't see the -workingfolder switch do anything to their working folder that was set in the Vault GUI client.

Only working folders can be compared to the baseline tracked by Vault, and only from a working folder can a check in be made.
Beth Kieler
SourceGear Technical Support

ymett
Posts: 12
Joined: Tue Jul 13, 2010 2:03 am

Re: Command line client GET -workingfolder

Post by ymett » Sun Mar 20, 2011 12:16 am

So if I use -workingfolder to get a file to a location which is not the working folder set in the GUI client, can I then change the file and check it in?

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Command line client GET -workingfolder

Post by Beth » Mon Mar 21, 2011 4:38 pm

You *should* be able to check it in from the command line, but not the Vault GUI client. The command line doesn't change the working folder in the Vault GUI client.

If you're running into a case where it isn't, let me know.
Beth Kieler
SourceGear Technical Support

ymett
Posts: 12
Joined: Tue Jul 13, 2010 2:03 am

Re: Command line client GET -workingfolder

Post by ymett » Wed Mar 23, 2011 9:10 am

I don't seem to be able to get it to work.

Code: Select all

D:\>vault GET -repository "test" -makewritable -merge overwrite -workingfolder "D:/vault test2" "$/Playground2/other/File2.txt"
<vault>
  <result>
    <success>True</success>
  </result>
</vault>
I then modify the file, and...

Code: Select all

D:\>vault COMMIT -repository "test" -comment "something" "$/Playground2/other/File2.txt"
<vault>
  <changeset />
  <result>
    <success>True</success>
  </result>
</vault>
and the commit has no effect. What should I be doing?

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Command line client GET -workingfolder

Post by Beth » Wed Mar 23, 2011 10:35 am

Try the CHECKIN command instead of COMMIT.
Beth Kieler
SourceGear Technical Support

ymett
Posts: 12
Joined: Tue Jul 13, 2010 2:03 am

Re: Command line client GET -workingfolder

Post by ymett » Sun Mar 27, 2011 10:06 am

That doesn't seem to make a difference.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Command line client GET -workingfolder

Post by Beth » Mon Mar 28, 2011 12:02 pm

I ran a few tests and I can see where there appears to be a conflict between trying to have the CLC edit and check in from a different working folder than the Vault GUI client has set. I will get a bug logged on this.

In the meantime, you will need to have the script edit in the same working folder the users have set.

If you remove the workingfolder switch entirely, it should just use what is set in the Vault GUI client.

F: 15904
Beth Kieler
SourceGear Technical Support

ymett
Posts: 12
Joined: Tue Jul 13, 2010 2:03 am

Re: Command line client GET -workingfolder

Post by ymett » Thu Mar 31, 2011 5:42 am

Ok, that's what we're doing. It means everyone must have the same working folder set, but that's not really an inconvenience, because we like to have everyone use the same path for other reasons anyway. Unless there's a way to find out the current working folder for a given file?

Post Reply