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
nexedi
ZODB
Commits
b1447993
Commit
b1447993
authored
Jul 05, 2016
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only tpc_vote can report resolved conflicts with the new commit protocol
parent
c95d47c1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
16 deletions
+4
-16
src/ZODB/ConflictResolution.py
src/ZODB/ConflictResolution.py
+1
-1
src/ZODB/Connection.py
src/ZODB/Connection.py
+2
-5
src/ZODB/tests/testDemoStorage.py
src/ZODB/tests/testDemoStorage.py
+1
-10
No files found.
src/ZODB/ConflictResolution.py
View file @
b1447993
...
@@ -28,7 +28,7 @@ from pickle import PicklingError
...
@@ -28,7 +28,7 @@ from pickle import PicklingError
logger
=
logging
.
getLogger
(
'ZODB.ConflictResolution'
)
logger
=
logging
.
getLogger
(
'ZODB.ConflictResolution'
)
ResolvedSerial
=
b'rs'
# deprecated: s
tore/tpc_finish should just use Tru
e
ResolvedSerial
=
b'rs'
# deprecated: s
ee IMultiCommitStorage.tpc_vot
e
class
BadClassName
(
Exception
):
class
BadClassName
(
Exception
):
pass
pass
...
...
src/ZODB/Connection.py
View file @
b1447993
...
@@ -706,7 +706,7 @@ class Connection(ExportImport, object):
...
@@ -706,7 +706,7 @@ class Connection(ExportImport, object):
self
.
_handle_serial
(
oid
,
s
)
self
.
_handle_serial
(
oid
,
s
)
def
_handle_serial
(
self
,
oid
,
serial
=
True
,
change
=
True
):
def
_handle_serial
(
self
,
oid
,
serial
=
ResolvedSerial
,
change
=
True
):
# if we write an object, we don't want to check if it was read
# if we write an object, we don't want to check if it was read
# while current. This is a convenient choke point to do this.
# while current. This is a convenient choke point to do this.
...
@@ -714,10 +714,7 @@ class Connection(ExportImport, object):
...
@@ -714,10 +714,7 @@ class Connection(ExportImport, object):
if
not
serial
:
if
not
serial
:
return
return
if
serial
is
True
:
assert
isinstance
(
serial
,
bytes
),
serial
serial
=
ResolvedSerial
elif
not
isinstance
(
serial
,
bytes
):
raise
serial
obj
=
self
.
_cache
.
get
(
oid
,
None
)
obj
=
self
.
_cache
.
get
(
oid
,
None
)
if
obj
is
None
:
if
obj
is
None
:
return
return
...
...
src/ZODB/tests/testDemoStorage.py
View file @
b1447993
...
@@ -46,8 +46,6 @@ from ZODB.ConflictResolution import ResolvedSerial
...
@@ -46,8 +46,6 @@ from ZODB.ConflictResolution import ResolvedSerial
class
DemoStorage
(
ZODB
.
DemoStorage
.
DemoStorage
):
class
DemoStorage
(
ZODB
.
DemoStorage
.
DemoStorage
):
delayed_store
=
False
def
tpc_begin
(
self
,
*
args
):
def
tpc_begin
(
self
,
*
args
):
super
(
DemoStorage
,
self
).
tpc_begin
(
*
args
)
super
(
DemoStorage
,
self
).
tpc_begin
(
*
args
)
self
.
__stored
=
[]
self
.
__stored
=
[]
...
@@ -57,8 +55,6 @@ class DemoStorage(ZODB.DemoStorage.DemoStorage):
...
@@ -57,8 +55,6 @@ class DemoStorage(ZODB.DemoStorage.DemoStorage):
if
s
!=
ResolvedSerial
:
if
s
!=
ResolvedSerial
:
assert
type
(
s
)
is
bytes
,
s
assert
type
(
s
)
is
bytes
,
s
return
return
if
not
self
.
delayed_store
:
return
True
self
.
__stored
.
append
(
oid
)
self
.
__stored
.
append
(
oid
)
tpc_vote
=
property
(
lambda
self
:
self
.
_tpc_vote
,
lambda
*
_
:
None
)
tpc_vote
=
property
(
lambda
self
:
self
.
_tpc_vote
,
lambda
*
_
:
None
)
...
@@ -66,7 +62,7 @@ class DemoStorage(ZODB.DemoStorage.DemoStorage):
...
@@ -66,7 +62,7 @@ class DemoStorage(ZODB.DemoStorage.DemoStorage):
def
_tpc_vote
(
self
,
transaction
):
def
_tpc_vote
(
self
,
transaction
):
s
=
self
.
changes
.
tpc_vote
(
transaction
)
s
=
self
.
changes
.
tpc_vote
(
transaction
)
assert
s
is
None
,
s
assert
s
is
None
,
s
return
self
.
__stored
if
self
.
delayed_store
else
s
return
self
.
__stored
def
tpc_finish
(
self
,
transaction
,
func
=
lambda
tid
:
None
):
def
tpc_finish
(
self
,
transaction
,
func
=
lambda
tid
:
None
):
r
=
[]
r
=
[]
...
@@ -143,11 +139,6 @@ class DemoStorageTests(
...
@@ -143,11 +139,6 @@ class DemoStorageTests(
self
.
_checkHistory
(
base_and_changes
())
self
.
_checkHistory
(
base_and_changes
())
self
.
_storage
=
self
.
_storage
.
pop
()
self
.
_storage
=
self
.
_storage
.
pop
()
def
checkResolveLate
(
self
):
self
.
_storage
.
delayed_store
=
True
self
.
checkResolve
()
class
DemoStorageHexTests
(
DemoStorageTests
):
class
DemoStorageHexTests
(
DemoStorageTests
):
def
setUp
(
self
):
def
setUp
(
self
):
...
...
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