Monday, December 28, 2009

Synergy object times

Synergy has several time stamps on its objects.
create_time: the time when the object version in the database has been created.
source_create_time: the timestamp taken from the file system upon loading the object into the repository.
Note that when a new object has been created in the database the filesystem timestamp is not reflected in the database, and the db object creation time is reflected instead. When the new version of an already existing object is created, the filesystem timestamp is taken and reflected in the source_create_time attribute.
E.g.
new file has been created on a filesystem at Mon Dec 28 10:47:35 2009 and has been "synced" into the database at Mon Dec 28 10:56:45 2009. So the dbobject create time is set to Mon Dec 28 10:56:45 2009.
Later, when we check out the file again, a new version, 2, is created and it's creation time is set to Mon Dec 28 10:58:05 2009. Now the source_creation_time is set to the timestamp the file has on a file system, that is Mon Dec 28 10:47:35 2009.
ccm query -owner myuser "source_create_time>time('December 28 2009') and source_create_time<time('December 29 2009')" -f "%name %version %instance %create_time %source_create_time"
1) newfile.txt 1 1 Mon Dec 28 10:56:45 2009 Mon Dec 28 10:56:46 2009
2) newfile.txt 2 1 Mon Dec 28 10:58:05 2009 Mon Dec 28 10:47:35 2009

When the file is checked in its source_create_time is unchanged, even though the file on a fs has been edited immediately before the sync.

$ ccm query -owner myuser "source_create_time>time('December 28 2009') and source_create_time<time('December 29 2009')" -f "%name %version %instance %create_time %source_create_time %modify_time"

1) newfile.txt 1 1 Mon Dec 28 10:56:45 2009 Mon Dec 28 10:56:46 2009 Mon Dec 28 10:57:53 2009
2) newfile.txt 2 1 Mon Dec 28 10:58:05 2009 Mon Dec 28 10:47:35 2009 Mon Dec 28 13:17:17 2009

Tuesday, December 15, 2009

How to find out if a specific file has been checked out to specific task?

Here is the command for you:
ccm query -name <file name>"status='working' and is_associated_object_of('task<task number>#1:task:probtrac')" -u -f TRUE
for example:
$> ccm query -name strings.xml "status='working' and is_associated_object_of('task202873#1:task:probtrac')" -u -TRUE
If the file IS associated with THE task, you will get a line of the output with a single word "TRUE", if not - you will get a "new line" only:
$> TRUE
Enjoy :)

Monday, December 14, 2009

Synergy tasks and objects query

How to find objects not associated to any task?

Answer

There are instances when users create objects in Telelogic Synergy without associating them to a task. However, a s a good CM practice, it is recommended to associate every object in Telelogic Synergy with a task.

Run the following command after starting a Synergy command line or classic client session to get all the objects not associated to a task.

In Synergy 6.3 and newer:

ccm query "has_attr('source') and is_no_associated_cv()"

In Synergy 6.2 and earlier:

ccm query "has_attr('source') and not is_associated_cv_of(cvtype = 'task')"

The above command will list out all objects which has 'source' attribute (primarily source type objects) and not associated to any task.

If you wish to add these objects to a task, please refer to FAQSCM0217 ( How do I associate/disassociate an object with a task from the command line? ) as found in the Related Documents section below.

Products

Synergy

Product version

6.0, 6.1, 6.2, 6.3, 6.4, 6.5

Related Documents

How do I associate/disassociate an object with a task from the command line?

Answer

To associate or disassociate objects and tasks using the command line interface you can use the 'ccm task' command or the 'ccm relate' command. The object should be specified by 4-part name. As an example, to associate foo.c to task 75, perform the following command:

% ccm task -associate 75 -obj foo.c-1:csrc:1

To disassociate foo.c from task 75, perform the following command:

% ccm task -disassociate 75 -obj foo.c-1:csrc:1

The 'ccm relate' command is typically used for object to object relations. For example, to make clear-2 a successor to clear-1:

% ccm relate -n successor -f clear-1 -t clear-2

Please see the Synergy Help Documentation for further information on the 'ccm task' and 'ccm relate' commands.

Products

Synergy

Product version

SYNERGY/CM 4.5, 5.0, 5.1, 5.1cs, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5

Reference ID

FAQSCM0217

Related Documents

How to find objects not associated to any task?

Last Modified Date:06-13-2007ID:

How can I find all objects (cv's) associated with a specific task, say task 1:


1188) task205841 task205841#1:task:probtrac task_assigned


Answer

The following ccm commands will show all objects associated to a particular task:

% ccm task -show objs 1 (CCM 4.5 or later)

or

% ccm query "is_associated_object_of('task1-1:task:probtrac')"

Note that in a database initialized for DCM, the probtrac instance on task and problem objects are replaced by the database's DCM id.

Products

Synergy

Product version

CM Synergy 5.0, 5.1, 5.1cs, 6.0, 6.1, 6.2, 6.3, 6.4

Reference ID

FAQSCM0179


Our tasks ids are like this:

1189) task2054842 task205842#1:task:probtrac completed
1191) task2058844 task205844#1:task:probtrac task_automatic
1192) task2075845 task205845#1:task:probtrac completed
1194) task2105847 task205847#1:task:probtrac task_assigned

Sunday, December 13, 2009

Compare content of two project versions (Synergy work tip)

