Merge lp://qastaging/~jelmer/bzr-builder/stacked-on into lp://qastaging/bzr-builder

Proposed by Jelmer Vernooij
Status: Merged
Merged at revision: 113
Proposed branch: lp://qastaging/~jelmer/bzr-builder/stacked-on
Merge into: lp://qastaging/bzr-builder
Diff against target: 21 lines (+3/-1)
1 file modified
recipe.py (+3/-1)
To merge this branch: bzr merge lp://qastaging/~jelmer/bzr-builder/stacked-on
Reviewer Review Type Date Requested Status
Andrew Bennetts (community) Approve
Martin Pool (community) Needs Fixing
bzr-builder developers Pending
Review via email: mp+45950@code.qastaging.launchpad.net

Description of the change

When possible, use stacked branches when cloning the root branch. Newer
versions of bzr (>= 2.3b5) will allow committing in stacked branches.

This improves the memory usage which was causing problems on the Launchpad
buildds for large branches.

It's also a good idea in general, as it reduces network usage and overall time
spent cloning the branch.

To post a comment you must log in.
Revision history for this message
Martin Pool (mbp) wrote :

> stacked=(bzr_version_info >= (2, 3, 0, 'dev', 5)))

That comparison is wrong because 2.3.0.beta.5 is lexicographically lower. Sorry. (Maybe we should change our encoding to avoid this.)

You can use a more complex expression, or just assume 2.3.0.* is enough.

review: Needs Fixing
113. By Jelmer Vernooij

As pointed out by mbp, (2, 3, 0, "beta", 5) sorts before (2, 3, 0, "dev", 5)
so the latter can't be used to figure out whether committing to a stacked branch
is possible.

Simply use (2, 3, 0) instead.

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

On Wed, 2011-01-12 at 02:51 +0000, Martin Pool wrote:
> Review: Needs Fixing
> > stacked=(bzr_version_info >= (2, 3, 0, 'dev', 5)))
>
> That comparison is wrong because 2.3.0.beta.5 is lexicographically
> lower. Sorry. (Maybe we should change our encoding to avoid this.)
Thanks, that's a good point.

> You can use a more complex expression, or just assume 2.3.0.* is enough.
I'm not sure if it's worth adding a more complex expression here, so
I've updated it to simply assume that 2.3.0 is enough.

Another alternative would have been to check for one of the private
methods that was added by the commit-on-stacked branch, but I'm worried
that will quietly degrade performance again if it ever gets removed.

Cheers,

Jelmer

Revision history for this message
Martin Pool (mbp) wrote :

On 11 January 2011 21:49, Jelmer Vernooij <email address hidden> wrote:
> On Wed, 2011-01-12 at 02:51 +0000, Martin Pool wrote:
>> Review: Needs Fixing
>> > stacked=(bzr_version_info >= (2, 3, 0, 'dev', 5)))
>>
>> That comparison is wrong because 2.3.0.beta.5 is lexicographically
>> lower.  Sorry.  (Maybe we should change our encoding to avoid this.)
> Thanks, that's a good point.
>
>> You can use a more complex expression, or just assume 2.3.0.* is enough.
> I'm not sure if it's worth adding a more complex expression here, so
> I've updated it to simply assume that 2.3.0 is enough.

Works for me.

I wonder what the easiest way in Python to introspect "does callable a
accept a parameter b" is? (There is probably no non-Turing-complete
way to check for kwargs, but for statically declared arguments it
seems possible in principle.)

> Another alternative would have been to check for one of the private
> methods that was added by the commit-on-stacked branch, but I'm worried
> that will quietly degrade performance again if it ever gets removed.

I agree, that would be poor.

--
Martin

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

On Wed, 2011-01-12 at 04:04 +0000, Martin Pool wrote:
> On 11 January 2011 21:49, Jelmer Vernooij <email address hidden> wrote:
> > On Wed, 2011-01-12 at 02:51 +0000, Martin Pool wrote:
> >> Review: Needs Fixing
> >> > stacked=(bzr_version_info >= (2, 3, 0, 'dev', 5)))
> >>
> >> That comparison is wrong because 2.3.0.beta.5 is lexicographically
> >> lower. Sorry. (Maybe we should change our encoding to avoid this.)
> > Thanks, that's a good point.
> >
> >> You can use a more complex expression, or just assume 2.3.0.* is enough.
> > I'm not sure if it's worth adding a more complex expression here, so
> > I've updated it to simply assume that 2.3.0 is enough.
> Works for me.
>
> I wonder what the easiest way in Python to introspect "does callable a
> accept a parameter b" is? (There is probably no non-Turing-complete
> way to check for kwargs, but for statically declared arguments it
> seems possible in principle.)
It looks like inspect.getargs() can do that, although it has some
caveats (e.g. if the function is changed to accept *args, **kwargs it
will break).

In this particular case we can't check for new arguments, as no new
arguments to public methods were added - it's just a bug fix we need to
make sure is present in bzrlib.
(https://code.launchpad.net/~jameinel/bzr/2.3-commit-to-stacked/+merge/42698)

Cheers,

Jelmer

Revision history for this message
Andrew Bennetts (spiv) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches