Jump to content

Finding changesets where a file is changed


Recommended Posts

I'm trying to locate the changeset when a particular file was deleted. I'm trying to use the query system of cm find or the Changesets view in the GUI. I see documentation saying that you can query on a variety of items, but nowhere do I see a list of things that can be searched for (cm find object [where conditions] [on repositories] [options] <-- but what are the valid where conditions?), and the few examples that are given are almost always dates, labels, or users. What I want to do is something like "find changeset where filename='DisplayNameAttribute'", however "filename" is not a valid, nor is file or name.

Link to post
Share on other sites

Honestly, we have to bring back the "delete view" from Plastic 3.

Meanwhile you can do the following: (inside your workspace)

cm log -a | findstr /n /b /c:" D c:\tmp\log2\MyFolder\File.txt"
cm log -a > allLog.txt

This line is going to give you the match line number, so you just need to go to the line and review in which changeset was done.

Hope it helps!

Link to post
Share on other sites

You can do two things quickly:

cm find revs where item="your file".

Then you'll check the history (same as cm hist)

You can also check the history of its directory, at a given point it will contain the "deletion" of the file.

Link to post
Share on other sites
  • 4 years later...

What if I'd like to view the history on a file that was deleted?  Say I only know part of the file name and don't know its exact path?  Even viewing the last rev before deletion would be useful.

Link to post
Share on other sites

Hi v2k!

 

first you need to know when and where the file was deleted, in order to do it you can use the "cm find removed" command.

 

It will give you:

* Time stamp of the "delete" operation

* Owner, who removed the item.

* Changeset number where the delete operation is recorded.

* Branch where the changeset lives.

* Path of the item.

 

Example: 

7/1/2016 10:27:57 AM manu     154       br:/main/task4245             c:\Users\manu\wkspaces\repo_zero\src\core.c

It will be easy to "grep" the output in order to get you file, once you have it get its history.

 

You can get the history in two different ways.

 

1) CLI

 

Query the previous changeset where the file was deleted, in my example the file was removed at the changeset #154 so I go for the #153 where I know the file was alive.

 

cm hist rev:foo.c#cs:153@repo_zero@localhost:8087

 

2) GUI

 

Open the branch explorer and diff the changeset (double click it) the "cm find removed" gave you. The context menu will be offer you the "history" operation.

 

Hope it helps!

  • Like 1
Link to post
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...