Merge lp:~lifeless/python-oops-datedir-repo/timeline into lp:python-oops-datedir-repo

Proposed by Robert Collins
Status: Merged
Merged at revision: 26
Proposed branch: lp:~lifeless/python-oops-datedir-repo/timeline
Merge into: lp:python-oops-datedir-repo
Diff against target: 91 lines (+30/-3)
5 files modified
NEWS (+8/-0)
oops_datedir_repo/__init__.py (+1/-1)
oops_datedir_repo/serializer_rfc822.py (+2/-1)
oops_datedir_repo/tests/test_serializer_rfc822.py (+18/-0)
setup.py (+1/-1)
To merge this branch: bzr merge lp:~lifeless/python-oops-datedir-repo/timeline
Reviewer Review Type Date Requested Status
Steve Kowalik (community) code Approve
Review via email: mp+82344@code.launchpad.net

Description of the change

Prepare for backtraces in timelines. The serializer for rfc822 oopses would fail, because its very manual. Rather than write a parser as well, I've just dropped the extra data.

To post a comment you must log in.
Revision history for this message
Steve Kowalik (stevenk) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2011-11-15 21:47:32 +0000
+++ NEWS 2011-11-16 03:48:32 +0000
@@ -6,6 +6,9 @@
6NEXT6NEXT
7----7----
88
90.0.12
10------
11
9* Repository has a simple generic config API. See the set_config and get_config12* Repository has a simple generic config API. See the set_config and get_config
10 methods. (Robert Collins)13 methods. (Robert Collins)
1114
@@ -17,6 +20,11 @@
17 references to keep is supplied. See the prune_unreferenced method.20 references to keep is supplied. See the prune_unreferenced method.
18 (Robert Collins)21 (Robert Collins)
1922
23* The RFC822 serializer can now handle 5-tuple timelines (which include
24 backtraces on actions) - the backtraces are skipped for backwards
25 compatibility; use a BSON serializer to have the backtraces captured into the
26 serialized report. (Robert Collins)
27
20* There is a new script bin/prune which will prune reports from a repository28* There is a new script bin/prune which will prune reports from a repository
21 keeping only those referenced in a given Launchpad project or project group.29 keeping only those referenced in a given Launchpad project or project group.
22 This adds a dependency on launchpadlib, which should be pypi installable30 This adds a dependency on launchpadlib, which should be pypi installable
2331
=== modified file 'oops_datedir_repo/__init__.py'
--- oops_datedir_repo/__init__.py 2011-11-13 21:03:43 +0000
+++ oops_datedir_repo/__init__.py 2011-11-16 03:48:32 +0000
@@ -25,7 +25,7 @@
25# established at this point, and setup.py will use a version of next-$(revno).25# established at this point, and setup.py will use a version of next-$(revno).
26# If the releaselevel is 'final', then the tarball will be major.minor.micro.26# If the releaselevel is 'final', then the tarball will be major.minor.micro.
27# Otherwise it is major.minor.micro~$(revno).27# Otherwise it is major.minor.micro~$(revno).
28__version__ = (0, 0, 11, 'beta', 0)28__version__ = (0, 0, 12, 'beta', 0)
2929
30__all__ = [30__all__ = [
31 'DateDirRepo',31 'DateDirRepo',
3232
=== modified file 'oops_datedir_repo/serializer_rfc822.py'
--- oops_datedir_repo/serializer_rfc822.py 2011-11-11 04:48:09 +0000
+++ oops_datedir_repo/serializer_rfc822.py 2011-11-16 03:48:32 +0000
@@ -206,7 +206,8 @@
206 urllib.quote(_safestr(value), safe_chars)))206 urllib.quote(_safestr(value), safe_chars)))
207 chunks.append('\n')207 chunks.append('\n')
208 if 'timeline' in report:208 if 'timeline' in report:
209 for (start, end, category, statement) in report['timeline']:209 for row in report['timeline']:
210 (start, end, category, statement) = row[:4]
210 chunks.append('%05d-%05d@%s %s\n' % (211 chunks.append('%05d-%05d@%s %s\n' % (
211 start, end, _safestr(category),212 start, end, _safestr(category),
212 _safestr(_normalise_whitespace(statement))))213 _safestr(_normalise_whitespace(statement))))
213214
=== modified file 'oops_datedir_repo/tests/test_serializer_rfc822.py'
--- oops_datedir_repo/tests/test_serializer_rfc822.py 2011-11-11 04:48:09 +0000
+++ oops_datedir_repo/tests/test_serializer_rfc822.py 2011-11-16 03:48:32 +0000
@@ -384,3 +384,21 @@
384 "name%3Dfoo=hello%0Aworld\n",384 "name%3Dfoo=hello%0Aworld\n",
385 "\n",385 "\n",
386 ], to_chunks(report))386 ], to_chunks(report))
387
388 def test_to_chunks_enhanced_timeline(self):
389 # New timeline will have 5-tuples with a backtrace. The rfc822 format
390 # doesn't have anywhere to put this, so its ignored, but the rest is
391 # saved.
392 report = {
393 'id': 'OOPS-1234',
394 'timeline': [
395 (0, 1, 'foo', 'bar', 'quux'),
396 ]
397 }
398 self.assertEqual([
399 "Oops-Id: OOPS-1234\n",
400 "\n",
401 "00000-00001@foo bar\n",
402 "\n",
403 ], to_chunks(report))
404
387405
=== modified file 'setup.py'
--- setup.py 2011-11-15 21:47:32 +0000
+++ setup.py 2011-11-16 03:48:32 +0000
@@ -22,7 +22,7 @@
22description = file(os.path.join(os.path.dirname(__file__), 'README'), 'rb').read()22description = file(os.path.join(os.path.dirname(__file__), 'README'), 'rb').read()
2323
24setup(name="oops_datedir_repo",24setup(name="oops_datedir_repo",
25 version="0.0.11",25 version="0.0.12",
26 description="OOPS disk serialisation and repository management.",26 description="OOPS disk serialisation and repository management.",
27 long_description=description,27 long_description=description,
28 maintainer="Launchpad Developers",28 maintainer="Launchpad Developers",

Subscribers

People subscribed via source and target branches

to all changes: