[p4] Erasing sync history?

Tony Sweeney sweeney at addr.com
Tue Sep 4 20:11:44 PDT 2007


Roy Smith wrote:
> A colleague recently removed a workspace by doing "rm -rf" on the  
> root directory.  He thought he was done working on that branch and  
> wanted to free us some disk space.
>
> Some time later, he had to work on that branch again and so he just  
> did a "p4 sync" on that client, and was surprised when only a small  
> number of files appeared.  The answer, of course, is that perforce  
> didn't know he had removed the directory and only updated the files  
> that had changed since his last sync.
>
> I know you can do a "sync -f", and told him to do that, but he's  
> looking for something more.  He's looking for a way to tell perforce  
> that the files no longer exist on local storage, so the next time he  
> does a "p4 sync", (without the -f), they come back.
>
> Is the answer to do the "rm -rf", and then do a "p4 flush"?  It  
> sounds promising, but it's not really clear from the help text what  
> this is supposed to do.
>
> I'm not exactly sure what's motivating him to find something better  
> than "p4 sync -f", but I told him I would research it.  I think he  
> may be worried that keeping track of the metadata about what files  
> he's got in his workspace may be wasting resources on the server.  I  
> told him I thought the storage needed to that was pretty minimal, but  
> that's just a guess.  Is it?
>   
I can't speak for your colleague, of course, but some of us just don't 
like loose ends.  I believe the technical term is 'anal-retentive'.  You 
can use 'p4 flush' with the #none (or equivalent #0) revision in the 
client to tell Perforce that you no longer have the files.  Just 'p4 
sync ...#none' would do this too, and is the preferred way of purging a 
client in the regular case where you still have the files, since it also 
removes them in the same operation.  In this case, though, the local 
files are already gone, so you only want to update the metadata, which 
is exactly what 'p4 flush' is for.  Clients can vanish for many reasons 
-- overzealous cleanup, failed hard drives and re-imaged machines being 
fairly common cases.  Orphaned have list data bloats the db.have file to 
no good purpose, potentially slows down the server, and increases both 
the size and duration of checkpoint and backup operations, so it 
certainly doesn't hurt to keep on top of it.  But an orphaned client 
have list takes only the same server space as any similar extant client, 
so it isn't necessarily critical...

Tony.
> -------------------
> Roy Smith <smith_roy at emc.com>
> Software Guy, EMC Common Management Group
> 44 South Broadway, 7th floor
> White Plains, NY 10601
> (914) 580-3427
> AIM: roysmith649
>
> _______________________________________________
> perforce-user mailing list  -  perforce-user at perforce.com
> http://maillist.perforce.com/mailman/listinfo/perforce-user
>
>
>   


-- 
quis custodiet ipsos custodes? -- Juvenal VI, 347-8


More information about the perforce-user mailing list