vulpineblazeyt
vulpineblazeyt

Reputation: 149

Can a perforce label have multiple owners?

tl;dr:

The title is my question.

Situation:

A co-worker and I are working together on a project, and I cannot use his label, and he cannot use mine.

(EDIT) Example:

We are both working on the same set of source files. Co-worker applies his label to the files. (Eg. file.txt#1) I can sync those files, edit them, but I can't apply the label to them. (Eg. file.txt#2) This means I can't sync my changes unless I use another label.

Our automated test script needs exactly one label to know what to sync, but it needs to be able to run against both our set of changes.

(Eg. /other/path/to/safe/compile/zone/automated_test.sh
has the line: p4 sync //path/to/project/source/sub/folder/...@PROJECT_V_1.0.0 )

Question:

Is there a way that both of us can be the owner on one label? Is my company grossly misusing perforce?

Constraints:

We cannot change anything to do with our user/group/anything, we don't have sudo'er. We can't switch to a sane program, like git.

The labels look like this example:

...and we want to simply have a single, shared label "PROJECT_V_1.0.1" until we finish the single change we are making.

Upvotes: 2

Views: 868

Answers (2)

Toby Allen
Toby Allen

Reputation: 11213

Perforce is an amazing piece of software, but a huge mistake that they made was to call a feature labels which bears no resemblence to what people expected labels to be.

Perforce labels are a snapshot of a workspace or client, which can include non latest versions of files. This is why you and your friend are having trouble sharing them. Workspaces in perforce are generally allocated to 1 person. Any removal of ownership so you can checkout from your friends label is a hack, you probably shouldnt be using Labels at all.

Depending on what you are trying to do you should probably simply be sharing the changelist number of the release instead.

Also please read about branching in perforce, the whole point is that you can merge changes (not manually make them) between branches using tools in perforce.

Upvotes: 0

Samwise
Samwise

Reputation: 71454

Remove the Owner from the label. From "p4 help labelsync":

    Only the owner of a label can run labelsync on that label. A label
    that has its Options: field set to 'locked' cannot be updated. A
    label without an owner can be labelsync'd by any user.

From the description of your situation I also might suggest you use a branch to isolate your shared work from other changes rather than a label, since with a label you can't exclude changes made to files that you've already modified -- a branch would make it much easier to pick which changes to merge in and when to merge them, regardless of whether you've happened to make modifications to the same files. That's beyond the scope of this question though...

Upvotes: 4

Related Questions