Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tempstorage
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
tempstorage
Commits
b3db19e2
Commit
b3db19e2
authored
Sep 25, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More PEP8 cleanup
parent
1a4fbe99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
src/tempstorage/TemporaryStorage.py
src/tempstorage/TemporaryStorage.py
+9
-9
No files found.
src/tempstorage/TemporaryStorage.py
View file @
b3db19e2
...
...
@@ -43,18 +43,20 @@ LOG = getLogger('TemporaryStorage')
class
ReferenceCountError
(
POSException
.
POSError
):
""" Error while decrementing a reference to an object in the commit phase.
The object's reference count was below zero.
"""
class
TemporaryStorageError
(
POSException
.
POSError
):
""" A Temporary Storage exception occurred.
This probably indicates that there is a low memory condition or a
tempfile space shortage. Check available tempfile space and RAM
consumption and restart the server process.
"""
class
TemporaryStorage
(
BaseStorage
,
ConflictResolvingStorage
):
def
__init__
(
self
,
name
=
'TemporaryStorage'
):
...
...
@@ -92,7 +94,7 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
self
.
_tmp
=
[]
self
.
_conflict_cache
=
{}
self
.
_last_cache_gc
=
0
self
.
_recently_gc_oids
=
[
None
for
x
in
range
(
RECENTLY_GC_OIDS_LEN
)]
self
.
_recently_gc_oids
=
[
None
for
x
in
range
(
RECENTLY_GC_OIDS_LEN
)]
self
.
_oid
=
z64
self
.
_ltid
=
z64
...
...
@@ -165,7 +167,7 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
def
loadSerial
(
self
,
oid
,
serial
,
marker
=
[]):
""" This is only useful to make conflict resolution work.
It does not actually implement all the semantics that a revisioning
storage needs!
"""
...
...
@@ -218,7 +220,7 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
self
.
_lock_acquire
()
try
:
if
self
.
_index
.
has_key
(
oid
)
:
if
oid
in
self
.
_index
:
oserial
=
self
.
_index
[
oid
]
if
serial
!=
oserial
:
newdata
=
self
.
tryToResolveConflict
(
...
...
@@ -285,8 +287,7 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
# This should never happen
raise
ReferenceCountError
(
"%s (Oid %r had refcount %s)"
%
(
ReferenceCountError
.
__doc__
,
roid
,
rc
)
)
(
ReferenceCountError
.
__doc__
,
roid
,
rc
))
referenceCount
[
roid
]
=
rc
if
rc
==
0
:
zeros
[
roid
]
=
1
...
...
@@ -359,8 +360,7 @@ class TemporaryStorage(BaseStorage, ConflictResolvingStorage):
elif
rc
<
0
:
raise
ReferenceCountError
(
"%s (Oid %r had refcount %s)"
%
(
ReferenceCountError
.
__doc__
,
roid
,
rc
)
)
(
ReferenceCountError
.
__doc__
,
roid
,
rc
))
else
:
# DM 2005-01-07: decremented *before* the test! see above
#referenceCount[roid] = rc - 1
...
...
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