0

There is a specific workflow that requires there be no more than one version (i.e., #1, and only a #1) for files in a specific Perforce path. Updating these files with a version #2 is not allowed.

Is there a way to prevent Perforce from allowing a #2 checkin for a Perforce tree?

Locking the entire tree is not an option, since users are free to check-in new files, just not update existing ones.

Elle Fie
  • 681
  • 6
  • 21
  • 1
    Seems like you can use a change-submit trigger to me. The trigger should look at the files that are open in the changelist, and refuse the submit if there are any open files in the changelist that are trying to submit an "edit" action to one of the "frozen" revision number #1 files. – Bryan Pendleton Mar 23 '16 at 03:12
  • Can I ask why you want to do this? – Toby Allen Apr 10 '16 at 09:35

1 Answers1

1

p4 change ChangeList
p4 add -c ChangeList
p4 lock -c ChangeList
Then just never touch it again and don't delete your workspace?

mut3
  • 54
  • 4
  • This only locks the client workspace, and not the Perforce path, doesn't it? i.e., users from other clients can still add to -- and edit -- this Perforce path? – Elle Fie Mar 26 '16 at 03:40
  • 1
    Locking a file prevents anyone from submitting a change, but if you need something stronger... "But there is another way to prevent inadvertent merging, and that is done with the exclusive locking file type. Exclusive locking files can be opened by only one user at a time." p4 sync, p4 edit -t +l //... p4 submit This prevents changes to files in a codeline/directory after you check the files out again. Triggers as suggested above might be a better fit here though. – mut3 Mar 27 '16 at 15:37
  • 1
    @mut3 please update your answer with the comments, to make the answer better. – Toby Allen Apr 10 '16 at 09:35