Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZEO
Commits
8c9c3282
Commit
8c9c3282
authored
May 02, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensured that export/index files created by repozo share the same timestamp.
https://bugs.launchpad.net/zodb/+bug/993350
parent
3e213438
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
src/CHANGES.txt
src/CHANGES.txt
+5
-0
src/ZODB/scripts/repozo.py
src/ZODB/scripts/repozo.py
+13
-7
No files found.
src/CHANGES.txt
View file @
8c9c3282
...
...
@@ -32,6 +32,11 @@ New Features
Bugs Fixed
----------
- Ensured that the export file and index file created by ``repozo`` share
the same timestamp.
https://bugs.launchpad.net/zodb/+bug/993350
- Pinned the ``transaction`` and ``manuel`` dependencies to Python 2.5-
compatible versions when installing under Python 2.5.
...
...
src/ZODB/scripts/repozo.py
View file @
8c9c3282
...
...
@@ -305,7 +305,10 @@ def concat(files, ofp=None):
return
bytesread
,
sum
.
hexdigest
()
def
gen_filename
(
options
,
ext
=
None
):
def
gen_filedate
(
options
):
return
getattr
(
options
,
'test_now'
,
time
.
gmtime
()[:
6
])
def
gen_filename
(
options
,
ext
=
None
,
now
=
None
):
if
ext
is
None
:
if
options
.
full
:
ext
=
'.fs'
...
...
@@ -314,7 +317,8 @@ def gen_filename(options, ext=None):
if
options
.
gzip
:
ext
+=
'z'
# Hook for testing
now
=
getattr
(
options
,
'test_now'
,
time
.
gmtime
()[:
6
])
if
now
is
None
:
now
=
gen_filedate
(
options
)
t
=
now
+
(
ext
,)
return
'%04d-%02d-%02d-%02d-%02d-%02d%s'
%
t
...
...
@@ -330,7 +334,7 @@ del re
def
find_files
(
options
):
when
=
options
.
date
if
not
when
:
when
=
gen_filename
(
options
,
''
)
when
=
gen_filename
(
options
,
ext
=
''
)
log
(
'looking for files between last full backup and %s...'
,
when
)
all
=
filter
(
is_data_file
,
os
.
listdir
(
options
.
repository
))
all
.
sort
()
...
...
@@ -429,7 +433,8 @@ def delete_old_backups(options):
def
do_full_backup
(
options
):
options
.
full
=
True
dest
=
os
.
path
.
join
(
options
.
repository
,
gen_filename
(
options
))
tnow
=
gen_filedate
(
options
)
dest
=
os
.
path
.
join
(
options
.
repository
,
gen_filename
(
options
,
now
=
tnow
))
if
os
.
path
.
exists
(
dest
):
raise
WouldOverwriteFiles
(
'Cannot overwrite existing file: %s'
%
dest
)
# Find the file position of the last completed transaction.
...
...
@@ -442,7 +447,7 @@ def do_full_backup(options):
pos
=
fs
.
getSize
()
# Save the storage index into the repository
index_file
=
os
.
path
.
join
(
options
.
repository
,
gen_filename
(
options
,
'.index'
))
gen_filename
(
options
,
'.index'
,
tnow
))
log
(
'writing index'
)
fs
.
_index
.
save
(
pos
,
index_file
)
fs
.
close
()
...
...
@@ -461,7 +466,8 @@ def do_full_backup(options):
def
do_incremental_backup
(
options
,
reposz
,
repofiles
):
options
.
full
=
False
dest
=
os
.
path
.
join
(
options
.
repository
,
gen_filename
(
options
))
tnow
=
gen_filedate
(
options
)
dest
=
os
.
path
.
join
(
options
.
repository
,
gen_filename
(
options
,
now
=
tnow
))
if
os
.
path
.
exists
(
dest
):
raise
WouldOverwriteFiles
(
'Cannot overwrite existing file: %s'
%
dest
)
# Find the file position of the last completed transaction.
...
...
@@ -474,7 +480,7 @@ def do_incremental_backup(options, reposz, repofiles):
pos
=
fs
.
getSize
()
log
(
'writing index'
)
index_file
=
os
.
path
.
join
(
options
.
repository
,
gen_filename
(
options
,
'.index'
))
gen_filename
(
options
,
'.index'
,
tnow
))
fs
.
_index
.
save
(
pos
,
index_file
)
fs
.
close
()
log
(
'writing incremental: %s bytes to %s'
,
pos
-
reposz
,
dest
)
...
...
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