use bazaar to log changes (especially file removals) in a directory recursively

Neil Martinsen-Burrell nmb at
Mon Apr 14 17:23:03 BST 2008

Rahul Nabar <rpnabar <at>> writes:

> Here's a Bazaar feature that confuses me: How can I query a parent dir
> recursively and get a log of what changes occurred in all sub-dirs and
> files.
> Let's say I have  a dir ~/parent with two files in it 1.txt and 2.txt.
> bzr add ~/parent
> added parent
> added parent/1.txt
> added parent/2.txt
> bzr commit ~/parent
> After this I set up a daily cron job that:
> bzr commit ~/parent --message "Daily automatic commit of changed files"
> So far so good. But if one day I removed 1.txt. The next daily cron
> commit would capture that.
> removed:
>   parent/1.txt
> But a month later if I wanted to know the history of what went on with
> this dir. and I try:
> bzr log ~/parent
> I only get my first "manual" commit as output with no indication of
> the removed file.  Which log would the "file removal" message be
> accessible through?  How can I figure out what files were deleted etc.
> over time?

It wasn't where I expected it, but ``bzr status`` can give you the information
you want by specifying a range of revisions.  Try ``bzr st -S -r
date:2008-2-14.. parent`` to see which files have changes since then.  I'd give
you some sample output, but my seems to have a broken log command:

nmb at guttle[~/src/bzr/]$ bzr log -r 3365 bzrlib
bzr: ERROR: exceptions.KeyError:
'john at'

Traceback (most recent call last):
  File "/Users/nmb/src/bzr/", line 846, in
    return run_bzr(argv)
  File "/Users/nmb/src/bzr/", line 802, in run_bzr
    ret = run(*run_argv)
  File "/Users/nmb/src/bzr/", line 504, in
  File "/Users/nmb/src/bzr/", line 812, in ignore_pipe
    result = func(*args, **kwargs)
  File "/Users/nmb/src/bzr/", line 1791, in run
  File "/Users/nmb/src/bzr/", line 185, in show_log
    start_revision, end_revision, search, limit)
  File "/Users/nmb/src/bzr/", line 215, in _show_log
  File "/Users/nmb/src/bzr/", line 282, in
  File "/Users/nmb/src/bzr/", line 482, in
    rev_ancestry = rev_ancestry.union(ancestry[parent])
KeyError: 'john at'

bzr 1.4dev on python 2.5.1 (darwin)
arguments: ['/Users/nmb/usr/bin/bzr', 'log', '-r', '3365', 'bzrlib']
encoding: 'US-ASCII', fsenc: 'utf-8', lang: None
  bzr_xmloutput        /Users/nmb/.bazaar/plugins/bzr_xmloutput [0.4.0]
  latex_version_info   /Users/nmb/.bazaar/plugins/latex_version_info [0.0.2]
  launchpad            /Users/nmb/src/bzr/ [unknown]
  multiparent          /Users/nmb/src/bzr/
  qbzr                 /Users/nmb/.bazaar/plugins/qbzr [0.8.0]
*** Bazaar has encountered an internal error.
    Please report a bug at
    including this traceback, and a description of what you
    were doing when the error occurred.

More information about the bazaar mailing list