p4 lock (graph)

Lock an opened file to prevent it from being submitted to the repo.

Syntax

p4 lock [-c changelist] [file ...]

Syntax and naming conventions

Description

The specified files are locked in the depot, preventing any user other than the current user on the current client from submitting changes to the files.

  • If a file is already locked, the lock request is rejected.
  • If no file names are specified and no changelist is specified, all open files are locked.
  • If both the -c flag and a file specification are provided, only the matching files in the specified changelist are locked.

Options

Option Description

-c changelist

Lock only files included in changelist changelist

file ...

Limit the lock to the matching files