← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Bayard 'kit' Randel has proposed merging lp:~blr/launchpad/product-vcs-default-attrib into lp:launchpad.

Commit message:
Add ProductVCSType enum and Product.cvs_default attribute.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~blr/launchpad/product-vcs-default-attrib/+merge/258582
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~blr/launchpad/product-vcs-default-attrib into lp:launchpad.
=== 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-08 04:55:38 +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):
+    """Values that IProduct.vcs_default 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/product.py'
--- lib/lp/registry/interfaces/product.py	2015-03-17 10:45:07 +0000
+++ lib/lp/registry/interfaces/product.py	2015-05-08 04:55:38 +0000
@@ -752,6 +752,9 @@
             description=_('Security contact (obsolete; always None)')),
             ('devel', dict(exported=False)), as_of='1.0')
 
+    vcs_default = Attribute("""
+        Whether the default VCS is BZR, or GIT.""")
+
     def getAllowedBugInformationTypes():
         """Get the information types that a bug in this project can have.
 

=== 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-08 04:55:38 +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_default = 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_default=None):
         """See `IProductSet`."""
         if registrant is None:
             registrant = owner
@@ -1875,7 +1877,8 @@
             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_default=vcs_default)
 
         # 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-08 04:55:38 +0000
@@ -891,7 +891,7 @@
             'translationpermission', 'translations_usage', 'ubuntu_packages',
             'userCanAlterBugSubscription', 'userCanAlterSubscription',
             'userCanEdit', 'userHasBugSubscriptions', 'uses_launchpad',
-            'wikiurl')),
+            'vcs_default', '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-08 04:55:38 +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_default=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_default=vcs_default)
         naked_product = removeSecurityProxy(product)
         if official_malone is not None:
             naked_product.official_malone = official_malone


Follow ups