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

Proposed by Colin Watson
Status: Merged
Merged at revision: 18574
Proposed branch: lp:~cjwatson/launchpad/remove-branch-getRevisionsSince
Merge into: lp:launchpad
Diff against target: 59 lines (+0/-27)
3 files modified
lib/lp/code/interfaces/branch.py (+0/-3)
lib/lp/code/model/branch.py (+0/-12)
lib/lp/code/model/tests/test_branch.py (+0/-12)
To merge this branch: bzr merge lp:~cjwatson/launchpad/remove-branch-getRevisionsSince
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+340842@code.launchpad.net

Commit message

Remove unused Branch.getRevisionsSince.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 @@
712 :returns: A resultset of tuples for (BranchRevision, Revision)712 :returns: A resultset of tuples for (BranchRevision, Revision)
713 """713 """
714714
715 def getRevisionsSince(timestamp):
716 """Revisions in the history that are more recent than timestamp."""
717
718 code_is_browseable = Attribute(715 code_is_browseable = Attribute(
719 "Is the code in this branch accessable through codebrowse?")716 "Is the code in this branch accessable through codebrowse?")
720717
721718
=== 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 @@
782 RevisionAuthor, revisions, ['revision_author_id'])782 RevisionAuthor, revisions, ['revision_author_id'])
783 return DecoratedResultSet(result, pre_iter_hook=eager_load)783 return DecoratedResultSet(result, pre_iter_hook=eager_load)
784784
785 def getRevisionsSince(self, timestamp):
786 """See `IBranch`."""
787 result = Store.of(self).find(
788 (BranchRevision, Revision),
789 Revision.id == BranchRevision.revision_id,
790 BranchRevision.branch == self,
791 BranchRevision.sequence != None,
792 Revision.revision_date > timestamp)
793 result = result.order_by(Desc(BranchRevision.sequence))
794 # Return BranchRevision but prejoin Revision as well.
795 return DecoratedResultSet(result, operator.itemgetter(0))
796
797 def canBeDeleted(self):785 def canBeDeleted(self):
798 """See `IBranch`."""786 """See `IBranch`."""
799 if ((len(self.deletionRequirements()) != 0) or not787 if ((len(self.deletionRequirements()) != 0) or not
800788
=== 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 @@
2209 list(branch.revision_history[:smaller_number]),2209 list(branch.revision_history[:smaller_number]),
2210 list(branch.latest_revisions(smaller_number)))2210 list(branch.latest_revisions(smaller_number)))
22112211
2212 def test_getRevisionsSince(self):
2213 # IBranch.getRevisionsSince gives all the BranchRevisions for
2214 # revisions committed since a given timestamp.
2215 branch = self.factory.makeBranch()
2216 some_number = 7
2217 self.factory.makeRevisionsForBranch(branch, count=some_number)
2218 mid_sequence = some_number - 2
2219 revisions = list(branch.revision_history)
2220 mid_revision = revisions[mid_sequence]
2221 since = branch.getRevisionsSince(mid_revision.revision.revision_date)
2222 self.assertEqual(revisions[:mid_sequence], list(since))
2223
2224 def test_getCodebrowseUrlForRevision(self):2212 def test_getCodebrowseUrlForRevision(self):
2225 # IBranch.getCodebrowseUrlForRevision gives the URL to the browser2213 # IBranch.getCodebrowseUrlForRevision gives the URL to the browser
2226 # for a specific revision of the code2214 # for a specific revision of the code