FIND
Find items with the Unity Version Control CLI.
Read time 2 minutesLast updated 21 days ago
Description
Runs SQL-like queries to find UVCS objects. For more information about syntax and examples, refer to the cm find documentation.Usage
cm find <object_type> [where <str_conditions>] [on repository '<repspec>' | on repositories '<repspec1>','<repspec2>'[,...]] [order by <sort_field> ['asc' | 'desc']] [[limit <maxresults>] [offset <offset>]] [--format=<str_format>] [--dateformat=<date_format>] [--nototal] [--file=<dump_file>] [--xml] [--encoding=<name>]
Options
Option / Argument | Description |
|---|---|
| Retrieves the output message in a specific format. Read the 'cm find' guide to see all the object attributes that can be used as output format strings. |
| Format used to output dates. |
| Does not output record count at the end. |
| File to dump results. |
| Prints the output in XML format to the standard output. |
| 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). |
| str_conditions | Searches conditions on an object attributes. |
| repspec | Searches repositories alias or specification. In the case of |
| sort_field | The name of the field to use as sorting field. Mind there is only a subset of field possibilities. Use 'cm help showfindobjects' to find what objects are allowed to be ordered and by what fields. |
| maxresults | The maximun number of results returned by the query. |
| offset | The number of rows to skip before starting to return results from the query. |
| object_type | Object type to find. Some of these objects are implementing the |
Help
Remarks
If no repository is specified, the search is made on the repository configured in the workspace. When you run queries using comparison operators (><>=<=cm find{}These are some valid output format strings
--format={id}{date}{name}--format="{item}#{branch} with date {date}"
XML and encoding considerations
When the--xml--xml--fileExamples
cm find revision
cm find revision "where changeset=23 and owner='maria'"
cm find branch "on repository 'rep1'"
cm find label "on repositories 'rep1', 'rep:default@localhost:8084'"
cm find branch "where parent='br:/main' on repository 'rep1'"
cm find revision "where item='item:.'" --format="{item}#{branch}"
cm find revision "where item='item:.'" --xml --file=c:\queryresults\revs.xml
cm find label "where owner='me' limit 10 offset 20"
cm find branches "where owner='me' order by branchname desc limit 10"