Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-pylib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-pylib
Commits
43e0b33f
Commit
43e0b33f
authored
1 year ago
by
Joscha Schmiedt
Browse files
Options
Downloads
Patches
Plain Diff
Allow None for Version.is_head and Version.is_complete_history
parent
e23a9087
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!143
Release 0.15.0
,
!135
Add and fix more type hints
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/linkahead/common/versioning.py
+4
-13
4 additions, 13 deletions
src/linkahead/common/versioning.py
with
4 additions
and
13 deletions
src/linkahead/common/versioning.py
+
4
−
13
View file @
43e0b33f
...
...
@@ -103,8 +103,8 @@ class Version():
def
__init__
(
self
,
id
:
Optional
[
str
]
=
None
,
date
:
Optional
[
str
]
=
None
,
username
:
Optional
[
str
]
=
None
,
realm
:
Optional
[
str
]
=
None
,
predecessors
:
Optional
[
List
[
Version
]]
=
None
,
successors
:
Optional
[
List
[
Version
]]
=
None
,
is_head
:
Union
[
bool
,
str
]
=
False
,
is_complete_history
:
Union
[
bool
,
str
]
=
False
):
is_head
:
Union
[
bool
,
str
,
None
]
=
False
,
is_complete_history
:
Union
[
bool
,
str
,
None
]
=
False
):
"""
Typically the `predecessors` or `successors` should not
"
link back
"
to an existing Version
object.
"""
self
.
id
=
id
...
...
@@ -210,18 +210,9 @@ object."""
p
)
for
p
in
xml
if
p
.
tag
.
lower
()
==
"
predecessor
"
]
successors
=
[
Version
.
from_xml
(
s
)
for
s
in
xml
if
s
.
tag
.
lower
()
==
"
successor
"
]
is_head
=
xml
.
get
(
"
head
"
)
if
is_head
is
None
:
raise
ValueError
(
f
"
Version head is missing from xml:
{
str
(
xml
)
}
"
)
is_complete_history
=
xml
.
get
(
"
completeHistory
"
)
if
is_complete_history
is
None
:
raise
ValueError
(
f
"
Version completeHistory is missing from xml:
{
str
(
xml
)
}
"
)
return
Version
(
id
=
xml
.
get
(
"
id
"
),
date
=
xml
.
get
(
"
date
"
),
is_head
=
is_
head
,
is_complete_history
=
is_
complete
_h
istory
,
is_head
=
xml
.
get
(
"
head
"
)
,
is_complete_history
=
xml
.
get
(
"
complete
H
istory
"
)
,
username
=
xml
.
get
(
"
username
"
),
realm
=
xml
.
get
(
"
realm
"
),
predecessors
=
predecessors
,
successors
=
successors
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment