[p4] Obtain a clean workspace [Re: Is there a way to auditaworkspace?]

Jamie.Echlin at barclayscapital.com Jamie.Echlin at barclayscapital.com
Tue Aug 18 10:46:21 PDT 2009


Totally agree with you. I think this would be mitigated somewhat if
there was an easy and clean way to list any local files that are not in
perforce, other than "find . -type f | p4 -x - add -n | grep -v "can't
add existing file".

Something like "p4 localfiles ...". I think the worry here is that there
are additional local files, so people are doing an rm -rf and sync -f.

Cheers, jamie

> -----Original Message-----
> From: perforce-user-bounces at perforce.com 
> [mailto:perforce-user-bounces at perforce.com] On Behalf Of Matt 
> Janulewicz
> Sent: 18 August 2009 18:16
> To: Paul-Marc Bougharios
> Cc: Slava Imeshev; perforce-user at perforce.com
> Subject: Re: [p4] Obtain a clean workspace [Re: Is there a 
> way to auditaworkspace?]
> 
> I'm still wondering why people 'distrust' Perforce so much 
> and want clean workspaces so often. The tool was obviously 
> purchased to feel a need and I still think there are enough 
> facilities built in to Perforce to not *have* to do clean 
> syncs all the time.
> 
> Our build processes rarely do clean syncs for day-to-day 
> continuous builds. In the games industry, for instance, you 
> might be talking about dozens of gigs of syncing for a build. 
> Why bother? Leverage the tool, re-educate, play to the 
> strengths of Perforce instead of working around perceived weaknesses.
> 
> 
> -Matt
> 
> 
> Paul-Marc Bougharios wrote:
> >
> > Another way of having a "clean" workspace is to delete and 
> recreate it 
> > from Perforce side only.
> > It can be done by doing:
> > p4 have > have.log
> > p4 client -o > client.log
> > p4 client -d
> > p4 client -i < client.log
> > p4 -x have.log flush
> >
> > If there is a portion not needed, one would "un-sync" the path 
> > concerned before executing the above commands.
> > As a reminder, "un-syncing" can be done by:
> > p4 sync //PATH/...#0
> >
> > Cheers,
> > Paul-Marc Bougharios
> >
> >
> > On Tue, Aug 18, 2009 at 6:53 PM, Richard Kistruck
> > <rhsk at ravenbrook.com>wrote:
> >
> > > (Note change of topic, from auditing an existing workspace, to
> > obtaining a
> > > new clean one).
> > >
> > > On 2009-08-18Tue, at 04:31, Slava Imeshev wrote:
> > >
> > >> p4 sync -f a bullet-proof way of having a clean build
> > >>> workspace, which is a good idea for release/QA builds.
> > >>>
> > >>
> > >> I should have mentioned that "bullet-proof" implied emptying the 
> > >> build workspace before running p4 sync -f.
> > >>
> > >
> > > "sync -f" DOES NOT overwrite open files.  If you want to obtain a 
> > > clean workspace, you must revert all open files first, or 
> no amount 
> > > of syncing will help you.
> > >
> > >  <
> > > 
> > 
> http://www.perforce.com/perforce/doc.091/manuals/cmdref/sync.html#1040
> > 665>
> > >
> > > (And, even worse, when you have an open file, "p4 sync 
> -f" gives a 
> > > potentially misleading report of "myfile.txt - file(s) 
> up-to-date."
> > -- try
> > > it!  Your p4 version may differ...)
> > >
> > >
> > >
> > > To obtain a clean workspace, starting from nothing, one suitable
> > procedure
> > > is:
> > >
> > >  1.  p4 revert mywork/...
> > >  2.  rm -rf mywork
> > >  3.  p4 sync -f mywork/... at NNN
> > >
> > > Discussion: The "revert" is necessary to close any 
> p4-opened files.  
> > > You probably want to check for them with "p4 opened mywork/..." 
> > > before
> > blindly
> > > reverting them all!  For anyone who doesn't speak Unix, 
> the "rm -rf" 
> > removes
> > > the "mywork" directory and everything it contains.
> > >
> > > (One more note: If you are doing this from a script, and 
> relying on
> > it for
> > > a product that carries your reputation, then you had better also
> > make sure
> > > your script checks for and halts if there are any errors 
> from the p4 
> > > commands, such as from the network going down!)
> > >
> > > Again: this is the procedure I use, to obtain a small clean
> > workspace from
> > > scratch; corrections or improvements are welcomed.
> > >
> > > Richard Kistruck
> > > Ravenbrook Limited
> > > _______________________________________________
> > > perforce-user mailing list  -  perforce-user at perforce.com 
> > > http://maillist.perforce.com/mailman/listinfo/perforce-user
> > >
> > _______________________________________________
> > perforce-user mailing list  -  perforce-user at perforce.com 
> > http://maillist.perforce.com/mailman/listinfo/perforce-user
> >
> _______________________________________________
> perforce-user mailing list  -  perforce-user at perforce.com 
> http://maillist.perforce.com/mailman/listinfo/perforce-user
> 
_______________________________________________

This e-mail may contain information that is confidential, privileged or otherwise protected from disclosure. If you are not an intended recipient of this e-mail, do not duplicate or redistribute it by any means. Please delete it and any attachments and notify the sender that you have received it in error. Unless specifically indicated, this e-mail is not an offer to buy or sell or a solicitation to buy or sell any securities, investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Barclays. Any views or opinions presented are solely those of the author and do not necessarily represent those of Barclays. This e-mail is subject to terms available at the following link: www.barcap.com/emaildisclaimer. By messaging with Barclays you consent to the foregoing.  Barclays Capital is the investment banking division of Barclays Bank PLC, a company registered in England (number 1026167) with its registered office at 1 Churchill Place, London, E14 5HP.  This email may relate to or be sent from other members of the Barclays Group.
_______________________________________________




More information about the perforce-user mailing list