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 |
|---|---|
| object | Check 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 |
|---|---|
| type | string. |
| value | string. |
| date | date. Check "date constants" for more info in this guide. |
| owner | user. Admits special user 'me'. |
| GUID | Global Unique Identifier. Hexadecimal id in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. comment string. |
| srcobj | object spec: item path, branch, changeset, revision, or label. Use 'cm help objectspec' to learn how to specify these objects. |
| ID | integer. |
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 |
|---|---|
| name | string. |
| value | string. |
| date | date. Check "date constants" for more info in this guide. |
| owner | user. Admits special user 'me'. |
| GUID | Global Unique Identifier. Hexadecimal id in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. |
| comment | string. |
| source | object spec: item path, branch, changeset or label. Use 'cm help objectspec' to learn how to specify these objects. |
| ID | integer. |
| Replication field | Check "replication related fields" below. |
Replication related fields
- 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 |
|---|---|
| name | string. |
| date | date. Check "date constants" for more info in this guide. |
| changesets | date (of the changesets in the branch). Check "date constants" for more info in this guide. |
| attribute | string. |
| attrvalue | string. |
| owner | user. Admits special user 'me'. |
| parent | branch spec. Use 'cm help objectspec' to learn how to specify this object. |
| comment | string. |
| GUID | Global Unique Identifier. Hexadecimal id in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. |
| ID | integer. |
| order by | field to use for sorting. Check "sorting fields" for more info. |
| Replication fields | Check "replication related fields" below. |
Sorting fields
- date
- branchname
Replication related fields
- 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 clause of :
wherecm find changereviewcommentField | Type | Description |
|---|---|---|
| Integer | ID of the comment. |
| GUID | Globally unique identifier (GUID) of the comment, in the format |
| Date | Date the comment was created. For the accepted formats, refer to Date constants. |
| Date | Date of the last edit to the comment. |
| String | Text of the comment. |
| User | User who wrote the comment. Accepts the special user |
| Integer | ID of the revision that the comment is on, or -1 for conversation comments. |
| Integer | ID of the code review. You can also use the alias |
| String | Position 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 |
| Integer | Line number of the comment, counting from 1, like text editors and the |
| Integer | ID of the comment that this comment replies to, or -1 if it isn't a reply. |
| String | Type of comment: |
| Integer | Changeset whose diff shows the comment, or -1 for comments on the whole branch. |
| Integer | Changeset that applied the change request. |
To sort the results, use with , , or .
order byreviewiddatemodifieddateOutput format fields (--format option)
Use to print any of the following fields: , , , , , , , , , , , , and . Each prints the value of the field with the same name. The following fields are also available:
--format{id}{guid}{owner}{date}{comment}{revisionid}{reviewid}{location}{line}{type}{parent}{changeset}{appliedinchangeset}whereField | Description |
|---|---|
| ID of the item whose revision has the comment. |
| 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. |
| Date of the last edit. If the comment was never edited, the same as |
{itemid}{path}--xmlExamples
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 prints:
cm codereview comment addcm find changereviewcomment "where guid = '5b09c9d9-e2f1-4bcf-8c8e-b1707d3f1eea'"
The following example finds the comments on line 106. Like the option, counts from 1:
--linelinecm 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 |
|---|---|
| branch | branch spec. Use 'cm help objectspec' to learn how to specify this object. |
| changesetid | integer. |
| attribute | string. |
| attrvalue | string. |
| date | date. Check "date constants" for more info in this guide. |
| owner | user. Admits special user 'me'. |
| GUID | Global Unique Identifier. Hexadecimal id in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. |
| comment | string. |
| onlywithrevisions | boolean. To filter whether a cset has revisions or not. |
| returnparent | boolean. A way to return the parent of a cset. Good for scripting. |
| parent | changeset id (integer). |
| ID | integer. |
| order by | field to use for sorting. Check "sorting fields" for more info. |
| Replication fields | Check "replication related fields" below. |
Sorting fields
- date
- changesetid
Replication related fields
- 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 |
|---|---|
| name | string. |
| attribute | string. |
| attrvalue | string. |
| date | date. Check "date constants" for more info in this guide. |
| owner | user. Admits special user 'me'. |
| GUID | Global Unique Identifier. Hexadecimal id in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. |
| branch | branch spec. Use 'cm help objectspec' to learn how to specify this object. |
| branchid | integer. |
| changeset | changeset id (integer). |
| comment | string. |
| ID | integer. |
| order by | field to use for sorting. Check "sorting fields" for more info. |
| Replication fields | Check "replication related fields" below. |
Sorting fields
- date
- labelname
Replication related fields
- 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 |
|---|---|
| srcbranch | branch spec. Use 'cm help objectspec' to learn how to specify this object. |
| srcchangeset | changeset id (integer). |
| dstbranch | branch spec. Use 'cm help objectspec' to learn how to specify this object. |
| dstchangeset | changeset id (integer). |
| date | date. Check "date constants" for more info in this guide. |
| owner | user. Admits special user 'me'. |
| GUID | Global Unique Identifier. Hexadecimal id in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. |
| type | string. Check possible values in "Type values" below. |
| ID | integer. |
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 |
|---|---|
| branch | branch spec. Use 'cm help objectspec' to learn how to specify this object. |
| repositoryname | string. |
| owner | user. Admits special user 'me'. |
| date | date. Check "date constants" for more info in this guide. |
| server | string. |
| package | boolean. |
| ID | integer. |
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 for code reviews and for merge requests. Both accept the same fields.
cm find reviewcm find mergerequestYou can find code reviews by filtering using the following fields
Option / Argument | Description |
|---|---|
| status | string. Code review status: |
| mergerequeststatus | string. Merge request status: |
| assignee | string. |
| title | string. |
| target | object spec: branch or changeset. Use 'cm help objectspec' to learn how to specify this object. |
| targetid | integer. |
| targettype | string. Check "target types" for more info. |
| date | date. Check "date constants" for more info in this guide. |
| owner | user. Admits special user 'me'. |
| GUID | Global Unique Identifier. Hexadecimal id in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. |
| ID | integer. |
| order by | field 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 to print the following fields: , , , , , , , , , , , and . The following fields are also available:
--format{id}{guid}{date}{owner}{title}{status}{codereviewstatus}{mergerequeststatus}{assignee}{targettype}{target}{destination}Field | Description |
|---|---|
| Each reviewer and their review status, as a comma-separated list of |
| Date of the last activity on the review. |
| Number of comments, questions, and change requests, including replies. Doesn't count replies that discard a change request. |
| Number of unresolved issues: the sum of |
| Number of change requests that aren't applied yet. |
| Number of questions that aren't answered yet. |
| Code review status in English: |
| Merge request status in English: |
All these fields are also in the output.
--xml{status}{codereviewstatus}{mergerequeststatus}Status Under review{codereviewstatusname}{mergerequeststatusname}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 |
|---|---|
| branch | branch spec. Use 'cm help objectspec' to learn how to specify this object. |
| changeset | changeset id (integer). |
| item | string or integer. |
| itemid | integer. |
| attribute | string. |
| attrvalue | string. |
| archived | boolean. |
| comment | string. |
| date | date. Check "date constants" for more info in this guide. |
| GUID | Global Unique Identifier. Hexadecimal id in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. |
| owner | user. Admits special user 'me'. |
| parent | revision id (integer). |
| returnparent | boolean. |
| shelve | shelve id (integer). |
| size | integer (in bytes). |
| type | string. Check "type values" for more info. |
| workspacecheckoutid | integer. |
| ID | integer. |
| Replication field | Check "replication related fields" below. |
type values
- dir
- bin
- txt
Replication related fields
- 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 |
|---|---|
| owner | user. Admits special user 'me'. |
| date | date. Check "date constants" for more info in this guide. |
| attribute | string. |
| attrvalue | string. |
| comment | string. |
| GUID | Global Unique Identifier. Hexadecimal id in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. |
| parent | integer. |
| shelveid | integer. |
| ID | integer. |
| Replication field | Check "replication related fields" below. |
Replication related fields
- 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.)
Replication related fields
Many objects track replication data, meaning UVCS tracks where they were originally created.
The fields you can use are
Option / Argument | Description |
|---|---|
| ReplSrcServer | repspec. Stands for "replication source server". Server where the object was replicated from. |
| ReplSrcRepository | string. Stands for "replication source repo". It is the repository where the object was replicated from. |
| ReplLogId | integer. ID of the replication operation. In UVCS, each time new objects are created from a replica, a new 'replicationlog' is created. |
| ReplSrcDate | date. 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. |
| ReplSrcId | integer. 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.