Documentation

Unity Version Control

SHOW FIND OBJECTS

Find available objects and attributes with the Unity Version Control CLI.
Read time 16 minutesLast updated 13 days ago

Description

Lists objects and attributes.

Usage

cm showfindobjects <object>

Options

Option / Argument

Description

objectCheck remarks for available objects and attributes.

Help

Remarks

Available objects and attributes

  • attribute.
  • attributetype.
  • branch.
  • changereviewcomment.
  • changeset.
  • label.
  • merge.
  • replicationlog.
  • review.
  • revision.
  • shelve.

attribute

You can find attributes by filtering using the following fields

Option / Argument

Description

typestring.
valuestring.
datedate. Check "date constants" for more info in this guide.
owneruser. Admits special user 'me'.
GUIDGlobal Unique Identifier. Hexadecimal id in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. comment string.
srcobjobject spec: item path, branch, changeset, revision, or label. Use 'cm help objectspec' to learn how to specify these objects.
IDinteger.

Examples

cm find attribute "where type = 'status'"
(Finds all attributes of type 'status'.)
cm find attribute "where date > 'this week'"
(Finds all attributes applied during the current week.)
cm find attribute "where value = 'resolved' and owner = 'me'"
(Finds all attributes with value 'resolved' applied by me.)
cm find attribute "where srcobj = 'item:readme.txt'"
(Finds the attributes applied to the item 'readme.txt'.)
cm find attribute "where srcobj = 'br:/main/scm23343'"
(Finds the attributes applied to the branch scm23343.)
cm find attribute "where srcobj = 'rev:readme.txt#br:/main/task002'"
(Finds the attributes applied to the specified revision.)
cm find attribute "where srcobj = 'rev:revid:1126'"
(Finds the attributes applied to the specified revision id.)

attributetype

You can find attribute types by filtering using the following fields

Option / Argument

Description

namestring.
valuestring.
datedate. Check "date constants" for more info in this guide.
owneruser. Admits special user 'me'.
GUIDGlobal Unique Identifier. Hexadecimal id in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
commentstring.
sourceobject spec: item path, branch, changeset or label. Use 'cm help objectspec' to learn how to specify these objects.
IDinteger.
Replication fieldCheck "replication related fields" below.
  • ReplLogId
  • ReplSrcDate
  • ReplSrcId
  • ReplSrcRepository
  • ReplSrcServer

Examples

cm find attributetype "where name like 'st%'"
(Finds all attribute where name starts with 'st'.)
cm find attribute "where date > 'today'"
(Finds all attributes applied today.)
cm find attributetype "where comment != ''" --xml
(Finds all attribute types that have a comment and prints the output in XML format to the standard output.)
cm find attributetype "where source = 'item:readme.txt'"
(Finds all attribute types in item 'readme.txt'.)
cm find attributetype "where source = 'cs:30'"
(Finds all attribute types in changeset '30'.)
cm find attributetype "where source = 'lb:v0.14.1'"
(Finds all attribute types in label 'v0.14.1'.)

branch

You can find branches by filtering using the following fields

Option / Argument

Description

namestring.
datedate. Check "date constants" for more info in this guide.
changesetsdate (of the changesets in the branch). Check "date constants" for more info in this guide.
attributestring.
attrvaluestring.
owneruser. Admits special user 'me'.
parentbranch spec. Use 'cm help objectspec' to learn how to specify this object.
commentstring.
GUIDGlobal Unique Identifier. Hexadecimal id in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
IDinteger.
order byfield to use for sorting. Check "sorting fields" for more info.
Replication fieldsCheck "replication related fields" below.

Sorting fields

  • date
  • branchname
  • ReplLogId
  • ReplSrcDate
  • ReplSrcId
  • ReplSrcRepository
  • ReplSrcServer

Examples

cm find branch "where name like 'scm23%'"
(Finds branches which name starts with 'scm23'.)
cm find branch "where date > 'one week ago'"
(Finds branches created during the last week.)
cm find branch "where changesets >= 'today'"
(Finds branches with changesets created today.)
cm find branch "where attribute = 'status' and attrvalue = 'failed'"
(Finds branches that have the attribute 'status' and which value is 'failed'.)
cm find branch "where owner != 'me' and parent != 'br:/main'"
(Finds branches created by other than me and which parent branch is not '/main'.)
cm find branch "where id = 2029607"
(Finds the branch which id is 2029607.)

