Merge lp:~statik/tarmac/tinyfixes into lp:tarmac

Proposed by Elliot Murphy
Status: Merged
Approved by: Paul Hummer
Approved revision: 47
Merged at revision: not available
Proposed branch: lp:~statik/tarmac/tinyfixes
Merge into: lp:tarmac
Diff against target: None lines
To merge this branch: bzr merge lp:~statik/tarmac/tinyfixes
Reviewer Review Type Date Requested Status
Paul Hummer Approve
Review via email: mp+4173@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Elliot Murphy (statik) wrote :

Fantastic project! Here are some quick fixes which make it more usable for me. I'll probably do a branch in a bit with a proposal for one way to handle the branch test_before_merge stuff.

Revision history for this message
Paul Hummer (rockstar) wrote :

Elliot-

  Awesome! Thanks so much for this. I'd never used OptionParser before, so
your changes are quite welcome, having done something that I couldn't find in
the docs anywhere.

 vote approve
 status approved

> === modified file 'tarmac-lander' (properties changed: -x to +x)
> --- tarmac-lander 2009-03-03 05:50:57 +0000
> +++ tarmac-lander 2009-03-05 00:11:00 +0000
> @@ -1,5 +1,5 @@
> +#!/usr/bin/env python
> # Copyright (c) 2009 - Paul Hummer
> -#!/usr/bin/env python
> from tarmac.bin import TarmacLander
>
> if __name__ == '__main__':
>

When the heck did this happen? Weird. Thanks for fixing it.

--
Paul Hummer
http://theironlion.net
1024/862FF08F C921 E962 58F8 5547 6723 0E8C 1C4D 8AC5 862F F08F

review: Approve
Revision history for this message
Paul Hummer (rockstar) wrote :

Commit message: OptionParser handles parsing of arguments and options now (Elliot Murphy)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tarmac-lander' (properties changed: -x to +x)
2--- tarmac-lander 2009-03-03 05:50:57 +0000
3+++ tarmac-lander 2009-03-05 00:11:00 +0000
4@@ -1,5 +1,5 @@
5+#!/usr/bin/env python
6 # Copyright (c) 2009 - Paul Hummer
7-#!/usr/bin/env python
8 from tarmac.bin import TarmacLander
9
10 if __name__ == '__main__':
11
12=== modified file 'tarmac/bin.py'
13--- tarmac/bin.py 2009-03-04 05:33:47 +0000
14+++ tarmac/bin.py 2009-03-05 00:29:19 +0000
15@@ -21,23 +21,19 @@
16
17 def __init__(self):
18
19- parser = OptionParser()
20+ parser = OptionParser("%prog [options] <projectname>")
21 parser.add_option('--dry-run', action='store_true', dest='dry_run',
22 help='Print out the branches that would be merged and their '
23 'commit messages, but don\'t actually merge the branches.')
24- options = parser.parse_args()[0]
25+ options, args = parser.parse_args()
26 self.dry_run = options.dry_run
27
28- try:
29- self.project = sys.argv[1]
30- except IndexError:
31+ if len(args) != 1:
32 # This code is merely a placeholder until I can get proper argument
33 # handling, at which point this should print usage information.
34- print (
35- 'Oops! You\'ve forgotten to specify a project to land '
36- 'branches for. Please specify your project as the first '
37- 'argument to tarmac-lander.')
38- sys.exit()
39+ parser.error("Please specify a project name.")
40+
41+ self.project, = args
42
43 def _find_commit_message(self, comments):
44 '''Find the proper commit comment.'''

Subscribers

People subscribed via source and target branches