dkoontz Posted June 7, 2012 Report Share Posted June 7, 2012 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 comment Share on other sites More sharing options...
manu Posted June 8, 2012 Report Share Posted June 8, 2012 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 comment Share on other sites More sharing options...
psantosl Posted June 13, 2012 Report Share Posted June 13, 2012 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 comment Share on other sites More sharing options...
manu Posted June 14, 2012 Report Share Posted June 14, 2012 Pablo, correct me if I'm wrong but I think that the "cm find revs" and the "cm hist" command are not going to work for a deleted file. Link to comment Share on other sites More sharing options...
psantosl Posted June 14, 2012 Report Share Posted June 14, 2012 Well, but it will do for the containing directory. Link to comment Share on other sites More sharing options...
v2k Posted June 30, 2016 Report Share Posted June 30, 2016 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 comment Share on other sites More sharing options...
manu Posted July 1, 2016 Report Share Posted July 1, 2016 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! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.