Update:
To ease the review you may want to grep all the different lines in the diff output (first command):
ccm diff -p Proj#Version1:project:1 Proj#Version2:project:1|egrep '>|<|\|'
This will give you the list of differences between two projects.
~~~~~
The predecessors of the Proj#Version1 is Proj#Version2.
There are two diffs you may run on the project objects:
ccm diff -p Proj#Version2:project:1 Proj#Version1:project:1
and
ccm diff -p -vc Proj#Version2:project:1 Proj#Version1:project:1

In the first case the list of the versioned objects is compared, so you get the result in the following form (example below):
In the second case the version compare is performed.
I suggest you run two commands and examine the output to see if you get what you are looking for.

~~~~~~~~~~

The motivation is to see all the changes that went into this project.

So basically I need a diff between this project baseline and the latest.

If there Is a way to ignore “syncs” it would be nice.

Synergy allows a comparison of just about any two objects, projects included. And the CLI version of every command is there for you, just ask.

Fix the Motif issues on Synergy clients machines running CentOS

CentOS 5.4 is not officially supported by the Synergy Classic GUI 6.5, so occasionally you may get Motif related warnings and errors while using special keys.
E.g. pressing BackSpace would print special chars instead of deleting the last char in the current string on the cursor.

The problem is most likely with the application that is not able to locate the XKeysymDB database on the spot it is looking on.
To solve this issue you will need the root permissions on your machine.On CentOS the file is located in /usr/share/X11/.

Follow these steps to build a link to the XKeysymDB in the place an application is expecting it.
1. mkdir -p /usr/X11R6/lib/X11
2. cd /usr/X11R6/lib/X11
3. ln -s /usr/share/X11/XKeysymDB XKeysymDB
This should be it.

Wednesday, December 9, 2009

Subprojects setup (case study)

Take a look at your generic project (integration testing) now.

You will see the new directory "netKu" created under "Ku" folder.
The only entry in this directory is the NET#V5.6.6A - your NET project that is now included as a subproject into GEN#int_v80.01.

Note the project releases:
GEN#int_v80.01 release is G80.01 and
NET#V5.2.6A release is NET_V5.6.6A.

Now take a look at the reconfigure properties of the GEN#v80.01 project.
In the Java GUI this is called Project "Process Rule Properties".

You will notice the new folder has been added:
Folder 5347925: Automatic Tasks for Integration Testing projects for release NET_V5.6.6A
This folder is not created automatically, I've made it today.

This folder contains two automatic tasks for release NET_V5.6.6A:
Task 4179555: Integration Testing projects for release NET_V5.6.6A and
Task 4179556: Integration Testing products for release NET_V5.6.6A.

Having this folder in your prep project reconfigure properties ensures that you get the subproject updated properly upon update (a.k.a reconfigure) run.

Next, let's look at the NET#V5.6.6A properties.
In the "Work Area" tab you will see that currently the project does not have a work area. And so all the Work Area options are off.

Should you ever decide to build from the prep project (that you should do), you will switch the Work Area ON.
Once you do this, you will see the second "Path" option seen as a check box "Place work area relative to parent project's".

By default this is not checked, and all the projects are located in your default work area directory, all on the same directory level.

If you would rather have the subproject located in the relevant directory, just like you now see it in the Synergy interface, you should check the box. This will create the subproject directory inside the parent project tree.

Collaborative Development projects

In order to have the newly set hierarchy for the working projects as well, the following has to be done (I believe you have already done this, so the steps are for your people):

1. Check in all the files and directories currently checked out for both projects (parent and sub).
2. Delete working projects you currently have for releases G80.01 and NET_V5.6.6A.
3. Locate and show the Integration Testing project GEN#v80.01.
4. Copy project (right click the project name and select "Copy Project" option). New window will open with several fields to fill up.

Leave the first two with the default values.
In the third field "Subprojects:" select the "Copy all subprojects" value from the list.

In the fourth field "Versions:" type in the new project versions you want to assign.
Click the button with the double arrow on the right.
Note that as you now have two projects to copy you will have two fields for separate values for the parent project version and the subproject version.

Fill in the new project versions as you see fit and click OK to close the window.

The system will now create your personal copies of the both prep projects:
parent GEN#80.01 and subproject NET#V5.6.6A.

You should now see the hierarchy in your own collaborative development projects.

5. Next step is to set up the work area options for the subproject.

Locate the project and open its properties window. On the Work Area tab you will see the second "Path" option as a check box "Place work area relative to parent project's".

By default this is not checked, and all the projects are located in your default work area directory, all on the same directory level.

If you would rather have the subproject located in the relevant directory, just like you now see it in the Synergy interface, you should check the box.

This will create the subproject directory inside the parent project tree.

This will complete your setup.

Command line changes

Remember to update your subproject together with the update (reconfigure) you run for your parent project. Use "-r" flag with the "update" command.

The update command will look like this:

"ccm update –r –p GEN#userV80.01"

Note: in order to have collaborative development projects updated with the subproject properly there is an additional folder template "Collaborative automatic tasks for user %owner and release NET_V5.6.6A".


Thursday, December 3, 2009

Query for a release with particular name

e.g. looking for a release for the component MyComp:
$ ccm query -type releasedef "name='MyComp'" -f "%name %displayname %component_name %component_release %version"
1)
MyComp MyComp/1.00 MyComp 1.00 1.00
2)
MyComp MyComp/2.00 MyComp 2.00 2.00
$ ccm query -type releasedef "component_release='XYZ_V81513F'"
1) XYZ_V81513F release_admin ccm_root releasedef <void> 1 <void>
query for active releases with particular name:
$ ccm query -type releasedef "component_release='XYZ_V82510' and active=TRUE"

Query objects are of type working_saved_query

Use "working_saved_query".