views:

144

answers:

2

I created a label using the new label context menu: I defined the parameters as follows: (unlocked)

Label:
ms_test

Description:
Created by ms

view:

//depot/Projects/Shared/...    
//depot/Projects/AddIn/...

The label is created and shown in the label pane but when I select the label and click on the "List files at ms_test" menu item the log message states "Label ms_test points to 0 files".
Any ideas about why the label is not pointing to any files? How can I make this label to work?
thank you in advance.

Note: I have checked that the view paths are correct and there are file contents and subfolders under then.
I am using P4 client version 2006.1.105584 with no filter on the depot and my client is set to client view of the depot

+1  A: 

That means no p4 labelsync or p4 tag commands occurred after the p4 label took place.

Did you create the label as described here?

The following instructions apply to the Windows client (P4WIN) only.

  • Click the label toolbar button to show the labels page.
  • Make a new label (right-click in the list); Give it a useful description.
  • Restrict the View to that needed by the project being labelled (See Using Wildcards and - - Excluding Files for examples).
  • Drag the project files from the depot over to the label;
    Select Add/Replace Files Listed in Label… from the popup menu.
    Perforce will open a dialog offering to replace the contents of the label
    .
  • Click Ok to add the files.

Even if your label currently references no files, you still can sync it with files:

  • Select the label from the Labels pane
  • Right-click to bring up the shortcut menu
  • Select Sync specific files to bring up a sync dialog
  • Click Select All
  • Click Ok
VonC
I use p4 labelsync as this requirement has to go in the automatic build. All your suggestions works OK too.
mas_oz2k1
A: 

I suspect VonC's answer is pointing in the right direction. On a sidenote, it is worth pointing out that Perforce Labels are badly named and work very very differntly to Labels in virtually any other SCM system.

From the Docs

A Perforce label is a set of tagged file revisions. You can use labels to reproduce the state of these files within a client workspace. Labels provide a method of naming important sets of file revisions for future reference. For example, you might want to tag the file revisions that compose a particular release with the label release2.0.1. At a later time, you can retrieve all the tagged revisions into a client workspace by syncing the workspace to the label.

Create a label when you want to:

  • keep track of all the file revisions contained in a particular release of software,

  • distribute a particular set of file revisions to other users, or

  • branch from a known set of file revisions.

Essentially what this goobledygook means is that whereas most people use Labels to do exactly what a Changelist number does (eg. Mark a particular point in time) it infact marks the set of files currently synced to in a particular client. This is a bizarre quirk of Perforce and possibly the worst design decision they made in an otherwise wonderful product.

You are probably better off taking note of the changelist number you want (generally the latest at a point in time) and the paths you wish to sync to , that is all the information you need to sync to a point in time.

Toby Allen
Not all file sets can be expressed as a change number. While finishing a development, it happens that you want to exclude the results of some earlier check-ins. You don't want to have to temporarily check-in older versions just to be able to pick one change number...
pascal
Agreed and what you have outlined is exactly what Perforce Labels do, however what most people use Labels for is as a point in time which is really really wasteful in perforce.
Toby Allen