I am developing some MKS Integrity 2009 automation tools using the "si" cli. I was wondering if there was an easy command to retrieve the contents of a text file member with a specific revision (similar to double clicking the revision in the "Member History" GUI window). I would prefer the file contents echo to the command prompt to make integration with my automation SW easier.
If there's not an easy way to do this, what would be ANY way to do this via CLI? My thought was: Create a sandbox, checkout the member with a specific revision, stream it into my tool via file system calls, then delete the sandbox?
There may well be an easier way that I haven't ever learned, but your idea to use a sandbox will definitely work. To minimize overhead, you can create the sandbox localized to the directory you want,use --nopopulate to avoid wasting time on neighboring files, and then resync just the file you want. Of course for historical revisions you will have to derive the appropriate checkpoint for a build sandbox. All tedious but doable.
I don't know a better way either than having to create a sandbox:
% create sandbox
cmdstr=sprintf('si createsandbox --noopenView --project=$MKS.pj --forceConfirm=no --nopopulate --norecurse "%s"',destdir);
% checkout with no lock to get specific revision
cmdstr='si co --nolock -f --revision=$MKS.rev $MKS.file';
% drop sandbox
cmdstr=sprintf('si dropsandbox --forceconfirm=yes --delete=none %s/project.pj',destdir);
if you are interested in only one file's content, the "si projectco" command will work best for you.
It is more or less a simple "download" command that stores a specified member in a specified revision to any specified location.
NO Sandbox at all is needed.
thank you very much. This works great: without sandbox!
It seems not to be officially supported for CLI usagea nd really documented:
In I10.4 CLI guide:
si projectco checks out project members of a project into working files.
Check out is an operation that extracts the contents of a revision in an archive and copies it to a working file. You can check out any revision by
specifying either its revision number or label. By default, the member revision is used. If an existing revision other than the head revision is
specified, a branch from that revision is created.
I've noticed as well that the --project= syntax does not work but the -P does.
My command looks like:
cmdstr=sprintf('si projectco --nolock --overwriteExisting -P %s --noupdate --restoreTimestamp --revision=$MKS.rev --targetFile="%s" %s',...
Are you sure that doesn't work if you replace -P %s with --project=%s? That seems very strange, since that certainly works on the command line.
BTW: is is possible that your %s variable for the project path starts with a backspace? IMHO that could explain why the "--project=" syntax does not work.
Well for me in my use cases (outside any batch scripts) the "--project=" syntax works just fine (using 2009 - I10.4)
Hello Thierry, Matthias,
Both -P and --project= syntaxes worked for me, for 2009 SP6, 10.4, and 10.5.
Did any of the ideas suggested by Dave, Theirry, or Matthias help you with this? If so, please let us know by marking answers correct or helpful! It lets us know that your problem has been solved, so that we can stop thinking about it, or at least gives us direction for what works for you.
If you let us know what worked for you, or what didn't work for you, and what kind of problems you had, the extra context might remind us of something else, or clarify your challenge in a way that helps us suggest something more useful.