[p4] Offline reconciliation: what files need to be added?

Tetrick, Cary ctetrick at midway.com
Wed Jun 13 16:22:15 PDT 2007


We have a batch file (under Windows) that does something like this:

dir /s/b/a-d %1 %2 %3 %4 %5 %6 | p4 -x- have >%TEMP%\have.txt
2>%TEMP%\havenot.txt

(the dir lists files including subdirectories (/s), in bare format (/b),
that are NOT directories (/a-d)).

STDOUT goes to have.txt, STDERR goes to havenot.txt.

The 2 files are combined, and we throw in a P4 opened to go with it.

The final results are then opened in an editor (or otherwise listed).

You could substitute %1 %2 %3, ect with an environment variable or just
a set of file types like *.c *.h *.cpp  ect.

For simpler situations where you might not have a lot of folders, you
can simply use P4 have and give it a path - it will tell you which files
are not on the current client.

-----Original Message-----
From: perforce-user-bounces at perforce.com
[mailto:perforce-user-bounces at perforce.com] On Behalf Of Marc Wensauer
Sent: Wednesday, June 13, 2007 4:00 PM
To: perforce-user at perforce.com
Subject: [p4] Offline reconciliation: what files need to be added?

This KB article provides very useful information on how to reconcile
offline changes:
http://kb.perforce.com/UserTasks/WorkingDisconnected

For my purposes though, I need to *query* what needs to happen before
actually doing it.  For the most part, it's trivial to see what files
will have to opened for delete and edit via 'p4 diff -sd' and 'p4 diff
-se' respectively.

But how do I query my workspace for files that *would* have to be added?
 The 'find . -type f | p4 -x - add' recommendation is rather
brute-force, and doesn't avoid actually performing the operation instead
of just telling me about it.

How might one query for this information?  A recursive 'p4 files' and
grep for "no such file(s).", or is there something else I should
consider?

Thanks for your advice,
-Marc
_______________________________________________
perforce-user mailing list  -  perforce-user at perforce.com
http://maillist.perforce.com/mailman/listinfo/perforce-user



More information about the perforce-user mailing list