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
Joshua
zodb
Commits
10882363
Commit
10882363
authored
Jun 13, 2003
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate duplicate code in _handle_serials().
parent
6fe0863c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
23 deletions
+16
-23
src/ZODB/Connection.py
src/ZODB/Connection.py
+16
-23
No files found.
src/ZODB/Connection.py
View file @
10882363
...
...
@@ -13,7 +13,7 @@
##############################################################################
"""Database connection support
$Id: Connection.py,v 1.9
5 2003/06/13 16:54:43
jeremy Exp $"""
$Id: Connection.py,v 1.9
6 2003/06/13 17:00:04
jeremy Exp $"""
from
__future__
import
nested_scopes
...
...
@@ -725,31 +725,24 @@ class Connection(ExportImport.ExportImport):
if
not
store_return
:
return
if
isinstance
(
store_return
,
StringType
):
# This code is duplicated in the body of the for loop below.
assert
oid
is
not
None
serial
=
store_return
obj
=
self
.
_cache
.
get
(
oid
,
None
)
if
obj
is
None
:
return
if
serial
==
ResolvedSerial
:
del
obj
.
_p_changed
# transition from changed to ghost
else
:
if
change
:
obj
.
_p_changed
=
0
# transition from changed to uptodate
obj
.
_p_serial
=
serial
self
.
_handle_one_serial
(
oid
,
store_return
,
change
)
else
:
for
oid
,
serial
in
store_return
:
if
not
isinstance
(
serial
,
StringType
):
raise
serial
obj
=
self
.
_cache
.
get
(
oid
,
None
)
if
obj
is
None
:
continue
if
serial
==
ResolvedSerial
:
del
obj
.
_p_changed
# transition from changed to ghost
else
:
if
change
:
obj
.
_p_changed
=
0
# trans. from changed to uptodate
obj
.
_p_serial
=
serial
self
.
_handle_one_serial
(
oid
,
serial
,
change
)
def
_handle_one_serial
(
self
,
oid
,
serial
,
change
):
if
not
isinstance
(
serial
,
StringType
):
raise
serial
obj
=
self
.
_cache
.
get
(
oid
,
None
)
if
obj
is
None
:
return
if
serial
==
ResolvedSerial
:
del
obj
.
_p_changed
# transition from changed to ghost
else
:
if
change
:
obj
.
_p_changed
=
0
# trans. from changed to uptodate
obj
.
_p_serial
=
serial
def
tpc_finish
(
self
,
transaction
):
# It's important that the storage call the function we pass
...
...
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