changereviewcomment

You can find code review comments by filtering using the following fields

Use the following fields in the
where
clause of
cm find changereviewcomment
:

Field

Type

Description

id
IntegerID of the comment.
guid
GUIDGlobally unique identifier (GUID) of the comment, in the format
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
.
date
DateDate the comment was created. For the accepted formats, refer to Date constants.
modifieddate
DateDate of the last edit to the comment.
comment
StringText of the comment.
owner
UserUser who wrote the comment. Accepts the special user
me
.
revisionid
IntegerID of the revision that the comment is on, or -1 for conversation comments.
reviewid
IntegerID of the code review. You can also use the alias
review
.
location
StringPosition of the comment, as stored: the line number counting from 0, or -1 if the comment isn't on a line. The value is stored as text, so put it in quotes, for example
location = '105'
.
line
IntegerLine number of the comment, counting from 1, like text editors and the
--line
option of
cm codereview comment add
. Has a value only when the comment is on a line. Supports only the
=
and
!=
operators.
parent
IntegerID of the comment that this comment replies to, or -1 if it isn't a reply.
type
StringType of comment:
comment
,
change
,
question
,
conversation
,
timeline
,
script
, or
discarded
.
changeset
IntegerChangeset whose diff shows the comment, or -1 for comments on the whole branch.
appliedinchangeset
IntegerChangeset that applied the change request.
To sort the results, use
order by
with
reviewid
,
date
, or
modifieddate
.

Output format fields (--format option)

Use
--format
to print any of the following fields:
{id}
,
{guid}
,
{owner}
,
{date}
,
{comment}
,
{revisionid}
,
{reviewid}
,
{location}
,
{line}
,
{type}
,
{parent}
,
{changeset}
, and
{appliedinchangeset}
. Each prints the value of the
where
field with the same name. The following fields are also available:

Field

Description

{itemid}
ID of the item whose revision has the comment.
{path}
Latest path of the item in the repository, which is its path in the changeset of its latest checked-in revision on any branch. If the item moved, this path can differ from the path that the review shows. Empty for a file that exists only in a shelve.
{modifieddate}
Date of the last edit. If the comment was never edited, the same as
{date}
.
{itemid}
and
{path}
are empty when the comment isn't on a file. All these fields are also in the
--xml
output.

Examples

The following example finds the comments of code review 1367:
cm find changereviewcomment "where reviewid = 1367"
The following example finds a comment by the GUID that
cm codereview comment add
prints:
cm find changereviewcomment "where guid = '5b09c9d9-e2f1-4bcf-8c8e-b1707d3f1eea'"
The following example finds the comments on line 106. Like the
--line
option,
line
counts from 1:
cm find changereviewcomment "where reviewid = 1367 and line = 106" --format="{guid} {type} line {line}"
The following example prints the file and line of each comment on a file in code review 1367:
cm find changereviewcomment "where reviewid = 1367 and revisionid != -1" --format="{path}:{line} {comment}"

changeset

You can find changesets by filtering using the following fields

Option / Argument

Description

branchbranch spec. Use 'cm help objectspec' to learn how to specify this object.
changesetidinteger.
attributestring.
attrvaluestring.
datedate. Check "date constants" for more info in this guide.
owneruser. Admits special user 'me'.
GUIDGlobal Unique Identifier. Hexadecimal id in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
commentstring.
onlywithrevisionsboolean. To filter whether a cset has revisions or not.
returnparentboolean. A way to return the parent of a cset. Good for scripting.
parentchangeset id (integer).
IDinteger.
order byfield to use for sorting. Check "sorting fields" for more info.
Replication fieldsCheck "replication related fields" below.

Sorting fields

  • date
  • changesetid
  • ReplLogId
  • ReplSrcDate
  • ReplSrcId
  • ReplSrcRepository
  • ReplSrcServer

Examples

