Simple CLC question
Moderator: SourceGear
Simple CLC question
Being primarily a GUI client user, I haven't had much need for the CLC other than a few basic commands used during our build. Now that I am getting our OS X based designers on board, I am using it much more since it is the only OS X option. I hope this is a simple question.
I am trying to use the LISTFOLDER command and it docs say it should list the contents of a folder. The default is recursive and it lists everything beneath it. Fine. But if I use the -norecursive option, instead of listing just the contents of the folder without recursion, it just returns the folder itself. Is there a way to just list the children of a folder without recursion?
I hope I am missing something easy! Thanks.
-stephen
I am trying to use the LISTFOLDER command and it docs say it should list the contents of a folder. The default is recursive and it lists everything beneath it. Fine. But if I use the -norecursive option, instead of listing just the contents of the folder without recursion, it just returns the folder itself. Is there a way to just list the children of a folder without recursion?
I hope I am missing something easy! Thanks.
-stephen
I've logged a enhancement request for this change.
If you need results now, the only option is grabbing the latest Command Line Client source code - ClientAPI.zip, modify the method WriteFolder() so it lists both files / folders, and recompile a *new* command line client.
As a sample, you could write something like:
HTH
If you need results now, the only option is grabbing the latest Command Line Client source code - ClientAPI.zip, modify the method WriteFolder() so it lists both files / folders, and recompile a *new* command line client.
As a sample, you could write something like:
Code: Select all
void WriteFolder(VaultClientFolder vcfolder, bool recursive, int depth)
{
WorkingFolder wf = _ci.GetWorkingFolder(vcfolder);
_xml.Begin("folder");
_xml.AddPair("name", vcfolder.FullPath);
if (wf != null)
{
_xml.AddPair("workingfolder", wf.GetLocalFolderPath());
}
foreach (VaultClientFile file in vcfolder.Files)
{
_xml.Begin("file");
_xml.AddPair("name", file.Name);
_xml.AddPair("version", file.Version);
_xml.AddPair("length", file.FileLength);
_xml.AddPair("objectid", file.ID);
_xml.AddPair("objectversionid", file.ObjVerID);
string strCheckOuts = _ci.GetCheckOuts(file);
if (
(strCheckOuts != null)
&& (strCheckOuts.Length > 0)
)
{
_xml.AddPair("checkouts", strCheckOuts);
}
if (wf != null)
{
WorkingFolderFileStatus st = wf.GetStatus(file);
if (st != WorkingFolderFileStatus.None)
{
_xml.AddPair("status", GetStatusString(st));
}
}
_xml.End();
}
foreach (VaultClientFolder subfolder in vcfolder.Folders)
{
_xml.Begin("folder");
_xml.AddPair("name", subfolder.Name);
_xml.AddPair("version", subfolder.Version);
_xml.AddPair("length", subfolder.FileLength);
_xml.AddPair("objectid", subfolder.ID);
_xml.AddPair("objectversionid", subfolder.ObjVerID);
if (recursive == true)
{
WriteFolder(subfolder, recursive, depth+1);
}
}
_xml.End();
}
Jeff Clausius
SourceGear
SourceGear
ListFolder in the 4.1.2 command line client will list all folder contents if -norecursive has been specified.
Subscribe to the Fortress/Vault blog