Merge lp:~james-w/launchpad/code-imports-for-source-packages into lp:launchpad/db-devel
Proposed by
James Westby
Status: | Merged |
---|---|
Approved by: | Michael Hudson-Doyle |
Approved revision: | no longer in the source branch. |
Merged at revision: | not available |
Proposed branch: | lp:~james-w/launchpad/code-imports-for-source-packages |
Merge into: | lp:launchpad/db-devel |
Prerequisite: | lp:~james-w/launchpad/new-code-import-method-on-branchtarget |
Diff against target: |
269 lines (+145/-12) 7 files modified
lib/lp/code/mail/tests/test_codeimport.py (+28/-0) lib/lp/code/model/branchtarget.py (+1/-1) lib/lp/code/model/tests/test_branchtarget.py (+15/-8) lib/lp/code/model/tests/test_codeimport.py (+21/-0) lib/lp/code/stories/codeimport/xx-admin-codeimport.txt (+22/-1) lib/lp/code/stories/webservice/xx-code-import.txt (+51/-2) lib/lp/testing/factory.py (+7/-0) |
To merge this branch: | bzr merge lp:~james-w/launchpad/code-imports-for-source-packages |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Hudson-Doyle | Approve | ||
Review via email: mp+22191@code.launchpad.net |
Commit message
Package branches are now a vaild target for code imports
Description of the change
Hi,
This flips the switch so that code imports can be registered
for package branches, though there's no way to actually create
them yet.
It's mainly adding the tests, as it's a single line change to
allow them to be created for source packages now.
Thanks,
James
To post a comment you must log in.
Two minor whitespace tweaks please, or rather the same one in two
places. Other than that, awesome!
> === modified file 'lib/lp/ code/interfaces /branchtarget. py' code/interfaces /branchtarget. py 2010-01-05 08:18:23 +0000 code/interfaces /branchtarget. py 2010-03-26 01:45:34 +0000 merge_proposals = Attribute( code_imports = Attribute( eable(other_ target) : registrant, branch_name, rcs_type,
> --- lib/lp/
> +++ lib/lp/
> @@ -88,6 +88,9 @@
> supports_
> "Does this target support merge proposals at all?")
>
> + supports_
> + "Does this target support code imports at all?")
> +
> def areBranchesMerg
> """Are branches from other_target mergeable into this target."""
>
> @@ -113,3 +116,18 @@
>
> def getBugTask(bug):
> """Get the BugTask for a given bug related to the branch target."""
> +
> + def newCodeImport(
> + url=None, cvs_root=None, cvs_module=None):
This should be formatted like so:
def newCodeImport( registrant, branch_name, rcs_type, url=None,
cvs_root= None, cvs_module=None):
(https:/ /dev.launchpad. net/PythonStyle Guide#Wrapping% 20long% 20arguments% 20in%20function %20definitions)
> + """Create a new code import for this target. code_imports is False.
> +
> + :param registrant: the `IPerson` who should be recorded as creating
> + the import and will own the resulting branch.
> + :param branch_name: the name the resulting branch should have.
> + :param rcs_type: the type of the foreign VCS.
> + :param url: the url to import from if the import isn't CVS.
> + :param cvs_root: if the import is from CVS the CVSROOT to import from.
> + :param cvs_module: if the import is from CVS the module to import.
> + :returns: an `ICodeImport`.
> + :raises AssertionError: if supports_
> + """
> === modified file 'lib/lp/ code/model/ branchtarget. py' code/model/ branchtarget. py 2010-01-05 08:18:23 +0000 code/model/ branchtarget. py 2010-03-26 01:45:34 +0000 interfaces. branchcollectio n import IAllBranches interfaces. branchtarget import ( stacked_ on, IBranchTarget) interfaces. codeimport import ICodeImportSet interfaces. pocket import PackagePublishi ngPocket launchpad. webapp. interfaces import ICanonicalUrlData
> --- lib/lp/
> +++ lib/lp/
> @@ -19,6 +19,7 @@
> from lp.code.
> from lp.code.
> check_default_
> +from lp.code.
> from lp.registry.
> from canonical.
>
> @@ -36,6 +37,12 @@
> def __ne__(self, other):
> return self.context != other.context
>
> + def newCodeImport(self, registrant, branch_name, rcs_type, url=None,
> + cvs_root=None, cvs_module=None):
Similarly.
> + return getUtility( ICodeImportSet) .new( cvs_module) rget(_BaseBranc hTarget) : IBranchTarget) code_imports( self): eable(self, other_target)...
> + registrant, self, branch_name, rcs_type, url=url,
> + cvs_root=cvs_root, cvs_module=
> +
>
> class PackageBranchTa
> implements(
> @@ -95,6 +102,11 @@
> """See `IBranchTarget`."""
> return True
>
> + @property
> + def supports_
> + """See `IBranchTarget`."""
> + return False
> +
> def areBranchesMerg