Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-model
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Renaud Boyer
swh-model
Commits
d70b486c
Commit
d70b486c
authored
5 years ago
by
Stefano Zacchiroli
Browse files
Options
Downloads
Patches
Plain Diff
fix indentation and spelling: make "make check" happy
parent
e77c94d5
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/swh-revhash
+2
-2
2 additions, 2 deletions
bin/swh-revhash
swh/model/model.py
+2
-2
2 additions, 2 deletions
swh/model/model.py
with
4 additions
and
4 deletions
bin/swh-revhash
+
2
−
2
View file @
d70b486c
...
...
@@ -18,8 +18,8 @@ def revhash(revision_raw):
"""
Compute the revision hash.
"""
if
b
'
\\
n
'
in
revision_raw
:
# HACK: string have somehow their \n
# expanded to \\n
# HACK: string have somehow their \n
expanded to \\n
if
b
'
\\
n
'
in
revision_raw
:
revision_raw
=
revision_raw
.
replace
(
b
'
\\
n
'
,
b
'
\n
'
)
h
=
hashutil
.
hash_git_data
(
revision_raw
,
'
commit
'
)
...
...
This diff is collapsed.
Click to expand it.
swh/model/model.py
+
2
−
2
View file @
d70b486c
...
...
@@ -26,7 +26,7 @@ class BaseModel:
that are suitable for JSON/msgpack-like formats.
"""
def
to_dict
(
self
):
"""
Wrapper of `attr.asdict` that can be overriden by subclasses
"""
Wrapper of `attr.asdict` that can be overrid
d
en by subclasses
that have special handling of some of the fields.
"""
return
attr
.
asdict
(
self
)
...
...
@@ -352,7 +352,7 @@ class Content(BaseModel):
@reason.validator
def
check_reason
(
self
,
attribute
,
value
):
"""
Checks the reason is full if
f
status != absent.
"""
"""
Checks the reason is full if status != absent.
"""
assert
self
.
reason
==
value
if
self
.
status
==
'
absent
'
and
value
is
None
:
raise
ValueError
(
'
Must provide a reason if content is absent.
'
)
...
...
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