soscmd requests

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

Moderator: SourceGear

Post Reply
kfsone
Posts: 20
Joined: Mon Jun 02, 2008 1:48 pm
Location: Bedford, TX

soscmd requests

Post by kfsone » Tue Aug 17, 2010 8:10 pm

Would it be possible to get a refresh on the 4.2 'soscmd' utility?

The current download retains a bug that was fixed some time ago (or I was told it was fixed ;) with -command interactive (every command requires you to supply a -alias or -database, but it actually ignores the value).

It would also be /really/ nice if you could add a -batch parameter which:
- Turns off all the readline stuff,
- Does not display any prompts,
- Perhaps prints a 'Content-length:' header before each output - but not really essential.

It finally struck me earlier that all of the "result" output is terminated with \r\n whereas the client output (such as the blank line after the output) is just\n.

kfsone
Posts: 20
Joined: Mon Jun 02, 2008 1:48 pm
Location: Bedford, TX

Re: soscmd requests

Post by kfsone » Wed Aug 18, 2010 2:39 am

Notes on soscmd with -command interactive:

/Some/ commands (GetFileList, GetFileHistory) always want you to add the -database/-alias (again: this is in interactive mode, seems kinda redundant)

GetFile does not honor -workdir.

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

Re: soscmd requests

Post by Beth » Wed Aug 18, 2010 2:40 pm

I will put in a feature request for your first post. I'll need to run some tests on the second item before I can comment on it.
Beth Kieler
SourceGear Technical Support

kfsone
Posts: 20
Joined: Mon Jun 02, 2008 1:48 pm
Location: Bedford, TX

Re: soscmd requests

Post by kfsone » Thu Aug 19, 2010 4:08 am

Ahh: To use GetFileList and GetFileHistory inside -command interactive you have to provide an alias (any alias) in the command line:
osmith@luciddev:/tmp$ soscmd -server 192.168.0.7:8535 -name $SOSUSER -password $SOSPASS -database $SOSDATA -command interactive
SOS>GetFileList -project $/
The GetFileList command requires valid -server, -name, -password, -project, and -database or -alias parameters.
SOS>GetFileList -project $/ -alias X
The GetFileList command requires valid -server, -name, -password, -project, and -database or -alias parameters.
SOS>GetFileList -project $/ -database C:\shared\public\ddrive\vss-dev\srcsafe.ini

SOS>quit
osmith@luciddev:/tmp$ soscmd -server 192.168.0.7:8535 -name $SOSUSER -password $SOSPASS -database $SOSDATA -command interactive -alias X
SOS>GetFileList -project $/

SOS>
GetFile only seems to honor the command line -workdir argument:
osmith@luciddev:/tmp/sos$ mkdir work
osmith@luciddev:/tmp/sos$ soscmd -server 192.168.0.7:8535 -name $SOSUSER -password $SOSPASS -database $SOSDATA -command interactive -alias X
SOS>GetFile -workdir work -project $/ww2data/ww2mods -file tos.txt
SOS>GetFile -workdir ./work -project $/ww2data/ww2mods -file eula.txt
SOS>GetFile -project ww2data/ww2mods -file tos.txt -workdir work
SOS>GetFile -project ww2data/ww2mods -file eula.txt -workdir /tmp/sos/work
SOS>quit
osmith@luciddev:/tmp/sos$ ls work # nothing in there
osmith@luciddev:/tmp/sos$ ls # they're both in the current working directory...
eula.txt tos.txt work
# Running the command with a -workdir argument this time.
osmith@luciddev:/tmp/sos$ soscmd -server 192.168.0.7:8535 -name $SOSUSER -password $SOSPASS -database $SOSDATA -command interactive -alias X -workdir work
SOS>GetFile -project ww2data/ww2mods -file tos.txt
SOS>GetFile -project ww2data/ww2mods -file eula.txt -workdir /tmp
SOS>quit
osmith@luciddev:/tmp/sos$ ls work # both files in work even tho the second had a -workdir
eula.txt tos.txt
I was also having a really hard time trying to drive soscmd via scripting languages etc. Through a process of elimination I managed to work out that it's some weirdness in your tty driving, particularly when you're not a tty.

In the end the only way I could get soscmd to work reliably from within a scripting language was to use python's Pexpect and manually specify a terminal size of 16 rows and 511 columns.

Otherwise, whenever a command was longer than 40-60 characters, soscmd would fail on it as an unrecognized command.

So, yeah, a way to turn the pseudo-readline stuff off would be a godsend. I'm trying to automate some testing but doing it one soscmd invocation at a time = agony.

kfsone
Posts: 20
Joined: Mon Jun 02, 2008 1:48 pm
Location: Bedford, TX

Re: soscmd requests

Post by kfsone » Thu Aug 19, 2010 4:58 am

Lastly... soscmd has this weird habbit of becoming unresponsive after a few GetFiles which seems to be timing related: I can get twice as many files if paste the list or use a redirect, than I can if I type them manually:
osmith@luciddev:/tmp/nightlybuild soscmd -server $SOSSERV -name $SOSUSER -password $SOSPASS -database $SOSDATA -alias D -command interactive -project ww2data/ww2mods
SOS>GetFile -project ww2data/ww2mods/DATA/sounds/bf109e3 -file mgffr.wav -revision 1
SOS>GetFile -project ww2data/ww2mods/DATA/sounds/pziiif -file idle.wav -revision 1
SOS>GetFile -project ww2data/ww2mods/DATA/sounds/pziiif -file dual_mg34.wav -revision 1
SOS>GetFile -project ww2data/ww2mods/DATA/sounds/Charb1 -file idle.wav -revision 1
SOS>GetFile -project ww2data/ww2mods/DATA/sounds/oplblitz -file starter.wav -revision 1
SOS>GetFile -project ww2data/ww2mods/DATA/sounds/Charb1 -file engine.wav -revision 1
SOS>GetFile -project ww2data/ww2mods/DATA/sounds/bf109e3 -file prop.wav -revision 1
(never comes back)

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

Re: soscmd requests

Post by Beth » Thu Aug 19, 2010 3:18 pm

Back on the SOS cmd issue. Are there areas in your command where you have to use quotes? It appears to be reliant on that. The issue was logged in our bug database, but wasn't able to make it into one of the recent releases.

F: 11576
Beth Kieler
SourceGear Technical Support

kfsone
Posts: 20
Joined: Mon Jun 02, 2008 1:48 pm
Location: Bedford, TX

Re: soscmd requests

Post by kfsone » Sat Aug 21, 2010 7:12 am

"are there areas in your command where you have to use quotes"

Not that I'm aware of. I'm doing this with -command interactive, and it seems to dislike quoted parameters.

kfsone
Posts: 20
Joined: Mon Jun 02, 2008 1:48 pm
Location: Bedford, TX

Re: soscmd requests

Post by kfsone » Sat Aug 21, 2010 7:18 am

Ahh - that may have been another contributing factor - there are some filenames later with spaces in them, but thats much further into the repo than I was getting previously.

I found that I just need to escape them with a slash, i.e.

Some File.url

becomes

Some\ File.url

- Oliver

kfsone
Posts: 20
Joined: Mon Jun 02, 2008 1:48 pm
Location: Bedford, TX

Re: soscmd requests

Post by kfsone » Tue Aug 24, 2010 1:52 pm

Spoke too soon on that last... This is under Linux with the most recent SoS client for Linux;

I use a wrapper, "sosdo", which adds the database, username and password.

osmith@luciddev:~/sos2svn$ sosdo -command GetFileHistory -project '$/ww2data/ww2mods/DATA/vehicles/aircraft/ju87b' -file 'Ju87b\ performance.xls' | head -10

dchristopher
07/23/2010 09:43

1.31.4.255

dchristopher
07/16/2010 10:09

1.31.3.255
So far so good,
osmith@luciddev:~/sos2svn$ sosdo -command GetFile -project '$/ww2data/ww2mods/DATA/vehicles/aircraft/ju87b' -file 'Ju87b\ performance.xls'
Error: Server response = 400 OperationFailed
Don't see anything in the log (but I could be looking in the wrong place)

I am able to retrieve the file with the SoS UI though.

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

Re: soscmd requests

Post by Beth » Tue Aug 31, 2010 10:33 am

Would it be possible to get a refresh on the 4.2 'soscmd' utility?
Can you describe in further detail what you are looking for here? Do you mean for it to check what you have on disk and update it or something else?

On the interactive mode, try using -alias when you first start interactive mode instead of -database. In my tests, I didn't need to use -alias again if I used -alias when I first start interactive mode. I did find that if I used -database that I had to use -database with commands. I've haven't tested this with all commands, but I have with GetFileList, GetFileHistory, CheckOutProject, and CheckOutFile. I will log a bug against the interactive mode.
F: 15536

The batch parameter request has been logged. Thank you for your feedback.
F: 15535
Beth Kieler
SourceGear Technical Support

kfsone
Posts: 20
Joined: Mon Jun 02, 2008 1:48 pm
Location: Bedford, TX

Re: soscmd requests

Post by kfsone » Wed Sep 01, 2010 12:32 pm

Would it be possible to get a refresh on the 4.2 'soscmd' utility?
Ah, I just mean an update of the executable, e.g. with the fix for spaces in file names

Code: Select all

osmith@luciddev:~$ sosdo -command GetFile -project '$/ww2data/ww2mods/DATA/vehicles/aircraft/ju87b' -file 'Ju87b\ performance.xls'
Error:  Server response = 400 OperationFailed
osmith@luciddev:~$ sosdo -command GetFile -project '$/ww2data/ww2mods/DATA/vehicles/aircraft/ju87b' -file 'Ju87b performance.xls'
Error:  Server response = 401 NoSuchFileOrProject
Also unable to retrieve the file in interactive mode, whether I use SoS Server 4 or 5.

- Oliver

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

Re: soscmd requests

Post by Beth » Wed Sep 08, 2010 9:48 am

What type of machine are you using the command prompt on? Is it a Windows machine or Unix based?

The SOS server log is found in the same directory that the SOS server is installed to and is called log.txt. What errors correspond to the "Server response = 400 OperationFailed?"

I also added a feature request relating to your use of soscmd from in a scripting language.
F: 15543
Beth Kieler
SourceGear Technical Support

kfsone
Posts: 20
Joined: Mon Jun 02, 2008 1:48 pm
Location: Bedford, TX

Re: soscmd requests

Post by kfsone » Fri Sep 10, 2010 2:45 pm

Soscmd under Linux, server on Windows Server 2003R2. Neither 4.2 or 5.0 server give anything useful, this is from 5.0:
2010-09-10 15:35:45,940 - Connection accepted from 192.168.0.52:50760 on local address 192.168.0.7:8535, session id is 1.
2010-09-10 15:35:51,534 - 09/10/2010 15:35:51 - Server Exception (400): [C:\Program Files\SourceGear\SourceOffSite 5 Server\temp\<snipped>\ju87b] - OPERATION_FAILED
2010-09-10 15:35:51,659 - 1: Server Error: 400
2010-09-10 15:35:52,440 - 1: VSS database closed for the session id 1.

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

Re: soscmd requests

Post by Beth » Fri Sep 10, 2010 3:49 pm

Could you increase the logging level to get more information about what's going on with that error? Instructions are posted in the SOS manual: http://download.sourcegear.com/misc/sos ... ER_LOGGING. Debug may make for a large log, but I think it would help narrow down the issue.

When completed, recreate the scenario, and then post the portion of the log that relates to the creation of the 400 error.
Beth Kieler
SourceGear Technical Support

Post Reply