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

Weintraub, David david.weintraub at bofasecurities.com
Wed May 3 11:41:47 PDT 2006


And what's the problem? Files not mentioned in the label are not part of
the revision. Think of the label as a snapshot of a particular revision.
In the current revision, there's a file "foo.c". This file didn't exist
in my old revision. When I sync to my old revision, I certainly want
Perforce to remove "foo.c" from my snapshot.

So, what are you looking for? All the files with this particular label,
and then all other files without this label? What about my example with
"foo.c" -- files that were added to the current build, but didn't exist
in the previous versions of the build and therefore could by themselves
break the build?

I've seen floating labels like this applied across the entire build, but
not to only a small subset of files. These floating labels are produced
by one of two methods:

* Method #1: Programmer produced. The developer marks the files they
want considered for the build with a label like "build_these". The build
manager checks out all files with this label and does the build.

* Method #2: Build Manager produced. After a successful build, the build
manager puts a "LastWorkingRevision" label across the entire build. The
developers know that this is the last working revision, and syncs that
revision, then syncs those directories and files with the latest code
they are working on.

Personally, I'm not a fan of either method. To me, the latest files on
the release branch should always build. Developers should use a private
development branch for checking files in and out of their client. Once
the developers have finished their coding, they should integrate the
changes on the release branch back onto their development branch, and
retest. If everything is still good, they can then integrate their
changes from their development branch back to the release branch and
make sure the build still works before the final checkin. 

If any developer puts code onto the release branch that doesn't build,
it should be immediately removed or fixed.

-----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:57 PM
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


More information about the perforce-user mailing list