Searching history to find out which files I've changed
Francis Devereux
francis at devrx.org
Fri Mar 18 14:57:07 UTC 2011
On 18 Mar 2011, at 03:50, Neil Martinsen-Burrell wrote:
> On Thu, Mar 17, 2011 at 10:48, Francis Devereux <francis at devrx.org> wrote:
>> Hello list,
>>
>> I would like to find out which files I've changed between a certain revision and the latest one (i.e. want to see a list that includes files that I have changed but not files that other committers have changed).
>>
>> Does bazaar provide a way of doing this?
>>
>> Ideally I'd like a single list of files, but being able to filter "bzr log -v -r1234.." by committer would be good too (I could merge the lists of files in each revision into one big list by piping it through sort & uniq).
>
> Once https://code.launchpad.net/~nmb/bzr/log-wide-lines/+merge/53937
> lands, you should be able to do "BZR_COLUMNS=0 bzr log --line -r1234..
> |grep "My Name" |cut -d ' ' -f 1" to get a list of the revisions that
> you changed and then use that list to grab the files using "bzr st
> -c". This isn't pretty, but it works okay:
>
> for revno in `BZR_COLUMNS=0 bzr log --line -r 5000.. | grep "Neil
> Martinsen-Burrell" |cut -d ' ' -f 1 |cut -d: -f 1`; do bzr st -c
> $revno; done
Thanks to your tip about "bzr status -c" I've been able to do it with the current release of bzr. I used perl to delete the newline at the end of the "revno" line so that revno and committer appear on the same line, which means that I can grep them. Here's the command I used:
for REV in `bzr log -r5474.. | perl -i -p -e 's/^revno:(.*)\n/revno:\1 /' | grep ^revno | grep -i francis | awk '{ print $2 }'`; do bzr status -c $REV; done | grep '^ ' | sort | uniq > my_changed_files.txt
Francis
More information about the bazaar
mailing list