cm find changeset "where branch = '/main/scm23119'"
(Finds all changesets in branch 'scm23119'.)
cm find changeset "where attribute = 'status'"
(Finds the changesets with the attribute 'status'.)
cm find changeset "where date >= '6/8/2018' and owner != 'me'"
(Finds all changesets with creation date equal or greater than 6/8/2018 and created by others than me.)
cm find changeset "where guid = '1b30674f-14cc-4fd7-962b-676c8a6f5cb6'"
(Finds the changeset with the specified guid.)
cm find changeset "where comment = ''"
(Finds the changesets with no comments.)
cm find changeset "where onlywithrevisions = 'false'"
(Finds changesets with no revisions.)
cm find changeset "where changesetid = 29 and returnparent = 'true'"
(Finds the parent of changeset 29.)
cm find changeset "where parent = 548"
(Finds all changesets which parent is cset 548.)

label

You can find labels by filtering using the following fields

Option / Argument

Description

namestring.
attributestring.
attrvaluestring.
datedate. Check "date constants" for more info in this guide.
owneruser. Admits special user 'me'.
GUIDGlobal Unique Identifier. Hexadecimal id in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
branchbranch spec. Use 'cm help objectspec' to learn how to specify this object.
branchidinteger.
changesetchangeset id (integer).
commentstring.
IDinteger.
order byfield to use for sorting. Check "sorting fields" for more info.
Replication fieldsCheck "replication related fields" below.

Sorting fields

  • date
  • labelname
  • ReplLogId
  • ReplSrcDate
  • ReplSrcId
  • ReplSrcRepository
  • ReplSrcServer

Examples

cm find label "where name like '7.0.16.%'"
(Finds the labels with a name that starts with '7.0.16.'.)
cm find label "where date >= 'this month' and attribute = 'publish-status' and attrvalue != 'PUBLISHED'"
(Finds the labels created this month with an attribute 'publish-status' set to a value other than 'PUBLISHED'.)
cm find label "where branch = '/main'"
(Finds all labels applied to the main branch.)
cm find label "where changeset = 111733"
(Finds the labels applied to changeset 111733.)

merge

You can find merges by filtering using the following fields

Option / Argument

Description

srcbranchbranch spec. Use 'cm help objectspec' to learn how to specify this object.
srcchangesetchangeset id (integer).
dstbranchbranch spec. Use 'cm help objectspec' to learn how to specify this object.
dstchangesetchangeset id (integer).
datedate. Check "date constants" for more info in this guide.
owneruser. Admits special user 'me'.
GUIDGlobal Unique Identifier. Hexadecimal id in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
typestring. Check possible values in "Type values" below.
IDinteger.

Type values

  • merge
  • cherrypick
  • cherrypicksubstractive
  • interval
  • intervalcherrypick
  • intervalcherrypicksubstractive

Examples

cm find merge "where srcbranch = 'br:/main'"
(Finds merges from the main branch.)
cm find merge "where dstchangeset = 108261" --format="{srcbranch} {srcchangeset} {dstbranch} {dstchangeset} {owner}"
(Finds the merges to changeset 108261 and prints the formatted output showing the source (branch and cset id), the destination (branch and cset id), and the merge owner.)
cm find merge "where type = 'cherrypick' and owner = 'me'"
(Finds all my cherry picks.)

replicationlog

You can find replication log by filtering using the following fields

Option / Argument

Description

branchbranch spec. Use 'cm help objectspec' to learn how to specify this object.
repositorynamestring.
owneruser. Admits special user 'me'.
datedate. Check "date constants" for more info in this guide.
serverstring.
packageboolean.
IDinteger.

Examples

cm find replicationlog "where branch = '/main/gm22358'"
(Finds the replication logs of branch 'gm22358'.)
cm find replicationlog "where package = 'T' and server like '%cloud%'"
(Finds the replication logs created from package which server name contains 'cloud'.)

review

Use
cm find review
for code reviews and
cm find mergerequest
for merge requests. Both accept the same fields.

You can find code reviews by filtering using the following fields

Option / Argument

Description

statusstring. Code review status:
Under review
(0),
Reviewed
(1), or
Rework required
(2). Use the English name, the name in the client language, or the number. You can also use the alias
codereviewstatus
.
mergerequeststatusstring. Merge request status:
None
(0),
Draft
(1),
Closed
(2),
Open
(3), or
Merged
(4). Use the English name, the name in the client language, or the number.
assigneestring.
titlestring.
targetobject spec: branch or changeset. Use 'cm help objectspec' to learn how to specify this object.
targetidinteger.
targettypestring. Check "target types" for more info.
datedate. Check "date constants" for more info in this guide.
owneruser. Admits special user 'me'.
GUIDGlobal Unique Identifier. Hexadecimal id in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
IDinteger.
order byfield to use for sorting. Check "sorting fields" for more info.

