Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic SYNERGY (steve huntington)
Decrease font size
Increase font size
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
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 27-Jun-2006 10:20
User is offline View Users Profile Print this message


David Hope

Posts: 5
Joined: 22-Jul-2005

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?

ccm query "name='test.c'" -u -ns -f "%version"

Thanks and Regards.

David Hope

Report this to a Moderator Report this to a Moderator
 18-Jul-2006 05:44
User is offline View Users Profile Print this message


Nick Crossley

Posts: 2
Joined: 30-Sep-2002

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()"
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic SYNERGY forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 15:34.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.