Merge lp://staging/~vila/bzr/320119-exclude-ancestry into lp://staging/bzr

Proposed by Vincent Ladeuil
Status: Merged
Approved by: Vincent Ladeuil
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp://staging/~vila/bzr/320119-exclude-ancestry
Merge into: lp://staging/bzr
Prerequisite: lp://staging/~vila/bzr/cleanup-log-direction
Diff against target: 428 lines (+189/-17)
8 files modified
NEWS (+7/-1)
bzrlib/branch.py (+16/-2)
bzrlib/builtins.py (+14/-2)
bzrlib/log.py (+35/-11)
bzrlib/tests/blackbox/test_log.py (+12/-0)
bzrlib/tests/per_branch/test_iter_merge_sorted_revisions.py (+44/-0)
bzrlib/tests/per_repository_reference/__init__.py (+1/-1)
bzrlib/tests/test_log.py (+60/-0)
To merge this branch: bzr merge lp://staging/~vila/bzr/320119-exclude-ancestry
Reviewer Review Type Date Requested Status
Andrew Bennetts Needs Fixing
Review via email: mp+23394@code.staging.launchpad.net

Commit message

Add --exclude-common-ancestry log option

Description of the change

This patch adds an --exclude-common-anccestry to bzr log so that -rX..Y becomes
a real graph difference (killing two birds with one stone, it also fixes bug #320119).

From now on, I consider that the log has reached the point where it's really
hard to add new features. The major culprit is the optimization to avoid
loading the whole graph, so no need to spend much time on the log code
unless this problem is correctly addressed.

The performance impact may be significant but I'd like real-life feedback on its
usage before trying to replace the is_ancestor() call by any caching of the X ancestry
(which may be quite significant anyway).

Again, having a better lazy-loaded graph ancestry is needed there.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

This seems like something other commands than log will want; perhaps we
should tackle it using an algreba, like git does?

Revision history for this message
Andrew Bennetts (spiv) wrote :

You have a few conflicts because this branch waited so long for a review. Sorry :(

You define a new stop_rule for iter_merge_sorted_revisions, but you haven't added it to the docstring. Please fix that.

It's a shame that make_branch_with_alternate_ancestries is duplicated in test_log and per_branch.test_iter_merge_sorted_revisions. Perhaps make it a function and have the latter import it from the former? Please at least add comments in both places noting the duplication.

(And further, it's a shame that the description of the ancestry is duplicated within that code... if only there were some way to do "make_branch_from_ascii_art_ancestry".)

Other than those, this seems ok to me. Once you fix those issues you can consider my vote upgraded to Approve.

I get the feeling that the next time we are tempted to another parameter to log we should think about refactoring the way we pass log options through the various layers (maybe with a LogOptions object? Or maybe Robert's idea about an algebra...), but this is ok for now.

review: Needs Fixing
Revision history for this message
Vincent Ladeuil (vila) wrote :

>>>>> Andrew Bennetts <email address hidden> writes:

    > Review: Needs Fixing

    > You have a few conflicts because this branch waited so long for a review. Sorry :(

    > You define a new stop_rule for iter_merge_sorted_revisions, but
    > you haven't added it to the docstring. Please fix that.

Done.

    > It's a shame that make_branch_with_alternate_ancestries is
    > duplicated in test_log and
    > per_branch.test_iter_merge_sorted_revisions. Perhaps make it a
    > function and have the latter import it from the former? Please at
    > least add comments in both places noting the duplication.

Since there is a valuable slight variation, I went with adding comments.

    > (And further, it's a shame that the description of the ancestry is
    > duplicated within that code... if only there were some way to do
    > "make_branch_from_ascii_art_ancestry".)

Hehe, ideally I'd prefer some GUI to define the graph and get both the
ascii art and the branchbuilder stuff from that. ascii art is *not* fun
to write ;)

    > Other than those, this seems ok to me. Once you fix those issues
    > you can consider my vote upgraded to Approve.

Thanks.

    > I get the feeling that the next time we are tempted to another
    > parameter to log we should think about refactoring the way we pass
    > log options through the various layers (maybe with a LogOptions
    > object?

Definitely, but we also need to wire that up to the command line as many
log formatters will want their own options, I've punted on that one so
far for lack of time to research how to catch the options not recognized
by the parser and allow plugins or any external code to give it a try.

    > Or maybe Robert's idea about an algebra...), but this is ok for
    > now.

Revision history for this message
bzr PQM (bzr-pqm) wrote :

Successful steps
Failure output:
All lines of log output:
Executing star-merge lp:~vila/bzr/320119-exclude-ancestry at Wed Apr 28 10:41:57 2010
['Nothing to merge.']

Revision history for this message
Vincent Ladeuil (vila) wrote :

Meh, where is that pqm failure coming from ?
I sent a single submission with feed-pqm and it was merged.... (I didn't get a success email for it though).

Revision history for this message
Robert Collins (lifeless) wrote :

This is probably due to lp taking too long to mark the branch as
merged: if it takes longer than pqm takes to try again, then pqm will
see it as still pending. Possibly we should:
mark things we succeed at as approved
adding a comment that it landed ok

or mark it as merged.

I'm a little worried about triggering launchpadlib errors though,
because lp is going to be updating the status at the same time - we
can collide.

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Collins wrote:
> This is probably due to lp taking too long to mark the branch as
> merged: if it takes longer than pqm takes to try again, then pqm will
> see it as still pending. Possibly we should:
> mark things we succeed at as approved
> adding a comment that it landed ok
>
> or mark it as merged.
>
> I'm a little worried about triggering launchpadlib errors though,
> because lp is going to be updating the status at the same time - we
> can collide.

I think it would be reasonable to have your script notice that "Nothing
to be Merged" obviously means that the branch is already merged...

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvY+TsACgkQJdeBCYSNAAPIMQCgqjpPMmQSCREDGp9/5OdQKQVN
V8YAn34mPZMKIzBYQqYSNCR5lVb6+31+
=hVtp
-----END PGP SIGNATURE-----

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.