Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Perforce Lable using changelist number or Date/time

scmuser created the topic: Perforce Lable using changelist number or Date/time
Hi,

I am trying to create a label using Perforce specific change list number or depends on Data and time for entire branch. Could you please help me with it?

scmuser replied the topic: Re: Perforce Lable using changelist number or Date/time
Ww need to understand some of the basic stuff which will help us to resolve this all the time….
To create a label, we will have perform 2 activities –
1. Create a Name of the Lable using following command…
p4 label

2. Sync this lable with client workspace source code.
p4 labelsync -l

this means labelsync will only add the client workspace soruce code to the specific label name. so its completly depends on us what source code we have in our client workspace if not head revsion, then we sync perforce source code via many following ways such as….
1. p4 sync file.c#4
2. p4 sync //depot/proj1/…@21
3. p4 sync @labelname
4. p4 sync @labelname,@labelname
5. p4 sync @2001/06/24
6. p4 sync //depot/proj1/…@2001/06/24

rajeshkumar replied the topic: Re: Perforce Lable using changelist number or Date/time
There are 2 kinds of labels.

1. Static Labels which explain above
2. Automatic Labels, Details and solution can be found below;

You can use automatic labels to specify files at certain revisions without having to issue the p4 labelsync command.

To create an automatic label, fill in the Revision: field of the p4 label form with a revision specifier. When you sync a workspace to an automatic label, the contents of the Revision: field are applied to every file in the View: field.

Example: Using an automatic label as an alias for a changelist number
Earl is running a nightly build process, and has successfully built a product as of changelist 1234. Rather than having to remember the specific changelist for every night’s build, he types p4 label nightly20061201 and uses the label’s Revision: field to automatically tag all files as of changelist 1234 with the nightly20061201 label:
Label: nightly20061201
Owner: earl
Description:
Nightly build process.
Options: unlocked
View:
//depot/…
Revision:
@1234

The advantage to this approach is that it is highly amenable to scripting, takes up very little space in the label table, and provides a way to easily refer to a nightly build without remembering which changelist number was associated with the night’s build process.

Example: Referring specifically to the set of files submitted in a single changelist.
Label: patch20061201
Owner: earl
Description:
Patch to 2006/12/01 nightly build.
Options: unlocked
View:
//depot/…
Revision:
@1238,1238

This automatic label refers only to those files submitted in changelist 1238.

Example: Referring to the first revision of every file over multiple changelists.

You can use revision specifiers other than changelist specifiers; in this example, Earl is referring to the first revision (#1) of every file in a branch. Depending on how the branch was populated, these files could have been created through multiple changelists over a long period of time:
Label: first2.2
Owner: earl
Description:
The first revision in the 2.2 branch
Options: unlocked
View:
//depot/release/jam/2.2/src/…
Revision:
“#1”

Because Perforce forms use the # character as a comment indicator, Earl has placed quotation marks around the # to ensure that it is parsed as a revision specifier.
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

rajeshkumar replied the topic: Re: Perforce Lable using changelist number or Date/time
To create a label using datetime requires the use of static labels. What you do is to do a “p4 sync” to a specific time, such as:

p4 sync @2011/03/18

Then tag the files with a label:

p4 tag -l //depot/…

For more information, please refer to the Perforce User Guide:

www.perforce.com/perforce/r10.2/manuals/…odemgmt.html#1066766
www.perforce.com/perforce/r10.2/manuals/…odemgmt.html#1081816
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

rajeshkumar replied the topic: Re: Perforce Lable using changelist number or Date/time
One more important things is that –
The automatic label (the “Revision:” field in the label
specification) was introduced in version 2006.2:

Major new functionality in 2006.2

‘Automatic’ labels – #107125 (Bug #20887) **

The new automatic label feature introduced in 2005.2 but
undocumented is now fully supported. By adding a “Revision”
field to the label specification you can now make that label
appear as if ‘p4 labelsync’ had been done on the label using
that revision. The only difference is that if the “Revision”
specification is dynamic (e.g #head) the apparent contents of
the automatic label will change, while a static label set with
‘p4 labelsync’ will not. Note that when executing the command
‘p4 labels ‘ automatic labels will not be displayed.

( www.perforce.com/perforce/r10.2/user/relnotes.txt )
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Rajesh Kumar
Follow me
Latest posts by Rajesh Kumar (see all)
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x