Target types

  • branch
  • changeset

Sorting fields

  • date
  • modifieddate
  • status

Output format fields (--format option)

Use
--format
to print the following fields:
{id}
,
{guid}
,
{date}
,
{owner}
,
{title}
,
{status}
,
{codereviewstatus}
,
{mergerequeststatus}
,
{assignee}
,
{targettype}
,
{target}
, and
{destination}
. The following fields are also available:

Field

Description

{reviewers}
Each reviewer and their review status, as a comma-separated list of
user:status
pairs. The status is
Under review
,
Reviewed
, or
Rework required
.
{modifieddate}
Date of the last activity on the review.
{comments}
Number of comments, questions, and change requests, including replies. Doesn't count replies that discard a change request.
{unresolvedissues}
Number of unresolved issues: the sum of
{unresolvedchanges}
and
{unansweredquestions}
.
{unresolvedchanges}
Number of change requests that aren't applied yet.
{unansweredquestions}
Number of questions that aren't answered yet.
{codereviewstatusname}
Code review status in English:
Under review
,
Reviewed
, or
Rework required
. These are the values that
--status
accepts in
cm codereview
.
{mergerequeststatusname}
Merge request status in English:
Draft
,
Open
,
Closed
, or
Merged
, as
--mergerequeststatus
accepts them in
cm mergerequest
. Prints
None
for a code review that isn't a merge request.
All these fields are also in the
--xml
output.
{status}
,
{codereviewstatus}
, and
{mergerequeststatus}
print the field name and then the status in the client language, for example
Status Under review
. In scripts, use
{codereviewstatusname}
and
{mergerequeststatusname}
instead. They print only the status, always in English.

Examples

cm find review "where status = 'Under review' and assignee = 'me'"
(Finds all my reviews that are under review.)
cm find review "where target = 'br:/main/scm17932'"
(Finds the reviews related to branch 'scm17932'.)
cm find review "where targettype = 'changeset'"
(Finds the reviews which target type is changeset.)
cm find mergerequest "where owner = 'me'" --format="{id} {title} {reviewers} {comments} {unresolvedissues}"
(Finds my merge requests and prints their reviewers, the number of comments, and the number of unresolved issues.)
cm find mergerequest "where owner = 'me'" --format="{id};{mergerequeststatusname};{codereviewstatusname}"
(Finds my merge requests and prints their status in a form that scripts can parse.)

revision

You can find revisions by filtering using the following fields

Option / Argument

Description

branchbranch spec. Use 'cm help objectspec' to learn how to specify this object.
changesetchangeset id (integer).
itemstring or integer.
itemidinteger.
attributestring.
attrvaluestring.
archivedboolean.
commentstring.
datedate. Check "date constants" for more info in this guide.
GUIDGlobal Unique Identifier. Hexadecimal id in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
owneruser. Admits special user 'me'.
parentrevision id (integer).
returnparentboolean.
shelveshelve id (integer).
sizeinteger (in bytes).
typestring. Check "type values" for more info.
workspacecheckoutidinteger.
IDinteger.
Replication fieldCheck "replication related fields" below.

type values

  • dir
  • bin
  • txt
  • ReplLogId
  • ReplSrcDate
  • ReplSrcId
  • ReplSrcRepository
  • ReplSrcServer

Examples

cm find revision "where changeset >= 111756"
(Finds the revisions created in changeset 111756 and later.)
cm find revision "where item = 'readme.txt' or itemid = 2250"
(Finds the revisions of item 'readme.txt' plus item id 2250.)
cm find revision "where item = 'readme.txt' or item = 2250"
(Gets the same revisions as the previous example.)
cm find revision "where attribute = 'status' and attrvalue != 'open'"
(Finds the revisions with attribute 'status' which value is other than 'open'.)
cm find revision "where archived = 'true'"
(Finds the revisions that are archived in an external storage.)
cm find revision "where type = 'txt' and size > 300000 and owner = 'me' and date >= '2 months ago'"
(Finds the text revisions created by me two months ago and with size greater than about 3MB.)

