[p4] Syncing only to labeled files using p4 command line

Nau, Michael Michael.Nau at cardinal.com
Wed May 3 20:46:58 PDT 2006


Assuming the set of files is under one common directory\area... can't
you just do p4 sync //depot/path/to/files/... at labelname? This should
leave all other files within your clientspec not included in the
specified path in-tact

-Mike

-----Original Message-----
From: perforce-user-bounces at perforce.com
[mailto:perforce-user-bounces at perforce.com] On Behalf Of
Ken.Williams at thomson.com
Sent: Wednesday, May 03, 2006 12:13 PM
To: jgrills at junctionpoint.com; perforce-user at perforce.com
Subject: Re: [p4] Syncing only to labeled files using p4 command line

Sure, it's relatively easy to "figure out" how to do it, but not to
actually *do* it. =)  P4Win seems to just do "p4 fstat
//... at LastWorkingRevision", then for each selected file sync to the
appropriate revision individually.  It also seems to use the revision
number, not the label name, when syncing, though I might be wrong on
that.

In order to translate that to the command-line environment I'd have to
do some scripting, which is fine (something like "p4 files
... at LastWorkingRevision | perl -pe 's/(#\d+).*/$1/' | p4 -x- sync -n"
would probably be workable), but I thought I should be able to do it
directly with a revision spec for "p4 sync" directly.

 -Ken

> -----Original Message-----
> From: Jeff Grills [mailto:jgrills at junctionpoint.com]
> Sent: Wednesday, May 03, 2006 1:20 PM
> To: Williams, Ken (TLR Corp); perforce-user at perforce.com
> Subject: RE: [p4] Syncing only to labeled files using p4 command line
> 
> 
> Following the "Teach a person to fish" philosophy...
> 
> If you know how to do something in p4win, it's relatively easy to 
> figure out how to do the same thing from the command line.  
> Right-click the output box at the bottom of p4win and check the "Show 
> P4 Commands" entry (I also check the Timestamps and Status Messages 
> entries as well, but that's not necessary for this).  Now, any time 
> you perform an operation in p4win, the corresponding command line 
> command is also displayed.
> 
> j
> 
> -----Original Message-----
> From: perforce-user-bounces at perforce.com
> [mailto:perforce-user-bounces at perforce.com] On Behalf Of
> Ken.Williams at thomson.com
> Sent: Wednesday, May 03, 2006 11:57 AM
> To: perforce-user at perforce.com
> Subject: [p4] Syncing only to labeled files using p4 command line
> 
> Hi,
> 
> This strikes me as a question I should probably already know 
> the answer
> to, but I couldn't seem to find it from perusing the Tech Notes on
> labels, or the section of Chapter 6 in the docs on labels.
> 
> I've got a label called "LastWorkingRevision", which is a light-weight
> way for our developers to indicate the last working revision 
> of a set of
> files they're working on when they know the head revision is broken.
> The idea is that if syncing to head & building & testing fails, team
> members should be able to sync to head then sync to this label and
> probably get a working build.
> 
> Using p4win, we can sync to head, then right-click on the label and
> select "sync specific files to label" to achieve this effect. 
>  Using the
> p4 command-line client (on Linux) though, I'm not sure what 
> the easiest
> way is.  If we do "p4 sync ... at LastWorkingRevision", all files not
> mentioned in the label are deleted.
> 
> Any tips?
> 
>  -Ken
> 
> 

_______________________________________________
perforce-user mailing list  -  perforce-user at perforce.com
http://maillist.perforce.com/mailman/listinfo/perforce-user

Cardinal Health -- Working together. For life. (sm)
_________________________________________________

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.

Dansk - Deutsch - Espanol - Francais - Italiano - Japanese - Nederlands - Norsk - Portuguese - Svenska: www.cardinalhealth.com/legal/email



More information about the perforce-user mailing list