Click or drag to resize

UnlockFilesCmdOptions Constructor

Unlock command options.

Namespace:  Perforce.P4
Assembly:  p4api.net (in p4api.net.dll) Version: 2023.2.258.5793
Syntax
public UnlockFilesCmdOptions(
	UnlockFilesCmdFlags flags,
	int changelistId
)

Parameters

flags
Type: Perforce.P4UnlockFilesCmdFlags
changelistId
Type: SystemInt32

Return Value

Type: 
Remarks

p4 help unlock

unlock -- Release a locked file, leaving it open

p4 unlock [-c | -s changelist# | -x] [-f] [file ...]
p4 -c client unlock [-f] -r

'p4 unlock' releases locks on the specified files, which must be
open in the specified pending changelist. If you omit the changelist
number, the default changelist is assumed. If you omit the file name,
all locked files are unlocked.

The -s flag unlocks files from a shelved changelist caused by an
aborted 'submit -e' operation. The -c flag applies to opened files
in a pending changelist locked by 'p4 lock' or by a failed submit
of a change that is not shelved.

By default, files can be unlocked only by the changelist owner who
must also be the person who has the files locked. The -f flag
enables you to unlock files in changelists owned by other users.
The -f flag requires 'admin' access, which is granted by 'p4
protect'.

The -x option unlocks files that are opened 'exclusive' but are
orphaned (see 'p4 opened -x'). This option only applies to a
distributed installation where global tracking of these file types
is necessary across servers.

If a push command from a remote server to this server fails, files
can be left locked on this server, preventing other users from
submitting changes to those files. In this case, the user who issued
the push command can specify the -r flag with the name of the client
that was used on that remote server to unlock the files on this
server. An administrator can run 'unlock -f -r' as well.

See Also