![]() |
Telelogic SYNERGY (steve huntington) | ![]() |
Topic Title: No Sort broken in 6.4? Topic Summary: ccm query "name='test.c'" -u -ns -f "%version" Created On: 27-Jun-2006 10:20 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
The following command no longer gives me the latest version as the last number in the list, what has happen between 6.3 and 6.4? How can i figure out (easierly) which is the latest version now? Can i sort in date order? |
|
![]() |
|
![]() |
|
The 'no sort' option reports results in the order they come back from the underlying database, so SYNERGY/CM itself adds no additional sorting. This database order is undefined and unpredictable - it depends on the database implementation, and index states, etc. So, there was never a guarantee that your query would return the latest version last.
[Actually, the above statement is a slight simplification. There are some query functions, such as hierarchy_project_members and recursive_is_member_of, that define their own ordering beyond simple database order. The 'no sort' option on the query command is often necessary with these functions to ensure the ordering imposed by the SYNERGY/CM query function itself is not overridden by the sorting of the overall query results.] Going back to your question, the best way to get the most recent version might be to sort the query by create time. If you have parallel branches at the end of your history, this still might not produce a very meaningful result, but it will be the most recently created! To sort by create time, add "%create_time" as the first attribute in the format string, and make sure your date/time format is set to a format that will sort correctly, such as "YYYY/MM/DD HH:MM:SS". To set the format for date/time, see the Command Line Help, in the section Date Formats. This section asks you to set an environment variable for your CM session - the easiest way to do that on the engine process is to use the ccm env -e command, which is part of the contrib code in the extras directory of the product CD. You might also be able to get what you need directly from the query. If there are no parallel branches at the end of your history, then the most recent version is the leaf version. You can query directly for leaf versions: ccm query -u -f "%version" -n test.c "is_hist_leaf()" |
|
![]() |
Telelogic SYNERGY
» SYNERGY/CM
»
No Sort broken in 6.4?
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.