1

I am trying to put version information for the release in one of the .cpp files using cleartool desc command.

These are some outputs for different desc commands:

cleartool desc -fmt "%[type]p\n" abc.cpp
Output:text_file

cleartool desc -fmt "%Nl" abc.cpp    // No output
cleartool desc -fmt "%[version]p\n" abc.cpp      //No Output

However, cleartool desc abc.cpp" does generate following output.

cleartool desc abc.cpp
Output: version "abc.cpp@@/main/DI_ABC_XYZ_1.0.0/1"
 created 2015-07-17T10:18:41+05:30 by ggne0118.engg@ggns1tthy01
 "Merge from XYZ 70471"
  Element Protection:
    User : UNIX:UID-999 : r-x
    Group: engg     : r-x
    Other:          : r-x
  element type: text_file
  predecessor version: /main/DI_ABC_XYZ_1.0.0/0
  Hyperlinks:
   Merge -> /data/project/common/XYZ/src/abc.cpp@@/main/1
    Merge <- /data/project/common/XYZ/src/abc.cpp@@/main/XYZ7047th

Why am i not getting any output for these two commands: cleartool desc -fmt "%Nl" abc.cpp // No output cleartool desc -fmt "%[version]p\n" abc.cpp //No Output

Sahil
  • 359
  • 2
  • 5
  • 13
  • Can you explain why you think you should? – Lightness Races in Orbit Sep 29 '15 at 09:54
  • @LightnessRacesinOrbit Is there some other version of desc that'll do this job? I just got introduced to ct desc for the first time and lack of information(or rather lack of clarity in the information) about desc command is making my job difficult which is to extract the version name. Actually, this is a legacy code, and cleartool desc -fmt "%Nl" abc.cpp has done the job so far just fine, but now it is not working as explained. – Sahil Sep 29 '15 at 09:59

1 Answers1

0

When you consider fmt_ccase man page, you would see that:

  • %Nl applies to versions: there might not be any label attached to that version.
    It displays "all attached labels; the null string otherwise": since there is no output, that means there is no attached label to the version currently selected by the view.
  • %[version]p doesn't exist, %n or %Vn would exist.

%[name]p would the same as %n, which, for versions, is the same as %[name]Xp (extended version): %[name]p is always displayed as though X had been specified.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250