values given to make_log_request_dict are overridden

Bug #747958 reported by Thomi Richards
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

I believe that there's a bug in bzrlib/log.py, where the 'levels' value I pass to `make_log_request_dict` gets overridden by bzrlib.

The documentation suggests that when making my log request dictionary I should be able to specify 'levels=1' to limit the revisions printed by the Logger to mainline ones only.

However, what actually happens is that the value I specify gets overrwritten in bzrlib/log.py:357 with whatever the log formatter supports. The comment says:

# Tweak the LogRequest based on what the LogFormatter can handle.
# (There's no point generating stuff if the formatter can't display it.)

But the code will overwrite the levels value if the logger supports more levels than I wanted as well as fewer levels than I wanted!

Attached is a simple script that demonstrated the problem. It should print out only mainline revisions from a branch (that is specified as a first argument), but instead it prints out all levels.

Related branches

Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

Attached is a patch which fixes the issue for me.

Revision history for this message
Vincent Ladeuil (vila) wrote :

Nice catch !

This seems correct at first glance, so:
- did you try running the tests ? ('bzr selftest -s bt.test_log -s bb.test_log' should be enough),
- can you try to turn your patch into a merge proposal ?

Changed in bzr:
status: New → Confirmed
Vincent Ladeuil (vila)
Changed in bzr:
importance: Undecided → Medium
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

Please see merge proposal. Bzr selftests fail for me, but they fail in exactly the same way as they do for vanilla trunk - if I had more time I'd look into this - perhaps next week.

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.