Jump to content

How to quickly compile history for an item that has been deleted and added back to a repository


liam.page

Recommended Posts

I'm working with some automation on Plastic, and one of the requirements is to get a list of revisions for an item, including instances where someone deleted it and someone else added the item back to a branch. Using the CLI, my first attempt was to use:

cm find revision where item=[itempath] 

My specific query was:
cm find revision where item='d:\Projects\steamroller\pipeline\steamroller.pipelinetesting\testFile.txt' --format="ItemID: {Itemid} +++ RevID: {id} +++ Item: {Item}"

With a resulting:
ItemID: 127410 +++ RevID: 127407 +++ Item: d:\Projects\steamroller\pipeline\steamroller.pipelinetesting\testFile.txt

Total: 1

However, this only gives the history of the item from the time it was added most recently. When I do a broader " cm find revision on repository [repspec] ", my test files show up with their adds and deletes 

ItemID: 127390 +++ RevID: 127387 +++ Item: d:\Projects\steamroller\pipeline\steamroller.pipelinetesting\testFile.txt
ItemID: 127391 +++ RevID: 127388 +++ Item: d:\Projects\steamroller\pipeline\steamroller.pipelinetesting\testFile2.txt
ItemID: 2 +++ RevID: 127393 +++ Item: d:\Projects\steamroller\pipeline\steamroller.pipelinetesting\
ItemID: 2 +++ RevID: 127399 +++ Item: d:\Projects\steamroller\pipeline\steamroller.pipelinetesting\
ItemID: 127400 +++ RevID: 127397 +++ Item: d:\Projects\steamroller\pipeline\steamroller.pipelinetesting\testFile.txt
ItemID: 127401 +++ RevID: 127398 +++ Item: d:\Projects\steamroller\pipeline\steamroller.pipelinetesting\testFile2.txt
ItemID: 2 +++ RevID: 127403 +++ Item: d:\Projects\steamroller\pipeline\steamroller.pipelinetesting\
ItemID: 2 +++ RevID: 127409 +++ Item: d:\Projects\steamroller\pipeline\steamroller.pipelinetesting\
ItemID: 127410 +++ RevID: 127407 +++ Item: d:\Projects\steamroller\pipeline\steamroller.pipelinetesting\testFile.txt
ItemID: 127411 +++ RevID: 127408 +++ Item: d:\Projects\steamroller\pipeline\steamroller.pipelinetesting\testFile2.txt

Listing every revision is a super inefficient way of going about this task though. Is there a better filter to use when trying to pull this info out? I can't seem to find anything obvious in the showfindobjects list.

Thanks in advance!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...