Documentation

Support

Unity Version Control

FILEINFO

Get file information with the Unity Version Control CLI.
Read time 3 minutesLast updated 21 days ago

Description

Retrieves detailed information about the items in the workspace.

Usage

cm fileinfo <item_path>[ ...] [--fields=<field_value>[,...]] [[--xml | -x [=<output_file>]] | [--format=<str_format>]] [--symlink] [--encoding=<name>]

Options

Option / Argument

Description

--fields
A string of comma-separated values. This selects which fields will be printed for each item. See Remarks for more information.
--xml | -x
Prints the output in XML format to the standard output. It is possible to specify an output file. This option cannot be combined with
--format
.
--format
Retrieves the output message in a specific format. See Remarks for more info. This option cannot be combined with
--xml
. This
--format
option prevails over
--fields
if both are specified.
--symlink
Applies the fileinfo operation to the symlink and not to the target.
--encoding
Specifies the output encoding, i.e.: utf-8. See the MSDN documentation at http://msdn.microsoft.com/en-us/library/system.text.encoding.aspx to get the table of supported encodings and its format, (at the end of the page, in the "Name" column).
item_path
Items to display. Use a whitespace to separate the items. Use double quotes (
" "
) to specify paths containing spaces.

Help

Remarks

This command prints a detailed list of attributes for each selected item. Each attribute is printed on a new line by default. The attribute list can be modified to display only the attributes the user needs. This can be achieved using the '`--fields**=<field_list>' which accepts a string of comma-separated attribute names. This way, only those arguments whose name has been indicated are shown.

Revision head changeset

This option is disabled by default. Please note that retrieving this attribute is significantly slower than the rest of them, so we advise users to group together as many items as possible. This will improve execution times by avoiding many separate
cm fileinfo
executions. Also, this feature is not currently available for controlled directories.
You can find below the complete list of available attribute names. Names marked with an asterisk (
*
) will not be shown by default:

Option / Argument

Description

ClientPath
The local path on disk for the item.
RelativePath
The workspace-relative path.
ServerPath
The repository path for the item. (Note: Transformed workspaces are not currently supported for this option).
Size
Item size.
Hash
Item hash sum.
Owner
The user the item belongs to.
RevisionHeadChangeset
(
*
) The changeset of the revision loaded in the head changeset of the branch. (Please see note above.)
RevisionChangeset
The changeset of the revision currently loaded in the workspace.
RepSpec
The repository specification for the item. (Use
cm help objectspec
to learn more about rep specs.)
Status
The workspace item status: added, checked out, deleted, etc.
Type
Revision type (text, binary, directory, symlink, or unknown).
Changelist
The changelist the item belongs to (if any).
IsLocked
(
*
) Whether the item is locked by exclusive checkout or not.
LockedBy
(
*
) The user who exclusively checked out the item.
LockedWhere
(
*
) The location where the item was exclusively checked out.
IsUnderXlink
Whether the item is located under an Xlink or not.
UnderXlinkTarget
The target of the Xlink the item is under (if any).
UnderXlinkPath
The item server path in the Xlinked repository (if any).
UnderXlinkWritable
Whether the Xlink the item belongs to is writable or not.
UnderXlinkRelative
Whether the Xlink the items belongs to is relative or not.
IsXlink
Whether the item itself is a Xlink or not.
XlinkTarget
The target repository the item points to, if it is a Xlink.
XlinkName
The Xlink name of the item, if it is actually one.
XlinkWritable
Whether the Xlink item is a writable Xlink or not.
XlinkRelative
Whether the Xlink item is a relative Xlink or not.

Output format parameters (
--format option
)

This command accepts a format string to show the output.

The output parameters of this command are the following

  • {ClientPath}
  • {RelativePath}
  • {ServerPath}
  • {Size}
  • {Hash}
  • {Owner}
  • {RevisionHeadChangeset}
  • {RevisionChangeset}
  • {Status}
  • {Type}
  • {Changelist}
  • {IsLocked}
  • {LockedBy}
  • {LockedWhere}
  • {IsUnderXlink}
  • {UnderXlinkTarget}
  • {UnderXlinkPath}
  • {UnderXlinkWritable}
  • {UnderXlinkRelative}
  • {IsXlink}
  • {XlinkTarget}
  • {XlinkName}
  • {XlinkWritable}
  • {XlinkRelative}
  • {RepSpec}
Please note that
--format
and
--xml
options are mutually exclusive, so they can't be used at the same time.

Examples

cm fileinfo file1.txt file2.txt dir/
cm fileinfo "New Project.csproj" --xml
cm fileinfo assets.art --fields=ServerPath,Size,IsLocked,LockedBy
cm fileinfo proj_specs.docx --fields=ServerPath,RevisionChangeset --xml
cm fileinfo samples.ogg --format="{ServerPath}[{Owner}] -> {Size}"