2

Is there a way to apply two ClearCase labels from a command line ( on Windows ) in a single cleartool find command running on a snapshot view ? Meaning when running this simple command I want that 2 labels (REL3 and REL3_NEW) will be applied and not just REL3

  cmd-context find . –version 'version(\main\LATEST) && ! lbtype(REL3)' ^
  –exec 'cleartool mklabel –replace REL3 %CLEARCASE_XPN%'
Epligam
  • 741
  • 2
  • 14
  • 36

2 Answers2

1

You can try and concatenate the two mklabel:

cleartool find . –version 'version(\main\LATEST) && ! lbtype(REL3)' ^
 –exec 'cleartool mklabel –replace REL3 %CLEARCASE_XPN% && cleartool mklabel –replace REL2 %CLEARCASE_XPN%'

(The mklabel command supports only one label-type-selector, and multiple pnames)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • This did not seem to work in a cygwin (actually MSys2) shell; of course there is the issue that cleartool probably invokes cmd for the `-exec` part and that there is another indirection involved. – Peter - Reinstate Monica Sep 06 '19 at 11:16
  • @PeterA.Schneider That is possible. I don't use cygwin, and Msys2 was barely a year old when I wrote this answer. – VonC Sep 06 '19 at 11:50
1

I found this to be working:

  cleartool find %1 -cview -version "{brtype(branch) && !version(.../(branch/0) && !version(.../(branch/CHECKEDOUT) && !lbtype(REL3)}" -exec "cleartool mklabel -replace REL3 \"%%CLEARCASE_XPN%%\"" -exec "cleartool mklabel -replace REL3_NEW \"%%CLEARCASE_XPN%%\""
Epligam
  • 741
  • 2
  • 14
  • 36