Allen
Allen

Reputation: 834

Find bzr revision where file was deleted

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?

Upvotes: 1

Views: 365

Answers (2)

janos
janos

Reputation: 124704

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}'

Upvotes: 0

Adam Glauser
Adam Glauser

Reputation: 877

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.

Upvotes: 4

Related Questions