1

I'm trying to figure out why someone has deleted a file inside of a bzr repository. I know it was there before, but now it's gone. There has been several hundred commits since then. No one wants to read through each one. I just want to find the revision number when the file was removed to figure out why it was deleted.

Is there a command in bzr that can do that? I tried using bzr log filename but it gives me an error:

bzr: ERROR: Path unknown at end or start of revision range:

Any suggestions?

Allen
  • 794
  • 1
  • 6
  • 19

2 Answers2

4

You could dump the results of bzr log -v to a file, then search that for the first occurrence of the path in question.

Alternatively, use the --xml option of log and use XPath to query for a element containing the path in question, which is the child of the element for deleted items.

Adam Glauser
  • 877
  • 4
  • 13
  • 1
    If you roughly know revision when the file was still present and revision where the file is absent, then you can narrow down your search with `bzr log -rN..M -v` and then search for specific filename. – bialix Jul 07 '12 at 11:51
0

Dump the log or a range of the log using bzr log -rN..M -v as suggested by others.

To make the result a bit easier to read with only revision numbers and the removed files this filter with sed might be useful:

bzr log -v -r1..-1 | sed -ne '/^revno/ p' -e '/^removed/,/^[^ ]/{/^ / p}'
janos
  • 120,954
  • 29
  • 226
  • 236
  • Getting this error: sed: 1: "/^removed/,/^[^ ]/{/^ / ...": extra characters at the end of p command when I run through bash terminal – Allen Aug 15 '12 at 03:29
  • Ah, you must be on BSD. Try this instead: `bzr log -v -r1..-1 | sed -ne '/^revno/ p' -e '/^removed/,/^[^ ]/ p'`. The output is a bit less clean this way but should work. – janos Aug 15 '12 at 06:17