How do I determine what files in my ClearCase local view have not yet been added to source control?
Asked Answered
P

3

14

If I have added/removed/modified a large number of files in my local ClearCase view, how can I be certain that all the files have been added to source control?

Preuss answered 10/10, 2008 at 15:25 Comment(0)
Z
8

Your answer is correct, for snapshot views (which you call 'local view' ?)
In a dynamic view, a simple

cleartool lsprivate

would suffice.

But that would leave out hijacked files (which are already added to source control, but may have been modified without ClearCase knowing it)

So I would recommend to complete your command with (for Windows):

for /F "usebackq delims= " %i in (`cleartool ls -r -nxn ^| find "hijacked"`) do @echo %i

For Unix:

cleartool ls -r -nxn | grep hijacked

That would also leave files in checkouts (granted, they also are added to source control, but should be also listed as they must be eventually committed or cancelled).
In Snapshot views:

cleartool lscheckout -recur

In Dynamic views:

cleartool lsprivate –co
Zenger answered 10/10, 2008 at 15:47 Comment(2)
This must be done through command line? no support from the Visual Studio integration? (where i add most of the files anyway)Hirudin
@liortal: no direct "integrated" support, plus my previous answer (#6088559) mentioned a potential bug for CC7.0.x. Having a command line around can be handy at times ;)Zenger
C
8

I use a similar dos command for windows, but I also pipe the results of the clear tool command to findstr to 'ignore' specific patterns (using regex) such as .keep files, dll's, and compiled files and folder locations that I don't want to add to source.

Run the following command from the root folder of your view. If you have multiple top level folders then you'll need to run it once for each folder. Also, I believe this only works for SnapShot views.

cleartool ls -recurse -view_only | findstr /vi ".dll$ .pdb$ .suo$ .keep$ .unloaded$ \\bin$ \\bin\\ \\debug$ \\debug\\ \\release$ \\release\\ \\obj$ \\obj\\ ^cleartool$" > c:\ItemsNotInSource.txt
Chicle answered 22/3, 2012 at 17:17 Comment(1)
Awesome, exactly what I was after, not quite visual studio integration but at least makes the command line useful when using Visual Studio!Kreiker
P
7

Use cleartool ls -view_only -r from the your local view VOB directory.

To add any files recursively to source control that are only in the local view, see How can I use ClearCase to “add to source control …” recursively?.

Preuss answered 10/10, 2008 at 15:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.