cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Get member content

ptc-6380108
1-Newbie

Get member content

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?

10 REPLIES 10

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.

tdalon
4-Participant
(To:dhegland)

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

tdalon
4-Participant
(To:ptc-6380108)

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

mrump
14-Alexandrite
(To:ptc-6380108)

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

tdalon
4-Participant
(To:mrump)

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

KaelLizak
14-Alexandrite
(To:tdalon)

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


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager
tdalon
4-Participant
(To:KaelLizak)

Hi Kael

it was the other way around:

with the CLI for me it did not work using the --project syntax. But using the -P syntax works.

mrump
14-Alexandrite
(To:tdalon)

Hi Thierry,

your welcome

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)

KaelLizak
14-Alexandrite
(To:mrump)

Hello Thierry, Matthias,

Both -P and --project= syntaxes worked for me, for 2009 SP6, 10.4, and 10.5.

-Kael


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager
KaelLizak
14-Alexandrite
(To:ptc-6380108)

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


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager
Top Tags