Merge lp:~wgrant/python-oops-datedir-repo/bug-1050722 into lp:python-oops-datedir-repo

Proposed by William Grant
Status: Merged
Approved by: William Grant
Approved revision: 40
Merged at revision: 39
Proposed branch: lp:~wgrant/python-oops-datedir-repo/bug-1050722
Merge into: lp:python-oops-datedir-repo
Diff against target: 29 lines (+7/-1)
2 files modified
NEWS (+5/-0)
oops_datedir_repo/prune.py (+2/-1)
To merge this branch: bzr merge lp:~wgrant/python-oops-datedir-repo/bug-1050722
Reviewer Review Type Date Requested Status
Richard Harding (community) Approve
Review via email: mp+124851@code.launchpad.net

Commit message

When pruning, look for OOPS references up to now rather than up to prune_until. Otherwise we miss any references created in the last week, probably only finding references within 24 hours of the OOPS occurring.

Description of the change

oops_datedir_repo.prune and oopstools.scripts.prune have faulty reference finding logic. They only search for references up to the pruning threshold (usually a week ago), so OOPSes tend to only get kept if they're referenced within about 24 hours. The fix is trivial: just continue looking up until the current timestamp.

To post a comment you must log in.
Revision history for this message
Richard Harding (rharding) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2012-09-03 21:18:30 +0000
3+++ NEWS 2012-09-18 07:47:22 +0000
4@@ -6,6 +6,11 @@
5 NEXT
6 ----
7
8+* When pruning, look for OOPS references up to now rather than up to
9+ prune_until. Otherwise we miss any references created in the last
10+ week, probably only finding references within 24 hours of the OOPS
11+ occurring. (William Grant, #1050722)
12+
13 0.0.18
14 ------
15
16
17=== modified file 'oops_datedir_repo/prune.py'
18--- oops_datedir_repo/prune.py 2011-11-21 00:28:20 +0000
19+++ oops_datedir_repo/prune.py 2012-09-18 07:47:22 +0000
20@@ -149,7 +149,8 @@
21 # The tracker finds all the references for the selected dates.
22 finder = tracker(options)
23 references = finder.find_oops_references(
24- prune_from, prune_until, options.project, options.projectgroup)
25+ prune_from, datetime.datetime.now(utc), options.project,
26+ options.projectgroup)
27 # Then we can delete the unreferenced oopses.
28 repo.prune_unreferenced(prune_from, prune_until, references)
29 # And finally save the fact we have scanned up to the selected date.

Subscribers

People subscribed via source and target branches

to all changes: