Merge lp:~jelmer/lp-dev-utils/loc-contributions-author into lp:lp-dev-utils

Proposed by Jelmer Vernooij
Status: Rejected
Rejected by: Jelmer Vernooij
Proposed branch: lp:~jelmer/lp-dev-utils/loc-contributions-author
Merge into: lp:lp-dev-utils
Prerequisite: lp:~cjwatson/lp-dev-utils/loc-delta
Diff against target: 40 lines (+10/-5)
1 file modified
loc-contributions (+10/-5)
To merge this branch: bzr merge lp:~jelmer/lp-dev-utils/loc-contributions-author
Reviewer Review Type Date Requested Status
j.c.sackett (community) Needs Information
Review via email: mp+106145@code.launchpad.net

Description of the change

Default to the current users' email address in loc-contributions, since usually you're looking at your own LOC stats.

To post a comment you must log in.
Revision history for this message
j.c.sackett (jcsackett) wrote :

Do we need this? Looking at Colin Watson's branch (the prereq for this one) it seems that this improvement has already been implemented in rev 107.

review: Needs Information
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Yep - see Colin's MP.

Unmerged revisions

110. By Jelmer Vernooij

Default to current users' email address.

106. By William Grant

Fix ec2's ~/.bazaar/bazaar.conf generator to include a [DEFAULT] section header, letting bzr 2.5 see the email options so it doesn't just send to localhost.

105. By Aaron Bentley

Merge compatibility fixes.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'loc-contributions'
2--- loc-contributions 2012-05-17 12:11:18 +0000
3+++ loc-contributions 2012-05-17 12:11:18 +0000
4@@ -54,8 +54,9 @@
5 return
6
7
8-def show_loc(options, author):
9+def show_loc(options, author=None):
10 branch = Branch.open(".")
11+ author = branch.get_config_stack().get('email')
12 logger = log.Logger(branch, {
13 "direction": "forward",
14 "start_revision": options.start_rev,
15@@ -108,7 +109,7 @@
16
17
18 def main(args):
19- usage = "%prog [options] AUTHOR"
20+ usage = "%prog [options] [AUTHOR]"
21 description = dedent("""\
22 Show contributions to lines-of-code count by a given author.
23
24@@ -122,10 +123,14 @@
25 parser.add_option("--verbose", action="store_true", default=False,
26 help="Show detailed information about each revision.")
27 options, args = parser.parse_args(args)
28- if len(args) != 1:
29- parser.error("must select an author")
30+ if len(args) > 1:
31+ parser.error("must select only one author")
32+ elif len(args) == 1:
33+ author = args[0]
34+ else:
35+ author = None
36
37- show_loc(options, args[0])
38+ show_loc(options, author)
39
40 return 0
41

Subscribers

People subscribed via source and target branches