Blog  |  Contact Us
Welcome to the Seapine Software Community Forums. Because these forums are user-to-user based, Seapine technical support does not regularly read or reply to the posts in this forum. For problem reports, suggestions, or feature requests, please visit http://www.seapine.com/support.html.

Printer-friendly copy Email this topic to a friend
Top Surround SCM General Discussions topic #1378

Subject: "Repository Differences from CLI" Previous topic | Next topic
rbergTue Apr-19-11 10:06 PM
Member since Apr 19th 2011
1 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
"Repository Differences from CLI"


          

I am wondering if there is any way to find missing local
files, like the Repository Differences does to get a list of
files that have not been added to SCM through the CLI or API?
Ideally I would like to create a report like Repository
Differences does but through a program.

  

Printer-friendly copy | Reply | Reply with quote | Top

Replies to this topic

vincentpWed Apr-27-11 06:34 PM
Member since Nov 29th 2010
8 posts
Click to send email to this author Click to send private message to this authorClick to view this author's profileClick to add this author to your buddy list
#1. "RE: Repository Differences from CLI"
In response to Reply # 0
Wed Apr-27-11 06:35 PM by vincentp

          

There is no single API or CLI command that will programmatically return results similar to the Surround SCM GUI's Repository Differences dialog. However this could be done through a combination of API commands or through a combination of CLI commands.

Supposing the input to the program was the path to the local working directory and the Surround SCM Branch // Repository that you wanted to perform the differences with, I would do the following using the Surround SCM API:
1. Find a listing of the files in the local directory.
2. Use the API's "listFilesInRepo" and "listSubrepos" to find a list of files that are in Surround SCM.
3. Recursively walk through the lists of files and check to see if a file exists both in the list retrieved from Surround and the files listed from the local directory.

*Note* The API does not use Working Directories and as such it will not be able to tell the "state" of a file, ex. "modified" or "old". This method will only let you know if a file has been added to Surround SCM or not.

Using the CLI would involve more parsing of the text from commands, but it could provide more information. I would use the command "sscm ls -w -r -bTargetBranch -pTargetRepository -yUsername:password -zServerHost:Port"

The -w parameter will list the working directory for repositories that are listed, the -r parameter will make the command recursive.

Parsing this output will provide a list of files that exist in Surround SCM along with the local path to the working directories that the files exist in. Using this path and file listing information along with a separate list of files that exist locally it should be possible to determine what files are missing from Surround SCM. It would also be possible with this method to determine the states of the files ("modified", "old", "unknown", etc)

  

Printer-friendly copy | Reply | Reply with quote | Top

Top Surround SCM General Discussions topic #1378 Previous topic | Next topic
Powered by DCForum+ Version 1.27
Copyright 1997-2003 DCScripts.com
© 2014 Seapine Software, Inc., All rights reserved.