← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~blr/launchpad/ui-project-setbranch into lp:launchpad

 

Bayard 'kit' Randel has proposed merging lp:~blr/launchpad/ui-project-setbranch into lp:launchpad.

Commit message:
Add Product.ProductSetBranchView and UI support for setting product.vcs.

Requested reviews:
  William Grant (wgrant): code

For more details, see:
https://code.launchpad.net/~blr/launchpad/ui-project-setbranch/+merge/262942

Provides a new SetBranch view for projects, additionally allowing a default version control system to be defined.

A project's vcs will also be displayed on the product index under Project Information. If not default vcs has been provided, the vcs type is inferred from existing bzr or git branches, with git taking precedence.

Fixes bug in setTargetDefault where an exception was thrown when attempting to set the same targetdefault again.

Testfixed.
-- 
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
=== modified file 'lib/lp/blueprints/browser/tests/test_specification.py'
--- lib/lp/blueprints/browser/tests/test_specification.py	2015-05-08 08:55:40 +0000
+++ lib/lp/blueprints/browser/tests/test_specification.py	2015-06-25 07:41:58 +0000
@@ -246,7 +246,7 @@
         product = self.factory.makeProduct()
         removeSecurityProxy(product).official_blueprints = True
         self.factory.makeSpecification(product=product)
-        limit = BrowsesWithQueryLimit(38, product.owner, rootsite='blueprints')
+        limit = BrowsesWithQueryLimit(42, product.owner, rootsite='blueprints')
         self.assertThat(product, limit)
         login_celebrity('admin')
         [self.factory.makeSpecification(product=product) for i in range(4)]

=== modified file 'lib/lp/bugs/browser/tests/test_bugtask.py'
--- lib/lp/bugs/browser/tests/test_bugtask.py	2015-01-29 16:28:30 +0000
+++ lib/lp/bugs/browser/tests/test_bugtask.py	2015-06-25 07:41:58 +0000
@@ -2065,10 +2065,10 @@
         self.invalidate_caches(bug)
         # count with single task
         self.getUserBrowser(url)
-        self.assertThat(recorder, HasQueryCount(LessThan(35)))
+        self.assertThat(recorder, HasQueryCount(LessThan(36)))
         # count with many tasks
         self.getUserBrowser(buggy_url)
-        self.assertThat(recorder, HasQueryCount(LessThan(35)))
+        self.assertThat(recorder, HasQueryCount(LessThan(36)))
 
     def test_mustache_model_in_json(self):
         """The IJSONRequestCache should contain mustache_model.

=== modified file 'lib/lp/code/browser/tests/test_branchmergeproposallisting.py'
--- lib/lp/code/browser/tests/test_branchmergeproposallisting.py	2015-05-14 13:57:51 +0000
+++ lib/lp/code/browser/tests/test_branchmergeproposallisting.py	2015-06-25 07:41:58 +0000
@@ -265,7 +265,7 @@
         with StormStatementRecorder() as recorder:
             self.getViewBrowser(
                 product, '+merges', rootsite='code', user=product.owner)
-        self.assertThat(recorder, HasQueryCount(Equals(41)))
+        self.assertThat(recorder, HasQueryCount(Equals(42)))
 
     def test_query_count_git(self):
         product = self.factory.makeProduct()
@@ -280,7 +280,7 @@
         with StormStatementRecorder() as recorder:
             self.getViewBrowser(
                 product, '+merges', rootsite='code', user=product.owner)
-        self.assertThat(recorder, HasQueryCount(Equals(38)))
+        self.assertThat(recorder, HasQueryCount(Equals(40)))
 
     def test_productseries_bzr(self):
         target = self.factory.makeBranch()

=== modified file 'lib/lp/code/browser/tests/test_gitlisting.py'
--- lib/lp/code/browser/tests/test_gitlisting.py	2015-06-12 12:18:30 +0000
+++ lib/lp/code/browser/tests/test_gitlisting.py	2015-06-25 07:41:58 +0000
@@ -109,7 +109,7 @@
                 repository=other_repo, user=other_repo.owner)
 
         self.assertThat(
-            self.target, BrowsesWithQueryLimit(32, self.owner, '+git'))
+            self.target, BrowsesWithQueryLimit(34, self.owner, '+git'))
 
     def test_copes_with_no_default(self):
         self.factory.makeGitRepository(

=== modified file 'lib/lp/code/javascript/productseries-setbranch.js'
--- lib/lp/code/javascript/productseries-setbranch.js	2015-06-19 01:10:52 +0000
+++ lib/lp/code/javascript/productseries-setbranch.js	2015-06-25 07:41:58 +0000
@@ -122,10 +122,13 @@
             'click', module.onclick_default_vcs);
 
         // Set the initial state.
-        module.setup_expanders();
         module.onclick_rcs_type();
         module.onclick_branch_type();
-        module.onclick_default_vcs();
+        // Only setup handlers for +configure-code
+        if (document.getElementById('default_vcs')) {
+            module.setup_expanders();
+            module.onclick_default_vcs();
+        }
     };
 
 }, "0.1", {"requires": ["node", "DOM"]});

=== modified file 'lib/lp/registry/browser/tests/pillar-views.txt'
--- lib/lp/registry/browser/tests/pillar-views.txt	2015-06-15 06:47:11 +0000
+++ lib/lp/registry/browser/tests/pillar-views.txt	2015-06-25 07:41:58 +0000
@@ -87,7 +87,7 @@
 
     >>> for link in view.configuration_links:
     ...     print link['link'].name
-    set_branch
+    configure_code
     configure_bugtracker
     configure_translations
     configure_answers
@@ -141,7 +141,7 @@
 
     >>> print find_tag_by_id(rendered, 'configuration_links')
     <table...
-    <a href="http://launchpad.dev/bread/trunk/+setbranch";...
+    <a href="http://launchpad.dev/bread/+configure-code";...
     <span class="sprite no action-icon">...
     <a href="http://launchpad.dev/bread/+configure-bugtracker";...
     <span class="sprite no action-icon">...    

=== modified file 'lib/lp/registry/stories/webservice/xx-project-registry.txt'
--- lib/lp/registry/stories/webservice/xx-project-registry.txt	2015-05-13 06:28:34 +0000
+++ lib/lp/registry/stories/webservice/xx-project-registry.txt	2015-06-25 07:41:58 +0000
@@ -168,6 +168,7 @@
     freshmeat_project: None
     homepage_url: None
     icon_link: u'http://.../firefox/icon'
+    inferred_vcs: u'Bazaar'
     information_type: u'Public'
     is_permitted: True
     license_approved: False

=== modified file 'lib/lp/registry/tests/test_product.py'
--- lib/lp/registry/tests/test_product.py	2015-06-19 01:10:52 +0000
+++ lib/lp/registry/tests/test_product.py	2015-06-25 07:41:58 +0000
@@ -877,7 +877,7 @@
             'getVersionSortedSeries',
             'has_current_commercial_subscription',
             'has_custom_language_codes', 'has_milestones', 'homepage_content',
-            'homepageurl', 'invitesTranslationEdits',
+            'homepageurl', 'inferred_vcs', 'invitesTranslationEdits',
             'invitesTranslationSuggestions',
             'license_info', 'license_status', 'licenses', 'milestones',
             'mugshot', 'newCodeImport',


Follow ups