Merge lp:~henninge/launchpad/bug-517080-pottery-split into lp:launchpad
Proposed by
Henning Eggers
on 2010-02-15
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Henning Eggers on 2010-02-15 | ||||
| Approved revision: | not available | ||||
| Merged at revision: | not available | ||||
| Proposed branch: | lp:~henninge/launchpad/bug-517080-pottery-split | ||||
| Merge into: | lp:launchpad | ||||
| Diff against target: |
319 lines (+104/-47) 3 files modified
lib/lp/testing/__init__.py (+8/-8) lib/lp/translations/pottery/detect_intltool.py (+35/-0) lib/lp/translations/tests/test_pottery_detect_intltool.py (+61/-39) |
||||
| To merge this branch: | bzr merge lp:~henninge/launchpad/bug-517080-pottery-split | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Jeroen T. Vermeulen (community) | code | 2010-02-15 | Approve on 2010-02-15 |
|
Review via email:
|
|||
Commit Message
Provided check for possible intltool structure in a bzrlib.Tree.
To post a comment you must log in.
| Henning Eggers (henninge) wrote : | # |
| Jeroen T. Vermeulen (jtv) wrote : | # |
Thanks for making the changes discussed in IRC. The new comments in the test are much clearer, and I think you've done a Good Thing™ in moving useTempDir up from TestCaseWithFactory into lp.testing.
The code is good, with nice use of "with." Two more tiny things, both in the docstring for is_intltool_
* Say "whether" in this case, not "if." But that does make the line a bit long. Personally I prefer to phrase these descriptions as questions: "Does this source tree look like it's set up for intltool?"
* Please make it state what "tree" is supposed to be.
review:
Approve
(code)

= Bug 517080 =
Although the bug talks about "splitting up", this branch really provides an extra function that simply checks for "POTFILES.in" existing in the tree. There was no code that could be re-used because the existing code works on the filesystem while this new function works directly on a bzrlib.Tree object.
== Implementation details ==
The code is straight forward - walk the tree and report success if a "POTFILES.in" is found.
This makes use of the new "with" statement with a context manager to acquire a lock on the tree. This seems to be a perfect use case for this new language feature and eventually the context manager should become part of bzrlib.Tree.
== Tests ==
The new test case uses the same packages as the tests that ran on the filesystem but uses BzrDir to create a working tree from the directories. The files in the trees don't actually get added and committed to the tree, simply because for the function to work this is not necessary.
To share some functionality between test cases, a mix-in class was created and some methods moved into it. This bloats the diff quite a bit because the method names lose a leading underscore.
bin/test -vvt pottery
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: translations/ pottery/ detect_ intltool. py translations/ tests/test_ pottery_ detect_ intltool. py
lib/lp/
lib/lp/