~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/code/xmlrpc/codehosting.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-08-15 13:18:37 UTC
  • mfrom: (13662.5.6 push-creates-package)
  • Revision ID: launchpad@pqm.canonical.com-20110815131837-cp2nb9wc52fswn67
[r=adeuring][bug=386596] Push creates source package names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
    LAUNCHPAD_SERVICES,
65
65
    )
66
66
from lp.code.interfaces.linkedbranch import ICanHasLinkedBranch
 
67
from lp.registry.errors import (
 
68
    InvalidName,
 
69
    NoSuchSourcePackageName,
 
70
    )
67
71
from lp.registry.interfaces.person import (
68
72
    IPersonSet,
69
73
    NoSuchPerson,
72
76
    InvalidProductName,
73
77
    NoSuchProduct,
74
78
    )
 
79
from lp.registry.interfaces.sourcepackagename import ISourcePackageNameSet
75
80
from lp.services.scripts.interfaces.scriptactivity import IScriptActivitySet
76
81
from lp.services.utils import iter_split
77
82
 
220
225
            except NoSuchProduct, e:
221
226
                return faults.NotFound(
222
227
                    "Project '%s' does not exist." % e.name)
 
228
            except NoSuchSourcePackageName as e:
 
229
                try:
 
230
                    getUtility(ISourcePackageNameSet).new(e.name)
 
231
                except InvalidName:
 
232
                    return faults.InvalidSourcePackageName(e.name)
 
233
                return self.createBranch(login_id, branch_path)
223
234
            except NameLookupFailed, e:
224
235
                return faults.NotFound(str(e))
225
236
            try: