Merge lp:~rockstar/launchpad/upgrade-ui into lp:launchpad

Proposed by Paul Hummer
Status: Merged
Approved by: Edwin Grubbs
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~rockstar/launchpad/upgrade-ui
Merge into: lp:launchpad
Prerequisite: lp:~rockstar/launchpad/upgrade-job-2.0-changes
Diff against target: 0 lines
To merge this branch: bzr merge lp:~rockstar/launchpad/upgrade-ui
Reviewer Review Type Date Requested Status
Edwin Grubbs (community) code Approve
Review via email: mp+17704@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Paul Hummer (rockstar) wrote :

Hello-

  This branch adds some rudimentary flows for requesting the upgrade of
branches. Basically, if the branch needs upgrading, a context menu link is
shown, and when clicked, allows you to post through to creating a
BranchUpgradeJob. The branch then has a message saying that the branch upgrade
is in progress until it's completed.

Cheers,
Paul

Revision history for this message
Paul Hummer (rockstar) wrote :
Download full text (5.9 KiB)

Hrm, the diff seems to be confused... Here's the real diff:

=== modified file 'lib/lp/code/browser/branch.py'
--- lib/lp/code/browser/branch.py 2010-01-07 05:03:46 +0000
+++ lib/lp/code/browser/branch.py 2010-01-20 00:19:44 +0000
@@ -20,6 +20,7 @@
     'BranchEditMenu',
     'BranchInProductView',
     'BranchSparkView',
+ 'BranchUpgradeView',
     'BranchURL',
     'BranchView',
     'BranchSubscriptionsView',
@@ -230,7 +231,7 @@
     links = [
         'add_subscriber', 'browse_revisions', 'link_bug',
         'link_blueprint', 'register_merge', 'source', 'subscription',
- 'edit_status']
+ 'edit_status', 'upgrade_branch']

     @enabled_with_permission('launchpad.Edit')
     def edit_status(self):
@@ -297,6 +298,14 @@
         url = self.context.codebrowse_url('files')
         return Link(url, text, icon='info', enabled=enabled)

+ @enabled_with_permission('launchpad.Edit')
+ def upgrade_branch(self):
+ enabled = False
+ if self.context.needs_upgrading:
+ enabled = True
+ return Link(
+ '+upgrade', 'Upgrade this branch', icon='edit', enabled=enabled)
+

 class DecoratedBug:
     """Provide some additional attributes to a normal bug."""
@@ -876,6 +885,27 @@
         return canonical_url(self.context)

+class BranchUpgradeView(LaunchpadFormView):
+ """Used to upgrade a branch."""
+
+ schema = IBranch
+ field_names = []
+
+ @property
+ def page_title(self):
+ return smartquote('Upgrade branch "%s"' % self.context.displayname)
+
+ @property
+ def next_url(self):
+ return canonical_url(self.context)
+
+ cancel_url = next_url
+
+ @action('Upgrade', name='upgrade_branch')
+ def upgrade_branch_action(self, action, data):
+ self.context.requestUpgrade()
+
+
 class BranchEditView(BranchEditFormView, BranchNameValidationMixin):
     """The main branch view for editing the branch attributes."""

=== modified file 'lib/lp/code/browser/configure.zcml'
--- lib/lp/code/browser/configure.zcml 2010-01-14 01:48:19 +0000
+++ lib/lp/code/browser/configure.zcml 2010-01-20 00:19:44 +0000
@@ -474,6 +474,13 @@
         permission="launchpad.Edit"
         template="../../app/templates/generic-edit.pt"/>
     <browser:page
+ name="+upgrade"
+ for="lp.code.interfaces.branch.IBranch"
+ class="lp.code.browser.branch.BranchUpgradeView"
+ facet="branches"
+ permission="launchpad.Edit"
+ template="../../app/templates/generic-edit.pt"/>
+ <browser:page
         name="+reviewer"
         for="lp.code.interfaces.branch.IBranch"
         class="lp.code.browser.branch.BranchReviewerEditView"

=== added file 'lib/lp/code/stories/branches/xx-upgrading-branches.txt'
--- lib/lp/code/stories/branches/xx-upgrading-branches.txt 1970-01-01 00:00:00 +0000
+++ lib/lp/code/stories/branches/xx-upgrading-branches.txt 2010-01-20 00:19:44 +0000
@@ -0,0 +1,49 @@
+==================
+Upgrading Branches
+==================
+
+Launchpad can upgrade branches that were in an older format to a more up to
+date format.
+
+
+Creating the branch
+===================
+
+Branches are not available to be upgraded if they are in a more...

Read more...

Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Hi Paul,

This branch looks good. Since you have other rounds of reviews to go with this, I am just going to mention the UI changes that might make sense but not require them as part of this branch.

 merge-approved

1. I think moving the "Upgrade this branch" to the action menu in the sidebar would make it easier to find, but I could see how you might want to make it even more prominent than that.
2. On the +upgrade page, it would be nice to alert the user that they may have to upgrade their installation of bzr.

-Edwin

review: Approve (code)

Preview Diff

Empty