Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BTrees
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
BTrees
Commits
25cbfca4
Commit
25cbfca4
authored
Nov 16, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moar coverage.
parent
07e15bdf
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
213 additions
and
63 deletions
+213
-63
BTrees/_base.py
BTrees/_base.py
+9
-4
BTrees/tests/test__base.py
BTrees/tests/test__base.py
+204
-59
No files found.
BTrees/_base.py
View file @
25cbfca4
...
...
@@ -375,8 +375,8 @@ class Bucket(_BucketBase):
while
i_old
.
active
and
i_com
.
active
and
i_new
.
active
:
cmpOC
=
cmp
(
i_old
.
key
,
i_com
.
key
)
cmpON
=
cmp
(
i_old
.
key
,
i_new
.
key
)
if
cmpOC
==
0
:
if
cmpON
==
0
:
if
cmpOC
==
0
:
if
cmpON
==
0
:
if
i_com
.
value
==
i_old
.
value
:
result
[
i_old
.
key
]
=
i_new
.
value
elif
i_new
.
value
==
i_old
.
value
:
...
...
@@ -413,7 +413,7 @@ class Bucket(_BucketBase):
raise
merge_error
(
3
)
else
:
# both keys changed
cmpCN
=
cmp
(
i_com
.
key
,
i_new
.
key
)
if
cmpCN
==
0
:
if
cmpCN
==
0
:
# dueling insert
raise
merge_error
(
4
)
if
cmpOC
>
0
:
# insert committed
if
cmpCN
>
0
:
# insert i_new first
...
...
@@ -468,6 +468,9 @@ class Bucket(_BucketBase):
if
len
(
result
.
_keys
)
==
0
:
# If the output bucket is empty, conflict resolution doesn't have
# enough info to unlink it from its containing BTree correctly.
#
# XXX TS, 2012-11-16: I don't think this is possible
#
raise
merge_error
(
10
)
result
.
_next
=
b_old
.
_next
...
...
@@ -656,7 +659,9 @@ class Set(_BucketBase):
if
len
(
result
.
_keys
)
==
0
:
# If the output bucket is empty, conflict resolution doesn't have
# enough info to unlink it from its containing BTree correctly.
assert
0
,
"CAN'T GET HERE"
#
# XXX TS, 2012-11-16: I don't think this is possible
#
raise
merge_error
(
10
)
result
.
_next
=
b_old
.
_next
...
...
BTrees/tests/test__base.py
View file @
25cbfca4
This diff is collapsed.
Click to expand it.
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