← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/codeimport-git-worker-require-target into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/codeimport-git-worker-require-target into lp:launchpad.

Commit message:
Require both source and target RCS types in the code import worker, since the scheduler now always passes them.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/codeimport-git-worker-require-target/+merge/364078

I made the scheduler change in https://code.launchpad.net/~cjwatson/launchpad/codeimport-git-worker-always-pass-target/+merge/310710, but apparently never got round to the final bit of cleanup until now.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/codeimport-git-worker-require-target into lp:launchpad.
=== modified file 'lib/lp/codehosting/codeimport/worker.py'
--- lib/lp/codehosting/codeimport/worker.py	2019-02-06 00:48:01 +0000
+++ lib/lp/codehosting/codeimport/worker.py	2019-03-07 10:54:04 +0000
@@ -321,12 +321,11 @@
         arguments = list(arguments)
         target_id = arguments.pop(0)
         rcstype = arguments.pop(0)
-        # XXX cjwatson 2016-10-12: Remove compatibility code once the
-        # scheduler always passes both source and target types.
-        if ':' in rcstype:
-            rcstype, target_rcstype = rcstype.split(':', 1)
-        else:
-            target_rcstype = 'bzr'
+        if ':' not in rcstype:
+            raise AssertionError(
+                "'%s' does not contain both source and target types." %
+                rcstype)
+        rcstype, target_rcstype = rcstype.split(':', 1)
         if rcstype in ['bzr-svn', 'git', 'bzr']:
             url = arguments.pop(0)
             if target_rcstype == 'bzr':


Follow ups