Merge lp:~abentley/launchpad/incremental-diffs into lp:launchpad/db-devel
| Status: | Merged |
|---|---|
| Approved by: | Leonard Richardson on 2010-09-28 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 9950 |
| Proposed branch: | lp:~abentley/launchpad/incremental-diffs |
| Merge into: | lp:launchpad/db-devel |
| Diff against target: |
462 lines (+271/-5) 8 files modified
lib/lp/code/configure.zcml (+7/-1) lib/lp/code/interfaces/diff.py (+19/-0) lib/lp/code/model/branchmergeproposal.py (+41/-1) lib/lp/code/model/diff.py (+66/-3) lib/lp/code/model/tests/test_branchmergeproposal.py (+41/-0) lib/lp/code/model/tests/test_diff.py (+84/-0) lib/lp/testing/factory.py (+12/-0) utilities/sourcedeps.conf (+1/-0) |
| To merge this branch: | bzr merge lp:~abentley/launchpad/incremental-diffs |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Leonard Richardson (community) | 2010-09-28 | Approve on 2010-09-28 | |
|
Review via email:
|
|||
Commit Message
Implement incremental diff generation.
Description of the Change
= Summary =
Implement incremental diff generation
== Proposed fix ==
See above
== Pre-implementation notes ==
Mid-implementation with thumper
== Implementation details ==
The generation of incremental diffs is handled by the Difftacular bzr plugin,
and the full testing of its behaviour is provided by its test suite.
I implemented the diff_changes test method to get a clearer idea what was added
and removed by a given diff.
== Tests ==
bin/test -t TestIncrementalDiff -t TestBranchMerge
== Demo and Q/A ==
None
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
utilities/
lib/lp/
./lib/lp/
192: E231 missing whitespace after ','
194: E231 missing whitespace after ','
./lib/lp/
166: E301 expected 1 blank line, found 0
| Leonard Richardson (leonardr) wrote : | # |
Oh, another change I suggested which Aaron carried through was removing the exported() calls from IIncrementalDiff. Those are for publishing fields through the web service, and IIncrementalDiff isn't being published yet.
| Leonard Richardson (leonardr) wrote : | # |
OK, I've done a review of the difftastic codebase and I see no reason why it can't be used in Launchpad. I do have one possible performance improvement, and a number of changes to make the tests more clear.
1. "foo" and "bar" are fine for filenames within the test branches,
but they really hurt comprehension when used as variable names
for the branches themselves. In the helper methods, can you call
the branches 'initial' and 'merged_in' or something that reflects
their history?
Outside the helper methods, you can call them whatever's
helpful. For instance, in test_mainline_diff, I believe
'foo' (aka 'initial') could be called 'mainline' and 'bar' (aka
'merged_in') could be called 'ignored'.
2. typo: "emtpy commit"
3. test_diff_
create_
like a contradiction, but we're actually checking that only
*specified* branches are ignored. A docstring would make it clear
that we're checking that the diff ignores the merge of the "bar"
branch, but not the merge of the "unignored" branch. Similarly
for ignore_
included? It's hard to figure out.
Making the commits that are being ignored really obviously
destructive would also help.
3. In generate_
merger.
within the for loop? Unless those methods modify 'merger'
in-place, I think they can be moved outside and run only once.
| Aaron Bentley (abentley) wrote : | # |
1. "foo" is actually the tree whose branch will be diffed. I don't think "initial" describes that any better than "foo". "merged_in" is fine, but I think "merge_input" is better.
2. Sure
3. Yes, I need it. The output of get_preview_tree is fed back into the subsequent merge. Without that, you would generate a bogus merge and likely violate the TreeTransform API.
| Brad Crittenden (bac) wrote : | # |
Is this approved branch ready to land or are you blocked? If you have abandoned the work please change the MP status to "Rejected."
| Aaron Bentley (abentley) wrote : | # |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 11/04/2010 11:08 PM, Brad Crittenden wrote:
> Is this approved branch ready to land or are you blocked? If you have abandoned the work please change the MP status to "Rejected."
These changes will be landed as part of the follow-on branch
incremental-
https:/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAkz
9n4AnRU1u4d8MDX
=mGMI
-----END PGP SIGNATURE-----

This branch looks good with some trivial cleanup suggested in IRC, one minor change also suggested in IRC, and one major caveat:
The minor change: test_generateIn crementalDiff is pretty confusing, with lots of branches and lots of nearly-identical commits. It needs at least a comment up-front describing what's in the two revisions being diffed, and how the precursor and prerequisite branches affect this.
It might also be easier to understand if you defined a helper method to create a new branch *and its first commit*. This would make it clear which commits are setup, reflecting the "initial" states of the branches, and which commits are the ones leading up to the endpoint of the incremental diff. But an explanatory comment is good enough to get my approval.
The caveat: this branch introduces a new source dependency, difftacular, which was written by Aaron in July. Since it was written in-house, I think difftacular needs to go through the code review process, just like the lazr packages that are used in Launchpad. Fortunately, the entire difftacular project isn't much longer than 800 lines, so it shouldn't be too difficult for me to do the review.