← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/remove-branch-getRevisionsSince into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/remove-branch-getRevisionsSince into lp:launchpad.

Commit message:
Remove unused Branch.getRevisionsSince.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/remove-branch-getRevisionsSince/+merge/340842
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/remove-branch-getRevisionsSince into lp:launchpad.
=== modified file 'lib/lp/code/interfaces/branch.py'
--- lib/lp/code/interfaces/branch.py	2017-11-08 11:13:12 +0000
+++ lib/lp/code/interfaces/branch.py	2018-03-06 11:53:22 +0000
@@ -712,9 +712,6 @@
         :returns: A resultset of tuples for (BranchRevision, Revision)
         """
 
-    def getRevisionsSince(timestamp):
-        """Revisions in the history that are more recent than timestamp."""
-
     code_is_browseable = Attribute(
         "Is the code in this branch accessable through codebrowse?")
 

=== modified file 'lib/lp/code/model/branch.py'
--- lib/lp/code/model/branch.py	2018-01-19 17:21:44 +0000
+++ lib/lp/code/model/branch.py	2018-03-06 11:53:22 +0000
@@ -782,18 +782,6 @@
                 RevisionAuthor, revisions, ['revision_author_id'])
         return DecoratedResultSet(result, pre_iter_hook=eager_load)
 
-    def getRevisionsSince(self, timestamp):
-        """See `IBranch`."""
-        result = Store.of(self).find(
-            (BranchRevision, Revision),
-            Revision.id == BranchRevision.revision_id,
-            BranchRevision.branch == self,
-            BranchRevision.sequence != None,
-            Revision.revision_date > timestamp)
-        result = result.order_by(Desc(BranchRevision.sequence))
-        # Return BranchRevision but prejoin Revision as well.
-        return DecoratedResultSet(result, operator.itemgetter(0))
-
     def canBeDeleted(self):
         """See `IBranch`."""
         if ((len(self.deletionRequirements()) != 0) or not

=== modified file 'lib/lp/code/model/tests/test_branch.py'
--- lib/lp/code/model/tests/test_branch.py	2018-01-19 17:21:44 +0000
+++ lib/lp/code/model/tests/test_branch.py	2018-03-06 11:53:22 +0000
@@ -2209,18 +2209,6 @@
             list(branch.revision_history[:smaller_number]),
             list(branch.latest_revisions(smaller_number)))
 
-    def test_getRevisionsSince(self):
-        # IBranch.getRevisionsSince gives all the BranchRevisions for
-        # revisions committed since a given timestamp.
-        branch = self.factory.makeBranch()
-        some_number = 7
-        self.factory.makeRevisionsForBranch(branch, count=some_number)
-        mid_sequence = some_number - 2
-        revisions = list(branch.revision_history)
-        mid_revision = revisions[mid_sequence]
-        since = branch.getRevisionsSince(mid_revision.revision.revision_date)
-        self.assertEqual(revisions[:mid_sequence], list(since))
-
     def test_getCodebrowseUrlForRevision(self):
         # IBranch.getCodebrowseUrlForRevision gives the URL to the browser
         # for a specific revision of the code


Follow ups