Click or drag to resize

RepositoryRenameClient Method

Renames client/workspace in the repository and also modifies all applicable places with new name.

Namespace:  Perforce.P4
Assembly:  p4api.net (in p4api.net.dll) Version: 2023.2.258.5793
Syntax
public string RenameClient(
	string oldClientName,
	string newClientName
)

Parameters

oldClientName
Type: SystemString
Existing client/workspace name.
newClientName
Type: SystemString
New client/workspace name which is to be replaced with old name.

Return Value

Type: String
Returns outcome of renameclient command from server.
Remarks


p4 help renameclient

renameclient -- Rename a client throughout the database
renameworkspace -- synonym for 'renameclient'

p4 renameclient --from=old --to=new

'p4 renameclient' renames a client, modifying relevant database
records which reference the client as needed.

This includes pending and shelved changes created by the client,
any files that the user has opened or shelved, any fixes that the
user made to jobs associated with pending changes, files on the
client's have list, and the client record itself. Note that this
command does not modify submitted changes nor fixes that are
associated with submitted changelists.The intent of this
command is to create a new client, migrate all existing work
in progress to that new client, and then delete the old client.

The client name is not changed in descriptive text fields (such as job
descriptions, change descriptions, or workspace descriptions). The
client is modified only where it appears as a field or as part of a
client path of a database record.
This command will add an entry to the spec depot for the new client,
and will add a deletion entry for the old client.

This command does not process unloaded clients, so any unloaded
client to be renamed should be reloaded first.

This command is not supported for use with partitioned or readonly
clients, clients with opened streams, or clients with promoted shelved
changes.The client cannot be renamed to a client that already exists.

'p4 renameclient' by default requires 'admin' access granted
by 'p4 protect', or must be the owner of the client to be renamed.
The 'run.renameclient.allow' configurable can be used to restrict
users that can run the 'p4 renameclient' command.
See Also