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
1=== modified file 'lib/lp/code/interfaces/branch.py'
2--- lib/lp/code/interfaces/branch.py 2017-11-08 11:13:12 +0000
3+++ lib/lp/code/interfaces/branch.py 2018-03-06 11:53:22 +0000
4@@ -712,9 +712,6 @@
5 :returns: A resultset of tuples for (BranchRevision, Revision)
6 """
7
8- def getRevisionsSince(timestamp):
9- """Revisions in the history that are more recent than timestamp."""
10-
11 code_is_browseable = Attribute(
12 "Is the code in this branch accessable through codebrowse?")
13
14
15=== modified file 'lib/lp/code/model/branch.py'
16--- lib/lp/code/model/branch.py 2018-01-19 17:21:44 +0000
17+++ lib/lp/code/model/branch.py 2018-03-06 11:53:22 +0000
18@@ -782,18 +782,6 @@
19 RevisionAuthor, revisions, ['revision_author_id'])
20 return DecoratedResultSet(result, pre_iter_hook=eager_load)
21
22- def getRevisionsSince(self, timestamp):
23- """See `IBranch`."""
24- result = Store.of(self).find(
25- (BranchRevision, Revision),
26- Revision.id == BranchRevision.revision_id,
27- BranchRevision.branch == self,
28- BranchRevision.sequence != None,
29- Revision.revision_date > timestamp)
30- result = result.order_by(Desc(BranchRevision.sequence))
31- # Return BranchRevision but prejoin Revision as well.
32- return DecoratedResultSet(result, operator.itemgetter(0))
33-
34 def canBeDeleted(self):
35 """See `IBranch`."""
36 if ((len(self.deletionRequirements()) != 0) or not
37
38=== modified file 'lib/lp/code/model/tests/test_branch.py'
39--- lib/lp/code/model/tests/test_branch.py 2018-01-19 17:21:44 +0000
40+++ lib/lp/code/model/tests/test_branch.py 2018-03-06 11:53:22 +0000
41@@ -2209,18 +2209,6 @@
42 list(branch.revision_history[:smaller_number]),
43 list(branch.latest_revisions(smaller_number)))
44
45- def test_getRevisionsSince(self):
46- # IBranch.getRevisionsSince gives all the BranchRevisions for
47- # revisions committed since a given timestamp.
48- branch = self.factory.makeBranch()
49- some_number = 7
50- self.factory.makeRevisionsForBranch(branch, count=some_number)
51- mid_sequence = some_number - 2
52- revisions = list(branch.revision_history)
53- mid_revision = revisions[mid_sequence]
54- since = branch.getRevisionsSince(mid_revision.revision.revision_date)
55- self.assertEqual(revisions[:mid_sequence], list(since))
56-
57 def test_getCodebrowseUrlForRevision(self):
58 # IBranch.getCodebrowseUrlForRevision gives the URL to the browser
59 # for a specific revision of the code