[p4] Synchronization issues

Matthew Rice matt at starnix.com
Thu Aug 1 04:35:21 PDT 2002


"Mohan  Janam" <perforce at rediffmail.com> writes:
> 1. Is there any p4 command to get the "list of files that are 
> changed or newly added" from a "branch"?
> 2. Or is it required to write a script in PERL or some other 
> language to get the list of files from the branch.

I'm not 100% certain what you're asking for here.  Do you mean files that are
changed and files that are newly added froma branch?  Or files that have had
new changes intergrated (freshly copied, merged, ignored, ...) from a
'branch'?

Either way you need to decide on a point of origin.  Changed or added since
when?  There's a lot of flexibility available so if you let us know what you
want to do and we can help.

Sorry for not answering this one.  You may also find reading the help on the
commands 'filelog', 'files', and 'changes [-i]', and 'integrated' useful.
Look at the ouput and you may find the information that you need.


> 1. But if some files, (Which are also in the client Depot) are 
> deleted in the Server Depot, those files should be deleted from 
> the client Work Space also when I synchronize the client Work 
> Space with the Server Depot.

That is what happens.  Unless you're using 'p4 obliterate' :)


> 2. But if some folders, (Which are also in the client Depot) are 
> deleted in the Server Depot, those folders should be deleted from 
> the client Work Space also when I synchronize the client Work 
> Space with the Server Depot.

Use the Option 'rmdir' in your client spec (ie. p4 client).  This is the only
default that I consistently change when creating a new workspace.


> 3. But if some directories, (Which are also in the client Depot) 
> are deleted in the Server Depot, those directories should be 
> deleted from the client Work Space also when I synchronize the 
> client Work Space with the Server Depot.

See #2 above.  What's the difference between a directory and a folder?

I should also point out that Perforce doesn't really manage directories.
It manages files which happen to get placed in different directories.
Perforce will only delete the directory on the client side when you have
'rmdir' set and the directory is empty.  By empty, I mean _empty_.  No
Perforce files, no stray .o, *~, .bak, .orig, or .tmp files.

Appropriate permission on the client directories is also needed, of course ;)


> So far I have not written PERL Scripts. So if you have any ready 
> made scripts in PERL for this kind of actions kindly send me.

You don't have to use Perl.  If you want to use the p4 command line to
control things, I can't think of a language that won't let you do this.

HTH,
-- 
matthew rice <matt at starnix.com>                               starnix inc.
phone: 905-771-0017 x242                        thornhill, ontario, canada
http://www.starnix.com              professional linux services & products



More information about the perforce-user mailing list