Merge lp:~james-w/tarmac/exit-status into lp:tarmac

Proposed by James Westby
Status: Rejected
Rejected by: dobey
Proposed branch: lp:~james-w/tarmac/exit-status
Merge into: lp:tarmac
Prerequisite: lp:~james-w/tarmac/break-up-do-merges
Diff against target: 54 lines (+9/-4)
4 files modified
bin/tarmac (+3/-1)
tarmac/bin/__init__.py (+1/-1)
tarmac/bin/commands.py (+3/-0)
tarmac/bin/registry.py (+2/-2)
To merge this branch: bzr merge lp:~james-w/tarmac/exit-status
Reviewer Review Type Date Requested Status
dobey Disapprove
Paul Hummer Approve
Review via email: mp+144810@code.launchpad.net

Commit message

Return exit status of the tarmac script.

Description of the change

This allows the commands to set an exit status for the whole
tarmac script. We need it so that we can communicate some status
information to jenkins.

(from the u1 fork)

To post a comment you must log in.
Revision history for this message
Paul Hummer (rockstar) :
review: Approve
Revision history for this message
Paul Hummer (rockstar) wrote :

The prerequisite lp:~james-w/tarmac/break-up-do-merges has not yet been merged into lp:tarmac.

Revision history for this message
dobey (dobey) wrote :

Please create bugs for the issues, include tests, and split the changes into a branch or two which do not have unnecessary dependencies on other unrelated changes.

review: Disapprove

Unmerged revisions

424. By James Westby

Merged break-up-do-merges into exit-status.

423. By James Westby

Merged break-up-do-merges into exit-status.

422. By James Westby

Merged break-up-do-merges into exit-status.

421. By James Westby

Merged break-up-do-merges into exit-status.

420. By James Westby

Merged break-up-do-merges into exit-status.

419. By James Westby

Allow the command to set the exit status.

418. By James Westby

Remove the option that isn't defined yet.

417. By James Westby

Break up the very large do_merges method somewhat.

416. By James Westby

Add the commit message plugin that sets [r=<reviewer>] and bug info.

415. By James Westby

Decode stderr/stdout from the command, ignoring errors.

We were seeing UnicodeDecodeErrors in Jenkins on occaision, so
we changed the code to be more robust, and to discard anything
that couldn't be decoded from utf-8.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/tarmac'
2--- bin/tarmac 2010-06-17 17:23:37 +0000
3+++ bin/tarmac 2013-02-01 17:17:22 +0000
4@@ -2,5 +2,7 @@
5 # vim:filetype=python
6 '''Main tarmac script.'''
7
8+import sys
9+
10 from tarmac.bin import main
11-main()
12+sys.exit(main())
13
14=== modified file 'tarmac/bin/__init__.py'
15--- tarmac/bin/__init__.py 2010-09-02 15:18:07 +0000
16+++ tarmac/bin/__init__.py 2013-02-01 17:17:22 +0000
17@@ -27,4 +27,4 @@
18 args = sys.argv[1:]
19 if not args:
20 args = ['help']
21- registry.run(args)
22+ return registry.run(args)
23
24=== modified file 'tarmac/bin/commands.py'
25--- tarmac/bin/commands.py 2013-02-01 17:17:22 +0000
26+++ tarmac/bin/commands.py 2013-02-01 17:17:22 +0000
27@@ -397,3 +397,6 @@
28 'An error occurred trying to merge %s: %s',
29 branch, error)
30 raise
31+ if len(filter(lambda x: x is False, statuses)) > 0:
32+ return 2
33+ return 0
34
35=== modified file 'tarmac/bin/registry.py'
36--- tarmac/bin/registry.py 2010-10-25 20:20:18 +0000
37+++ tarmac/bin/registry.py 2013-02-01 17:17:22 +0000
38@@ -45,7 +45,7 @@
39
40 def _run(self, args):
41 '''Execute the command.'''
42- run_bzr(args)
43+ return run_bzr(args)
44
45 def install_hooks(self):
46 '''Use the bzrlib Command support for running commands.'''
47@@ -57,7 +57,7 @@
48 def run(self, args):
49 '''Execute the command.'''
50 try:
51- self._run(args)
52+ return self._run(args)
53 except BzrCommandError, e:
54 sys.exit('tarmac: ERROR: ' + str(e))
55

Subscribers

People subscribed via source and target branches