← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] lp:~blr/launchpad/product-vcs-default-attrib into lp:launchpad

 

Review: Needs Fixing code



Diff comments:

> === modified file 'lib/lp/registry/enums.py'
> --- lib/lp/registry/enums.py	2015-05-07 11:20:50 +0000
> +++ lib/lp/registry/enums.py	2015-05-11 01:59:49 +0000
> @@ -14,6 +14,7 @@
>      'PersonTransferJobType',
>      'PersonVisibility',
>      'ProductJobType',
> +    'ProductVCSType',
>      'SharingPermission',
>      'SpecificationSharingPolicy',
>      'TeamMembershipPolicy',
> @@ -383,3 +384,19 @@
>          A notification stating that the project's commercial subscription
>          expired.
>          """)
> +
> +
> +class ProductVCSType(DBEnumeratedType):

It's no longer product-specific.

> +    """Values that IProduct.vcs can take."""
> +
> +    BZR = DBItem(0, """
> +        Bazaar
> +
> +        The Bazaar DVCS is used as the default project VCS.
> +        """)
> +
> +    GIT = DBItem(1, """
> +        Git
> +
> +        The Git DVCS is used as the default project VCS.
> +        """)
> 
> === modified file 'lib/lp/registry/interfaces/distribution.py'
> --- lib/lp/registry/interfaces/distribution.py	2015-03-17 10:45:07 +0000
> +++ lib/lp/registry/interfaces/distribution.py	2015-05-11 01:59:49 +0000
> @@ -375,6 +375,9 @@
>              "distribution."),
>          constraint=name_validator, readonly=False, required=False))
>  
> +    vcs = Attribute("""
> +        Whether the default VCS is BZR, or GIT.""")
> +
>      def getArchiveIDList(archive=None):
>          """Return a list of archive IDs suitable for sqlvalues() or quote().
>  
> 
> === modified file 'lib/lp/registry/interfaces/product.py'
> --- lib/lp/registry/interfaces/product.py	2015-03-17 10:45:07 +0000
> +++ lib/lp/registry/interfaces/product.py	2015-05-11 01:59:49 +0000
> @@ -752,6 +752,9 @@
>              description=_('Security contact (obsolete; always None)')),
>              ('devel', dict(exported=False)), as_of='1.0')
>  
> +    vcs = Attribute("""
> +        Whether the default VCS is BZR, or GIT.""")

"Version control system for this project's code."? These also want to be exported as writable on the API.

