[Launchpad-reviewers] [Merge] lp:~cjwatson/launchpad/codeimport-list-git into lp:launchpad

2016-10-14 Thread noreply
The proposal to merge lp:~cjwatson/launchpad/codeimport-list-git into 
lp:launchpad has been updated.

Status: Needs review => Merged

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/codeimport-list-git/+merge/308387
-- 
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.

___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


Re: [Launchpad-reviewers] [Merge] lp:~cjwatson/launchpad/codeimport-list-git into lp:launchpad

2016-10-14 Thread William Grant
Review: Approve code


-- 
https://code.launchpad.net/~cjwatson/launchpad/codeimport-list-git/+merge/308387
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.

___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


[Launchpad-reviewers] [Merge] lp:~cjwatson/launchpad/codeimport-list-git into lp:launchpad

2016-10-13 Thread Colin Watson
Colin Watson has proposed merging lp:~cjwatson/launchpad/codeimport-list-git 
into lp:launchpad with lp:~cjwatson/launchpad/codeimport-git-read-only-views as 
a prerequisite.

Commit message:
Extend CodeImportSet:+index to support different target types.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1469459 in Launchpad itself: "import external code into a LP git repo 
(natively)"
  https://bugs.launchpad.net/launchpad/+bug/1469459

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/codeimport-list-git/+merge/308387
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of 
lp:~cjwatson/launchpad/codeimport-list-git into lp:launchpad.
=== modified file 'lib/lp/code/browser/codeimport.py'
--- lib/lp/code/browser/codeimport.py	2016-10-13 14:25:08 +
+++ lib/lp/code/browser/codeimport.py	2016-10-13 14:25:09 +
@@ -123,12 +123,19 @@
 review_status_field = copy_field(
 ICodeImport['review_status'], required=False, default=None)
 self.review_status_widget = CustomWidgetFactory(DropdownWidgetWithAny)
-setUpWidget(self, 'review_status',  review_status_field, IInputWidget)
+setUpWidget(self, 'review_status', review_status_field, IInputWidget)
 
 rcs_type_field = copy_field(
 ICodeImport['rcs_type'], required=False, default=None)
 self.rcs_type_widget = CustomWidgetFactory(DropdownWidgetWithAny)
-setUpWidget(self, 'rcs_type',  rcs_type_field, IInputWidget)
+setUpWidget(self, 'rcs_type', rcs_type_field, IInputWidget)
+
+target_rcs_type_field = copy_field(
+ICodeImport['target_rcs_type'], required=False, default=None)
+self.target_rcs_type_widget = CustomWidgetFactory(
+DropdownWidgetWithAny)
+setUpWidget(
+self, 'target_rcs_type', target_rcs_type_field, IInputWidget)
 
 # status should be None if either (a) there were no query arguments
 # supplied, i.e. the user browsed directly to this page (this is when
@@ -138,13 +145,17 @@
 review_status = None
 if self.review_status_widget.hasValidInput():
 review_status = self.review_status_widget.getInputValue()
-# Similar for 'type'
+# Similar for 'rcs_type' and 'target_rcs_type'.
 rcs_type = None
 if self.rcs_type_widget.hasValidInput():
 rcs_type = self.rcs_type_widget.getInputValue()
+target_rcs_type = None
+if self.target_rcs_type_widget.hasValidInput():
+target_rcs_type = self.target_rcs_type_widget.getInputValue()
 
 imports = self.context.search(
-review_status=review_status, rcs_type=rcs_type)
+review_status=review_status, rcs_type=rcs_type,
+target_rcs_type=target_rcs_type)
 
 self.batchnav = BatchNavigator(imports, self.request)
 

=== modified file 'lib/lp/code/interfaces/codeimport.py'
--- lib/lp/code/interfaces/codeimport.py	2016-10-13 14:25:08 +
+++ lib/lp/code/interfaces/codeimport.py	2016-10-13 14:25:09 +
@@ -267,11 +267,14 @@
 def delete(id):
 """Delete a CodeImport given its id."""
 
-def search(review_status=None, rcs_type=None):
+def search(review_status=None, rcs_type=None, target_rcs_type=None):
 """Find the CodeImports of the given status and type.
 
 :param review_status: An entry from the `CodeImportReviewStatus`
 schema, or None, which signifies 'any status'.
 :param rcs_type: An entry from the `RevisionControlSystems`
 schema, or None, which signifies 'any type'.
+:param target_rcs_type: An entry from the
+`TargetRevisionControlSystems` schema, or None, which signifies
+'any type'.
 """

=== modified file 'lib/lp/code/model/codeimport.py'
--- lib/lp/code/model/codeimport.py	2016-10-13 14:25:08 +
+++ lib/lp/code/model/codeimport.py	2016-10-13 14:25:09 +
@@ -364,11 +364,15 @@
 def getByGitRepository(self, repository):
 return CodeImport.selectOneBy(git_repository=repository)
 
-def search(self, review_status=None, rcs_type=None):
+def search(self, review_status=None, rcs_type=None, target_rcs_type=None):
 """See `ICodeImportSet`."""
 clauses = []
 if review_status is not None:
 clauses.append(CodeImport.review_status == review_status)
 if rcs_type is not None:
 clauses.append(CodeImport.rcs_type == rcs_type)
+if target_rcs_type == TargetRevisionControlSystems.BZR:
+clauses.append(CodeImport.branch != None)
+elif target_rcs_type == TargetRevisionControlSystems.GIT:
+clauses.append(CodeImport.git_repository != None)
 return IStore(CodeImport).find(CodeImport, *clauses)

=== modified file 'lib/lp/code/stories/codeimport/xx-codeimport-view.txt'
--- lib/lp/code/stories/codeimport/xx-codeimport-view.txt