Merge lp:~gagern/bzr/bug513322-authors into lp:bzr
| Status: | Merged |
|---|---|
| Approved by: | Vincent Ladeuil on 2010-05-05 |
| Approved revision: | 4096 |
| Merged at revision: | 5211 |
| Proposed branch: | lp:~gagern/bzr/bug513322-authors |
| Merge into: | lp:bzr |
| Diff against target: |
333 lines (+228/-9) 4 files modified
NEWS (+4/-0) bzrlib/builtins.py (+9/-2) bzrlib/log.py (+70/-7) bzrlib/tests/test_log.py (+145/-0) |
| To merge this branch: | bzr merge lp:~gagern/bzr/bug513322-authors |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Gary van der Merwe | Approve on 2010-05-05 | ||
| Robert Collins (community) | 2010-04-09 | Abstain on 2010-05-05 | |
| Vincent Ladeuil | 2010-04-16 | Approve on 2010-04-19 | |
|
Review via email:
|
|||
This proposal supersedes a proposal from 2010-04-01.
Description of the Change
This patch introduces a --authors switch to bzr log, allowing users to override the choice of authors for all built-in formats. It comes with a NEWS item and several test cases.
I'm not perfectly happy with the naming, so if you prefer different names for some method or attribute, let me know. I also haven't included a blackbox test ensuring that the --authors command line switch actually gets passed to the log formatter. Do you consider this necessary?
| Martin von Gagern (gagern) wrote : | # |
The registry is here, and now I've even signed the canonical contributor agreement. Care to review and hopefully merge this?
| Vincent Ladeuil (vila) wrote : | # |
It's easier to review changes if you just push to your original branch and put the mp status back to 'Needs review', your additional revisions then appear after the review comments.
There are still a few details though:
91 + def authors(self, rev, who, short=False, sep=None):
92 + if self._author_
93 + author_list_handler = self._author_
94 + else:
95 + author_list_handler = author_
If 'who' changes, your cached value for the handler is wrong, I don't think it
worth taking the risk, get rid of the cached value instead.
PEP8 nits:
133 +def author_
134 + return rev.get_
135 +
136 +def author_
137 + lst = rev.get_
138 + try:
139 + return [lst[0]]
140 + except IndexError:
141 + return []
142 +
143 +def author_
Two blank lines between functions.
This could be fixed by the second reviewer before merging I think.
| Vincent Ladeuil (vila) wrote : | # |
Clicked send too fast.
The overall change looks good to me apart from the details above so it's a bb:tweak (i.e. doesn't need another review to be merged, the required changes being trivial)
| Martin von Gagern (gagern) wrote : | # |
> It's easier to review changes if you just push to your original branch and put the mp status back to 'Needs review', your additional revisions then appear after the review comments.
I thought so at first as well. But with the predecessor of this branch
here, I had waited in the "Needs review" state (which the merge requests
maintained anyway, so there was no need to reset anything) for five days
without another vote, then I resubmitted and received an approval within
the day and got it merged within two days.
See https:/
So from that experience, I derived the mental note "resubmit if you want
to get things moving". Nevertheless, I'll give the simple push another try.
> There are still a few details though:
>
> 91 + def authors(self, rev, who, short=False, sep=None):
> 92 + if self._author_
> 93 + author_list_handler = self._author_
> 94 + else:
> 95 + author_list_handler = author_
>
> If 'who' changes, your cached value for the handler is wrong, I don't think it
> worth taking the risk, get rid of the cached value instead.
self._author_
override. The idea is that the log formatter has a preference of whom to
list as author(s), and expresses this preference in the 'who' argument.
The user, on the other hand, can force a different choice, which
overrides whatever the formatter uses by default.
self._author_
Or were you talking about some other cache? If so, I don't see which.
> PEP8 nits:
> Two blank lines between functions.
Fixed and pushed.
- 4094. By Martin von Gagern on 2010-04-19
-
Separate top level functions with two blank lines.
In response to review by Vincent Ladeuil, aiming for conformance with PEP 8.
- 4095. By Martin von Gagern on 2010-04-19
-
Added extensive docstring and comments to authors method.
- 4096. By Martin von Gagern on 2010-04-19
-
Pass keyword arguments of authors method by name.
| Gary van der Merwe (garyvdm) wrote : | # |
Small nit pick: Please put your name, and the bug number in NEWS. I've fixed this for you, and submitted to pqm.

The manual parsing and the structure of the if block says to me that this would be better handled by a registry of author handlers.