shelve

You can find shelves by filtering using the following fields

Option / Argument

Description

owneruser. Admits special user 'me'.
datedate. Check "date constants" for more info in this guide.
attributestring.
attrvaluestring.
commentstring.
GUIDGlobal Unique Identifier. Hexadecimal id in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
parentinteger.
shelveidinteger.
IDinteger.
Replication fieldCheck "replication related fields" below.
  • ReplLogId
  • ReplSrcDate
  • ReplSrcId
  • ReplSrcRepository
  • ReplSrcServer

Examples

cm find shelve "where owner != 'me' and date >= '1 years ago'"
(Finds the shelves created by others than me during the last year.)
cm find shelve "where shelveid = 2"
(Finds the shelve with name 2.)
cm find shelve "where id >= 3848"
(Finds the shelves which object id is greater than 3848.)
Many objects track replication data, meaning UVCS tracks where they were originally created.

The fields you can use are

Option / Argument

Description

ReplSrcServerrepspec. Stands for "replication source server". Server where the object was replicated from.
ReplSrcRepositorystring. Stands for "replication source repo". It is the repository where the object was replicated from.
ReplLogIdinteger. ID of the replication operation. In UVCS, each time new objects are created from a replica, a new 'replicationlog' is created.
ReplSrcDatedate. It is the date when the replica actually took place. Replicated objects will retain its original creation date, o this field is useful if you want to find objects that where replicated within a specific timeframe.
ReplSrcIdinteger. It is the ID of the replication source server. You can discover this ID searching for 'replicationsource' objects with the 'cm find' command.

Examples

cm find branch "where replsrcserver='skull.codicefactory.com:9095'"
(Finds the branches replicated from server 'skull'.)
cm find branch "where replsrcserver = 'skull.codicefactory.com:9095' and replsrcrepository = 'codice'"
(Finds the branches replicated from server 'skull' and from repository 'codice'.)
cm find revision "where repllogid = 2019974"
(Finds the revisions replicated from replica 2019974.)
cm find label "where replsrcdate >= 'one month ago' and date >= '15 days ago'"
(Finds the labels created 15 days ago and were replicated one month ago.)
cm find replicationlog "where date > 'one week ago'"
(returns the following line:)
  • 8780433 27/09/2018 8:49:38 codice@BACKYARD:8087 F mbarriosc
(Finds the replication logs created one week ago. Now, you can check that the replicated branch was created before it was replicated over:)
cm find branch "where repllogid = 8780433"
(returns the following line:)
  • 8780443 26/09/2018 12:20:55 /main/scm23078 maria codice T
cm find replicationsource
(returns the following two lines:)
  • 7860739 codice@AFRODITA:8087 d9c4372a-dc55-4fdc-ad3d-baeb2e975f27
  • 8175854 codice@BACKYARD:8087 66700d3a-036b-4b9a-a26f-adfc336b14f9
(Now, you can find the changesets replicated from codice@AFRODITA:8087:)
cm find changesets "where replsrcid = 7860739"

Date constants

You can use date formats that follow your machine localization settings. For example, if your computer displays dates in the format 'MM-dd-yyyy', you can use dates such as '12-31-2019' in your queries.

You can also use the following constants to simplify your queries

Option / Argument

Description

'today'today's date.
'yesterday'yesterday's date.
'this week'current week's Monday date.
'this month'current month's 1st day date.
'this year'current year's January 1st date.
'one day ago'one day before the current date.
'one week ago'seven days before the current date.
'one month ago'one month before the current date.
'n days ago''n' days before the current date.
'n months ago''n' months before the current date.
'n years ago''n' years before the current date.

The following 'where' clauses are valid for fields of type 'date'

  • '(...) where date > 'today' (...)'
  • '(...) where date < 'yesterday' (...)'
  • '(...) where date /> 'this week' (...)'
  • '(...) where date > 'this month' (...)'
  • '(...) where date < 'one day ago' and date /> '3 days ago' (...)'
  • '(...) where date < 'one week ago' and date /> '3 weeks ago' (...)'
  • '(...) where date < 'one month ago' and date /> '3 months ago' (...)'
  • '(...) where date > '1 year ago' (...)'
You can also force a specific date format on the 'cm find' command using the --dateformat flag. Check 'cm find --help' for further details.