Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
5bf75c18
Commit
5bf75c18
authored
Aug 23, 2004
by
Tim Peters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made the "is this tid interesting?" logic more robust.
parent
39ceb14e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
14 deletions
+7
-14
src/ZODB/FileStorage/fsoids.py
src/ZODB/FileStorage/fsoids.py
+7
-14
No files found.
src/ZODB/FileStorage/fsoids.py
View file @
5bf75c18
...
@@ -81,6 +81,7 @@ class Tracer(object):
...
@@ -81,6 +81,7 @@ class Tracer(object):
def
_msg
(
self
,
oid
,
tid
,
*
args
):
def
_msg
(
self
,
oid
,
tid
,
*
args
):
args
=
map
(
str
,
args
)
args
=
map
(
str
,
args
)
self
.
msgs
.
append
(
(
oid
,
tid
,
' '
.
join
(
args
))
)
self
.
msgs
.
append
(
(
oid
,
tid
,
' '
.
join
(
args
))
)
self
.
_produced_msg
=
True
def
report
(
self
):
def
report
(
self
):
"""Show all msgs, grouped by oid and sub-grouped by tid."""
"""Show all msgs, grouped by oid and sub-grouped by tid."""
...
@@ -130,20 +131,18 @@ class Tracer(object):
...
@@ -130,20 +131,18 @@ class Tracer(object):
def
_check_trec
(
self
,
txn
):
def
_check_trec
(
self
,
txn
):
# txn has members tid, status, user, description,
# txn has members tid, status, user, description,
# _extension, _pos, _tend, _file, _tpos
# _extension, _pos, _tend, _file, _tpos
interestin
g
=
False
self
.
_produced_ms
g
=
False
for
drec
in
txn
:
for
drec
in
txn
:
if
self
.
_check_drec
(
drec
):
self
.
_check_drec
(
drec
)
interesting
=
True
if
self
.
_produced_msg
:
if
interesting
:
# Copy txn info for later output.
self
.
tid2info
[
txn
.
tid
]
=
(
txn
.
status
,
txn
.
user
,
txn
.
description
,
self
.
tid2info
[
txn
.
tid
]
=
(
txn
.
status
,
txn
.
user
,
txn
.
description
,
txn
.
_tpos
)
txn
.
_tpos
)
# Process next data record. Return true iff a message is produced (so
# Process next data record. If a message is produced, self._produced_msg
# the caller can know whether to save information about the tid the
# will be set True.
# data record belongs to).
def
_check_drec
(
self
,
drec
):
def
_check_drec
(
self
,
drec
):
# drec has members oid, tid, version, data, data_txn
# drec has members oid, tid, version, data, data_txn
result
=
False
tid
,
oid
,
pick
,
pos
=
drec
.
tid
,
drec
.
oid
,
drec
.
data
,
drec
.
pos
tid
,
oid
,
pick
,
pos
=
drec
.
tid
,
drec
.
oid
,
drec
.
data
,
drec
.
pos
if
pick
:
if
pick
:
oidclass
=
None
oidclass
=
None
...
@@ -151,7 +150,6 @@ class Tracer(object):
...
@@ -151,7 +150,6 @@ class Tracer(object):
oidclass
=
get_class
(
pick
)
oidclass
=
get_class
(
pick
)
self
.
_msg
(
oid
,
tid
,
"new revision"
,
oidclass
,
self
.
_msg
(
oid
,
tid
,
"new revision"
,
oidclass
,
"at"
,
drec
.
pos
)
"at"
,
drec
.
pos
)
result
=
True
self
.
oids
[
oid
]
+=
1
self
.
oids
[
oid
]
+=
1
self
.
oid2name
[
oid
]
=
oidclass
self
.
oid2name
[
oid
]
=
oidclass
...
@@ -166,16 +164,11 @@ class Tracer(object):
...
@@ -166,16 +164,11 @@ class Tracer(object):
oidclass
=
get_class
(
pick
)
oidclass
=
get_class
(
pick
)
self
.
_msg
(
ref
,
tid
,
"referenced by"
,
oid_repr
(
oid
),
self
.
_msg
(
ref
,
tid
,
"referenced by"
,
oid_repr
(
oid
),
oidclass
,
"at"
,
pos
)
oidclass
,
"at"
,
pos
)
result
=
True
if
oid
in
self
.
oids
:
if
oid
in
self
.
oids
:
self
.
_msg
(
oid
,
tid
,
"references"
,
oid_repr
(
ref
),
klass
,
self
.
_msg
(
oid
,
tid
,
"references"
,
oid_repr
(
ref
),
klass
,
"at"
,
pos
)
"at"
,
pos
)
result
=
True
elif
oid
in
self
.
oids
:
elif
oid
in
self
.
oids
:
# Or maybe it's a version abort.
# Or maybe it's a version abort.
self
.
_msg
(
oid
,
tid
,
"creation undo at"
,
pos
)
self
.
_msg
(
oid
,
tid
,
"creation undo at"
,
pos
)
result
=
True
return
result
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment