Merge lp:~james-w/launchpad/pipe-lint into lp:launchpad

Proposed by James Westby
Status: Merged
Approved by: Edwin Grubbs
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~james-w/launchpad/pipe-lint
Merge into: lp:launchpad
Diff against target: 22 lines (+9/-3)
1 file modified
buildout-templates/bin/lint.sh.in (+9/-3)
To merge this branch: bzr merge lp:~james-w/launchpad/pipe-lint
Reviewer Review Type Date Requested Status
Edwin Grubbs (community) Approve
Review via email: mp+23437@code.launchpad.net

Description of the change

Hi,

There is logic in lint.sh to make it DWIM for looms. This branch extends
it to do the same for pipes.

It uses a bit of shell to tell if there are any earlier pipes in the pipeline,
and if so uses the ancestor diff against the previous pipe. Otherwise it
retains the original behaviour and uses the parent.

Thanks,

James

To post a comment you must log in.
Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Hi James,

This branch looks good. There is just a misspelling: "pipline"

-Edwin

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'buildout-templates/bin/lint.sh.in'
2--- buildout-templates/bin/lint.sh.in 2009-10-07 15:46:47 +0000
3+++ buildout-templates/bin/lint.sh.in 2010-04-14 22:48:38 +0000
4@@ -56,9 +56,15 @@
5 # This is a loom, lint changes relative to the lower thread.
6 rev_option="-r thread:"
7 else
8- # Lint changes relative to the parent.
9- rev=`bzr info | sed '/parent branch:/!d; s/ *parent branch: /ancestor:/'`
10- rev_option="-r $rev"
11+ if test "$(bzr pipes | sed -n -e "/^\\*/q;p" | wc -l)" -gt 0 ; then
12+ # This is a pipeline with at least one pipe before the current,
13+ # lint changes relative to the previous pipe
14+ rev_option="-r ancestor::prev"
15+ else
16+ # Lint changes relative to the parent.
17+ rev=`bzr info | sed '/parent branch:/!d; s/ *parent branch: /ancestor:/'`
18+ rev_option="-r $rev"
19+ fi
20 fi
21 elif [ $diff_status -eq 1 ] ; then
22 # Uncommitted changes in the tree, lint those changes.