← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/drop-gitref-merge-redirection into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/drop-gitref-merge-redirection into lp:launchpad.

Commit message:
Drop old GitRef:+merge compatibility redirection.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/drop-gitref-merge-redirection/+merge/278309

Drop old GitRef:+merge compatibility redirection.  This was the canonical URL for a few weeks around May, but we moved it to GitRepository:+merge in https://code.launchpad.net/~cjwatson/launchpad/git-mp-move-outside-ref/+merge/260105.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/drop-gitref-merge-redirection into lp:launchpad.
=== modified file 'lib/lp/code/browser/configure.zcml'
--- lib/lp/code/browser/configure.zcml	2015-10-12 12:58:32 +0000
+++ lib/lp/code/browser/configure.zcml	2015-11-23 11:56:46 +0000
@@ -873,9 +873,6 @@
         path_expression="string:+ref/${name}"
         attribute_to_parent="repository"
         rootsite="code"/>
-    <browser:navigation
-        module="lp.code.browser.gitref"
-        classes="GitRefNavigation"/>
     <browser:pages
         for="lp.code.interfaces.gitref.IGitRef"
         class="lp.code.browser.gitref.GitRefView"

=== modified file 'lib/lp/code/browser/gitref.py'
--- lib/lp/code/browser/gitref.py	2015-09-24 09:58:26 +0000
+++ lib/lp/code/browser/gitref.py	2015-11-23 11:56:46 +0000
@@ -7,7 +7,6 @@
 
 __all__ = [
     'GitRefContextMenu',
-    'GitRefNavigation',
     'GitRefRegisterMergeProposalView',
     'GitRefView',
     ]
@@ -48,8 +47,6 @@
     ContextMenu,
     LaunchpadView,
     Link,
-    Navigation,
-    stepthrough,
     )
 from lp.services.webapp.authorization import check_permission
 from lp.snappy.browser.hassnaps import (
@@ -58,25 +55,6 @@
     )
 
 
-# XXX cjwatson 2015-05-26: We can get rid of this after a short while, since
-# it's just a compatibility redirection.
-class GitRefNavigation(Navigation):
-
-    usedfor = IGitRef
-
-    @stepthrough("+merge")
-    def traverse_merge_proposal(self, id):
-        """Traverse to an `IBranchMergeProposal`."""
-        try:
-            id = int(id)
-        except ValueError:
-            # Not a number.
-            return None
-        proposal = self.context.getMergeProposalByID(id)
-        if proposal is not None:
-            return self.redirectSubTree(canonical_url(proposal))
-
-
 class GitRefContextMenu(ContextMenu, HasSnapsMenuMixin):
     """Context menu for Git references."""
 

=== modified file 'lib/lp/code/interfaces/gitref.py'
--- lib/lp/code/interfaces/gitref.py	2015-10-12 12:58:32 +0000
+++ lib/lp/code/interfaces/gitref.py	2015-11-23 11:56:46 +0000
@@ -309,9 +309,6 @@
                                    eager_load=False):
         """Return BranchMergeProposals dependent on merging this reference."""
 
-    def getMergeProposalByID(id):
-        """Return this reference's merge proposal with this id, or None."""
-
     pending_writes = Attribute(
         "Whether there are recent changes in this repository that have not "
         "yet been scanned.")

=== modified file 'lib/lp/code/model/gitref.py'
--- lib/lp/code/model/gitref.py	2015-10-12 12:58:32 +0000
+++ lib/lp/code/model/gitref.py	2015-11-23 11:56:46 +0000
@@ -237,10 +237,6 @@
             status, prerequisite_repository=self.repository,
             prerequisite_path=self.path, eager_load=eager_load)
 
-    def getMergeProposalByID(self, id):
-        """See `IGitRef`."""
-        return self.landing_targets.find(BranchMergeProposal.id == id).one()
-
     @property
     def pending_writes(self):
         """See `IGitRef`."""


Follow ups