Jump to content

Changesets view export in csv via cm


vesk0

Recommended Posts

Hi,

We need to export changesets view from one changeset ID to another.

 

The business case is as follows:

1. We made successful build in one of branches.

2. We set attribute named "Last_Successeful_Build_Changeset_ID" in this branch.

3. On the next build for that branch we need to read value from that attribute and use cm to export changesets view (as shown in UI) in CSV file on specified by us location and filename.

 

For now we've managed to set attribute value for specified branch (for example '\main\branch1'

 

Please help:

1. We need cm command to read value of that attribute (by type) for specified branch. For example something like: find attribute where type = 'Last_Successeful_Build_Changeset_ID' and branch = '\main\branch1'

2. We need functionality to export changesets view for specified branch with parameters from changeset id and to changeset id.

 

Best Regards,

Vesselin Pavlov

Link to comment
Share on other sites

Hi Vesselin,

 

 

We need to export changesets view from one changeset ID to another.

 

I'm not sure if I'm able to understand that one :P

 

But let me throw you some commands that, maybe, you will find useful.

 

1) Get the last successful build changeset in a branch.

 

We need the branch id.

 

> cm find branch where name='main' --format={id} --nototal
3

 

Now whe need the value of the attribute:

 

> cm find attribute where type='Last_Successeful_Build_Changeset_ID' and srcobj=3 --format={value} --nototal
142

 

So, we know that the cset number 142 is the last successful build.

 

 

2) Export changeset info

C:\tmp\defa>cm find changeset where branch='main' --nototal --format="{id},{date},{owner}"
5,29/03/2013 12:47:51,all
18,27/03/2013 13:39:59,tester
26,27/03/2013 17:13:09,mlucio
31,27/03/2013 17:13:15,mlucio
36,27/03/2013 17:13:21,mlucio
41,27/03/2013 17:13:26,mlucio

 

 

You can use the following fields for the changeset object:

 


BRANCH
        attribute
        attrvalue
        changesets
        comment
        date
        guid
        id
        item
        name
        owner
        parent
        repllogid
        replsrcdate
        replsrcid
        replsrcrepository
        replsrcserver
Link to comment
Share on other sites

Hi, 

With "We need to export changesets view from one changeset ID to another." I mean:

1. We make build and last changeset id for that build is for example 31 (as shown in your post).

2. After few days we make another build and then last changeset id is 41.

So in second build we want to make csv with changeset data for changesets with ID greater than 31. In this case changesets 36 and 41.
I think that to query (as you show it) C:\tmp\defa>cm find changeset where branch='main' --nototal --format="{id},{date},{owner}"  must be added only where clause for changeset id > 31

 

As you may notice we want to use Plastic SCM to build our technical release info document.

 

However your reply is very useful for us and I thank you for your quick response and good solution.

 

Regards!

Link to comment
Share on other sites

  • 9 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...