2

The config spec of a CCRC view can be synchronized with the stream from CCRC eclipse UI by calling 'Refresh->Update from repository'.

I wanted to know if there is a way to do it from command-line. I have tried 'rcleartool update' command. But I don't think it actually updates the config spec of the view from the stream. I might be wrong ??

Has anyone tried this using CM API? Or any other approach?

Jayan
  • 18,003
  • 15
  • 89
  • 143
Veera
  • 266
  • 1
  • 8

2 Answers2

2

com.ibm.rational.wvcm.stp.cc.CcView.doRefresh() method solves this problem.

More documentation on how to get a CcView object and javadoc should be available in your CCRC installation - C:\Program Files\IBM\Rational\common\CM\teamapi.zip.

Unzip and see - projects\samples\doc\index.html for sample programs.

--- More details..Sample code ---

StpProvider provider = (StpProvider) ProviderFactory.createProvider(
                    CcProvider.CC_ONLY_PROVIDER_CLASS,
                    new DefaultCallback());
provider.setServerUrl(<CM SERVER URL>);
m_provider = provider.ccProvider();

File viewRoot = new File(<PATH TO VIEW ROOT>);
StpLocation viewLocation = provider.filePathLocation(StpProvider.Domain.CLEAR_CASE, viewRoot);

// Get instance of CcView that represents the CCRC view.
CcView view = provider.ccView(viewLocation);

// Options while updating view
CcFile.RefreshFlag[] refreshFlags = new CcFile.RefreshFlag[1];
refreshFlags[0] = CcFile.RefreshFlag.OVERWRITE_HIJACKS;

PropertyRequestItem.PropertyRequest properties = new PropertyRequestItem.PropertyRequest(CcView.DISPLAY_NAME, CcView.CONFIG_SPEC);

view.doRefresh(refreshFlags, properties);
Veera
  • 266
  • 1
  • 8
1

I don't see that feature available when looking at the list of rcleartool commands.

The cleartool (not rcleartool) command behind a "synchronize with stream" is

cleartool setcs -stream

(See "Synchronize with stream clear case integration view" for more)

And setcs isn't part of the rcleartool commands.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • We were using clearcase with UCM and it was pretty easy to do it with setcs command. But as you point out, there isn't a easy to replace command to do this in CCRC. Back to exploring options with CM API. – Veera Apr 02 '12 at 10:39
  • @Veera: if you find a "cm api"-based solution, let us know by posting an answer here. – VonC Apr 02 '12 at 10:48