> +
>      def getAllowedBugInformationTypes():
>          """Get the information types that a bug in this project can have.
>  
> 
> === modified file 'lib/lp/registry/model/distribution.py'
> --- lib/lp/registry/model/distribution.py	2015-03-17 10:45:07 +0000
> +++ lib/lp/registry/model/distribution.py	2015-05-11 01:59:49 +0000
> @@ -86,6 +86,7 @@
>  from lp.registry.enums import (
>      BranchSharingPolicy,
>      BugSharingPolicy,
> +    ProductVCSType,
>      SpecificationSharingPolicy,
>      )
>  from lp.registry.errors import NoSuchDistroSeries
> @@ -247,6 +248,7 @@
>      package_derivatives_email = StringCol(notNull=False, default=None)
>      redirect_release_uploads = BoolCol(notNull=True, default=False)
>      development_series_alias = StringCol(notNull=False, default=None)
> +    vcs = EnumCol(enum=ProductVCSType, notNull=False)
>  
>      def __repr__(self):
>          displayname = self.displayname.encode('ASCII', 'backslashreplace')
> @@ -1445,7 +1447,8 @@
>          return pillar
>  
>      def new(self, name, displayname, title, description, summary, domainname,
> -            members, owner, registrant, mugshot=None, logo=None, icon=None):
> +            members, owner, registrant, mugshot=None, logo=None, icon=None,
> +            vcs=None):
>          """See `IDistributionSet`."""
>          distro = Distribution(
>              name=name,
> @@ -1460,7 +1463,8 @@
>              registrant=registrant,
>              mugshot=mugshot,
>              logo=logo,
> -            icon=icon)
> +            icon=icon,
> +            vcs=vcs)
>          getUtility(IArchiveSet).new(distribution=distro,
>              owner=owner, purpose=ArchivePurpose.PRIMARY)
>          policies = itertools.product(
> 
> === modified file 'lib/lp/registry/model/product.py'
> --- lib/lp/registry/model/product.py	2015-05-07 16:49:41 +0000
> +++ lib/lp/registry/model/product.py	2015-05-11 01:59:49 +0000
> @@ -131,6 +131,7 @@
>      BugSharingPolicy,
>      INCLUSIVE_TEAM_POLICY,
>      SpecificationSharingPolicy,
> +    ProductVCSType,
>      )
>  from lp.registry.errors import (
>      CannotChangeInformationType,
> @@ -434,6 +435,7 @@
>          dbName='official_malone', notNull=True, default=False)
>      remote_product = Unicode(
>          name='remote_product', allow_none=True, default=None)
> +    vcs = EnumCol(enum=ProductVCSType, notNull=False)
>  
>      @property
>      def date_next_suggest_packaging(self):
> @@ -1847,7 +1849,7 @@
>                        project_reviewed=False, mugshot=None, logo=None,
>                        icon=None, licenses=None, license_info=None,
>                        registrant=None, bug_supervisor=None, driver=None,
> -                      information_type=None):
> +                      information_type=None, vcs=None):
>          """See `IProductSet`."""
>          if registrant is None:
>              registrant = owner
> @@ -1875,7 +1877,7 @@
>              project_reviewed=project_reviewed,
>              icon=icon, logo=logo, mugshot=mugshot, license_info=license_info,
>              bug_supervisor=bug_supervisor, driver=driver,
> -            information_type=information_type)
> +            information_type=information_type, vcs=vcs)
>  
>          # Set up the product licence.
>          if len(licenses) > 0:
> 
> === modified file 'lib/lp/registry/tests/test_product.py'
> --- lib/lp/registry/tests/test_product.py	2015-03-04 19:05:47 +0000
> +++ lib/lp/registry/tests/test_product.py	2015-05-11 01:59:49 +0000
> @@ -891,7 +891,7 @@
>              'translationpermission', 'translations_usage', 'ubuntu_packages',
>              'userCanAlterBugSubscription', 'userCanAlterSubscription',
>              'userCanEdit', 'userHasBugSubscriptions', 'uses_launchpad',
> -            'wikiurl')),
> +            'vcs', 'wikiurl')),
>          'launchpad.AnyAllowedPerson': set((
>              'addAnswerContact', 'addBugSubscription',
>              'addBugSubscriptionFilter', 'addSubscription',
> 
> === modified file 'lib/lp/testing/factory.py'
> --- lib/lp/testing/factory.py	2015-04-28 16:39:15 +0000
> +++ lib/lp/testing/factory.py	2015-05-11 01:59:49 +0000
> @@ -929,7 +929,7 @@
>          translations_usage=None, bug_supervisor=None, driver=None, icon=None,
>          bug_sharing_policy=None, branch_sharing_policy=None,
>          specification_sharing_policy=None, information_type=None,
> -        answers_usage=None):
> +        answers_usage=None, vcs=None):
>          """Create and return a new, arbitrary Product."""
>          if owner is None:
>              owner = self.makePerson()
> @@ -970,7 +970,8 @@
>                  projectgroup=projectgroup,
>                  registrant=registrant,
>                  icon=icon,
> -                information_type=information_type)
> +                information_type=information_type,
> +                vcs=vcs)
>          naked_product = removeSecurityProxy(product)
>          if official_malone is not None:
>              naked_product.official_malone = official_malone
> @@ -2527,7 +2528,7 @@
>                           aliases=None, bug_supervisor=None, driver=None,
>                           publish_root_dir=None, publish_base_url=None,
>                           publish_copy_base_url=None, no_pubconf=False,
> -                         icon=None, summary=None):
> +                         icon=None, summary=None, vcs=None):
>          """Make a new distribution."""
>          if name is None:
>              name = self.getUniqueString(prefix="distribution")
> @@ -2547,7 +2548,7 @@
>              members = self.makeTeam(owner)
>          distro = getUtility(IDistributionSet).new(
>              name, displayname, title, description, summary, domainname,
> -            members, owner, registrant, icon=icon)
> +            members, owner, registrant, icon=icon, vcs=vcs)
>          naked_distro = removeSecurityProxy(distro)
>          if aliases is not None:
>              naked_distro.setAliases(aliases)
> 


-- 
https://code.launchpad.net/~blr/launchpad/product-vcs-default-attrib/+merge/258730
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.


References