3

I'm trying to recursively delete some versions/files from a specific branch.

find delivers the right files. Now it would be up to rmver to remove the version but this gives me an error. I'm struggling with the syntax.

cleartool> find Component\Test -element "brtype(P_Testing_device)" -exec "rmver -f \"%CLEARCASE_PN%@@\main\G_Testing_device\P_Testing_device\LATEST\""
cleartool: Error: Extra arguments: "%CLEARCASE_PN%@@\main\G_Testing_device\P_Testing_device\LATEST\"

What's wrong with that? How would you recursively delete versions from a Branch?

Maus
  • 2,724
  • 5
  • 32
  • 37

1 Answers1

2

First don't if you can avoid it. rmver, as I explain in "How do I undo a checkin in ClearCase remote client", is very dangerous.
If you have hyperlinks attached to the versions you are removing (definitively from ClearCase), like merge links (deliver or rebase links of your are using UCM), you risk ending up with many "dangling hyperlinks", which is not good.

Second, I would try first:

find Component\Test -element "brtype(P_Testing_device)" -exec 'rmver -f "%CLEARCASE_PN%@@\main\G_Testing_device\P_Testing_device\LATEST"'

To rule yout any issue with weak vs. strong quoting (as in "CLEARCASE_XPN not parsed as variable in clearcase command")

If that doesn't work, I would recommend finding all the right versions and putting them into a file, then piping the content of that file to a cleartool rmver.


A much safer route is to cleartool lock -obs the branch, making it non-modifiable and invisible for the future version trees.

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