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
895dca6e
Commit
895dca6e
authored
Mar 17, 2003
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix use of RecordIterator() in fsrecover and add trivial test case.
parent
b59b2b9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
10 deletions
+27
-10
src/ZODB/fsrecover.py
src/ZODB/fsrecover.py
+5
-10
src/ZODB/tests/testFileStorage.py
src/ZODB/tests/testFileStorage.py
+22
-0
No files found.
src/ZODB/fsrecover.py
View file @
895dca6e
...
...
@@ -24,7 +24,7 @@ of critical data were lost.
Options:
-f
Force output to
p
utput file even if it exists
Force output to
o
utput file even if it exists
-v level
...
...
@@ -50,8 +50,8 @@ Options:
option is used, then t should be 0.
Important note: The ZODB package must be imporable. You may need
to adjust
the Python path
accordingly.
Important note: The ZODB package must be impora
t
ble. You may need
to adjust
PYTHONPATH
accordingly.
"""
...
...
@@ -139,13 +139,8 @@ def read_transaction_header(file, pos, file_size):
except
:
e
=
{}
else
:
e
=
{}
result
=
RecordIterator
(
tid
,
status
,
user
,
description
,
e
,
pos
,
(
tend
,
file
,
seek
,
read
,
tpos
,
)
)
result
=
RecordIterator
(
tid
,
status
,
user
,
description
,
e
,
pos
,
tend
,
file
,
tpos
)
pos
=
tend
# Read the (intentionally redundant) transaction length
...
...
src/ZODB/tests/testFileStorage.py
View file @
895dca6e
...
...
@@ -16,8 +16,11 @@ from __future__ import nested_scopes
import
ZODB.FileStorage
import
sys
,
os
,
unittest
import
errno
import
filecmp
import
StringIO
from
ZODB.Transaction
import
Transaction
from
ZODB
import
POSException
from
ZODB.fsrecover
import
recover
from
ZODB.tests
import
StorageTestBase
,
BasicStorage
,
\
TransactionalUndoStorage
,
VersionStorage
,
\
...
...
@@ -167,6 +170,25 @@ class FileStorageTests(
self
.
failUnless
(
self
.
_storage
.
_records_before_save
>
20
)
def
checkfsrecover
(
self
):
# an absolutely minimal test of fsrecover
# Verify that calling recover on a small, correct storage
# produces a duplicate of the original.
for
i
in
range
(
5
):
oid
=
self
.
_storage
.
new_oid
()
revid
=
None
for
j
in
range
(
5
):
revid
=
self
.
_dostore
(
oid
,
revid
=
revid
)
temp
=
sys
.
stdout
sys
.
stdout
=
StringIO
.
StringIO
()
try
:
recover
([
""
,
"FileStorageTests.fs"
,
"fsrecover.fs"
])
finally
:
sys
.
stdout
=
temp
self
.
assert_
(
filecmp
.
cmp
(
"FileStorageTests.fs"
,
"fsrecover.fs"
))
StorageTestBase
.
removefs
(
"fsrecover.fs"
)
def
checkPackVersionsInPast
(
self
):
# FileStorage can't cope with backpointers to objects
# created in versions. Must fix.
...
...
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