Getting the working directory with soscmd

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

Moderator: SourceGear

Post Reply
Chris Rowland
Posts: 5
Joined: Thu Jun 17, 2010 3:13 am

Getting the working directory with soscmd

Post by Chris Rowland » Fri Jun 18, 2010 7:17 am

Is there a way to get the working directory using soscmd?

I'm trying to convert some source code management applications from using VSS to using SOS. We are currently reading the working directory for a project using VSS and it would be useful if we could get it from SOS in some way.

So far the best I've seen is to look in the server folder, find the databasex.sos file from the database in the index.sos file, read the 4th line in databasex.sos file to get the project root path and replace the $ in the project with this path.

This feels pretty fragile and I'm not very confident about it, even for an internal project.

We are currently using SOS 3.5.3.

Thanks,

Chris

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Getting the working directory with soscmd

Post by lbauer » Fri Jun 18, 2010 12:06 pm

There's no way to get the working directory with the SOS Command Line Client. However, you should be able to use the -soshome parameter so that the CLC will do Gets to the working directory.

From soscmd.txt:

2. SPECIFYING THE "SOURCEOFFSITE HOME DIRECTORY"
================================================
Some abilities of the Version 3.5 Command Line Client depend on the
presence of the SourceOffSite GUI Client on the machine. If using
the Command Line Client with encryption, the GUI Client must be
installed on the same machine (please see the Encryption section
below for more details).

The SourceOffSite home directory is created when the GUI Client is
installed. This is the directory where imported encryption keys are
stored along with file and project information.

If the SourceOffSite home directory is specified, the Command Line
Client will use the same cache file (databaseX.sos) as the GUI Client
to determine file status and working directories.

Specifying the SourceOffSite home directory will speed up large file
retrieval operations, such as GetProject and CheckOutProject, as only
files that need to be updated will be retrieved. Files that you have
locally that have not changed in the database will not be retrieved.
If a SourceOffSite home directory is not specified, the Command Line
Client will retrieve ALL files during project retrieval operations.

If the SourceOffSite home directory is specified, the Command Line
Client will also look to the cache file to determine working
directories. In such a case, by default the working directories set
up in the GUI Client will be used by the Command Line Client.

The path to the SourceOffSite home directory can be specified using
the -soshome parameter on a command by command basis or the path can
be specified by setting a SOSHOME environment variable. The default
location for the SourceOffSite home directory on Windows is
Program Files > SourceOffSite. On Unix, the name of the
SourceOffSite home directory is ".sos", and its default location is
in the user's Unix home directory.

- IMPORTANT NOTE ON USING THE SOURCEOFFISTE HOME DIRECTORY -

In order for proper functioning, if you will be specifying the path
to the SourceOffSite home directory when using the Command Line
Client, the SourceOffSite GUI Client must be upgraded to Version
3.5. Also, since both the GUI Client and the Command Line Client
will be writing to the same SourceOffSite home directory, both
Clients should not be run simultaneously.

Parameter Value
-------- -----

-soshome The path to the SourceOffSite home directory (if the
SourceOffSite GUI Client is installed).

FYI -- support for SOS 3.5.x is ending next month:

http://support.sourcegear.com/viewtopic ... 10&t=13122
Linda Bauer
SourceGear
Technical Support Manager

Post Reply