Skip to main content
1-Visitor
July 27, 2014
Question

Get member content

  • July 27, 2014
  • 4 replies
  • 8027 views

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?

    4 replies

    1-Visitor
    July 27, 2014

    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.

    1-Visitor
    July 28, 2014

    To get a specific revision I think a check-out with no lock will do better than a resync.

    1-Visitor
    July 28, 2014

    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);

    16-Pearl
    July 29, 2014

    Hi Jeff,

    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.

    HTH Matthias

    1-Visitor
    July 29, 2014

    Hi Matthias

    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:

    DESCRIPTION

    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',...

    pj,destfile,member);

    16-Pearl
    July 29, 2014

    Hello Thierry,

    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.

    Regards,

    Kael

    16-Pearl
    August 14, 2014

    Jeff,

    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.

    Regards,
    Kael