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
=== modified file 'loc-contributions'
--- loc-contributions 2012-05-17 12:11:18 +0000
+++ loc-contributions 2012-05-17 12:11:18 +0000
@@ -54,8 +54,9 @@
54 return54 return
5555
5656
57def show_loc(options, author):57def show_loc(options, author=None):
58 branch = Branch.open(".")58 branch = Branch.open(".")
59 author = branch.get_config_stack().get('email')
59 logger = log.Logger(branch, {60 logger = log.Logger(branch, {
60 "direction": "forward",61 "direction": "forward",
61 "start_revision": options.start_rev,62 "start_revision": options.start_rev,
@@ -108,7 +109,7 @@
108109
109110
110def main(args):111def main(args):
111 usage = "%prog [options] AUTHOR"112 usage = "%prog [options] [AUTHOR]"
112 description = dedent("""\113 description = dedent("""\
113 Show contributions to lines-of-code count by a given author.114 Show contributions to lines-of-code count by a given author.
114115
@@ -122,10 +123,14 @@
122 parser.add_option("--verbose", action="store_true", default=False,123 parser.add_option("--verbose", action="store_true", default=False,
123 help="Show detailed information about each revision.")124 help="Show detailed information about each revision.")
124 options, args = parser.parse_args(args)125 options, args = parser.parse_args(args)
125 if len(args) != 1:126 if len(args) > 1:
126 parser.error("must select an author")127 parser.error("must select only one author")
128 elif len(args) == 1:
129 author = args[0]
130 else:
131 author = None
127132
128 show_loc(options, args[0])133 show_loc(options, author)
129134
130 return 0135 return 0
131136

Subscribers

People subscribed via source and target branches