use bazaar to log changes (especially file removals) in a directory recursively
Neil Martinsen-Burrell
nmb at wartburg.edu
Mon Apr 14 17:23:03 BST 2008
Rahul Nabar <rpnabar <at> gmail.com> 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 bzr.dev seems to have a broken log command:
nmb at guttle[~/src/bzr/bzr.dev]$ bzr log -r 3365 bzrlib
bzr: ERROR: exceptions.KeyError:
'john at arbash-meinel.com-20050711051006-2d11704675600e95'
Traceback (most recent call last):
File "/Users/nmb/src/bzr/bzr.dev/bzrlib/commands.py", line 846, in
run_bzr_catch_errors
return run_bzr(argv)
File "/Users/nmb/src/bzr/bzr.dev/bzrlib/commands.py", line 802, in run_bzr
ret = run(*run_argv)
File "/Users/nmb/src/bzr/bzr.dev/bzrlib/commands.py", line 504, in
run_argv_aliases
return self.run(**all_cmd_args)
File "/Users/nmb/src/bzr/bzr.dev/bzrlib/commands.py", line 812, in ignore_pipe
result = func(*args, **kwargs)
File "/Users/nmb/src/bzr/bzr.dev/bzrlib/builtins.py", line 1791, in run
limit=limit)
File "/Users/nmb/src/bzr/bzr.dev/bzrlib/log.py", line 185, in show_log
start_revision, end_revision, search, limit)
File "/Users/nmb/src/bzr/bzr.dev/bzrlib/log.py", line 215, in _show_log
allow_single_merge_revision)
File "/Users/nmb/src/bzr/bzr.dev/bzrlib/log.py", line 282, in
calculate_view_revisions
view_revisions)
File "/Users/nmb/src/bzr/bzr.dev/bzrlib/log.py", line 482, in
_filter_revisions_touching_file_id
rev_ancestry = rev_ancestry.union(ancestry[parent])
KeyError: 'john at arbash-meinel.com-20050711051006-2d11704675600e95'
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
plugins:
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/bzr.dev/bzrlib/plugins/launchpad [unknown]
multiparent /Users/nmb/src/bzr/bzr.dev/bzrlib/plugins/multiparent.pyc
[unknown]
qbzr /Users/nmb/.bazaar/plugins/qbzr [0.8.0]
*** Bazaar has encountered an internal error.
Please report a bug at https://bugs.launchpad.net/bzr/+filebug
including this traceback, and a description of what you
were doing when the error occurred.
More information about the bazaar
mailing list