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
faf08400
Commit
faf08400
authored
8 years ago
by
Nicolas Dandrimont
Browse files
Options
Downloads
Patches
Plain Diff
identifiers: support None messages in revisions and releases
parent
f62bc768
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
swh/model/identifiers.py
+6
-3
6 additions, 3 deletions
swh/model/identifiers.py
with
6 additions
and
3 deletions
swh/model/identifiers.py
+
6
−
3
View file @
faf08400
...
@@ -288,7 +288,8 @@ def revision_identifier(revision):
...
@@ -288,7 +288,8 @@ def revision_identifier(revision):
Multiline extra header values are escaped by indenting the continuation
Multiline extra header values are escaped by indenting the continuation
lines with one ascii space.
lines with one ascii space.
The headers are separated from the commit message with an empty line.
If the message is None, the manifest ends with the last header. Else, the
message is appended to the headers after an empty line.
The checksum of the full manifest is computed using the
'
commit
'
git object
The checksum of the full manifest is computed using the
'
commit
'
git object
type.
type.
...
@@ -330,7 +331,8 @@ def revision_identifier(revision):
...
@@ -330,7 +331,8 @@ def revision_identifier(revision):
# encode the key to utf-8
# encode the key to utf-8
components
.
extend
([
key
.
encode
(
'
utf-8
'
),
b
'
'
,
value
,
b
'
\n
'
])
components
.
extend
([
key
.
encode
(
'
utf-8
'
),
b
'
'
,
value
,
b
'
\n
'
])
components
.
extend
([
b
'
\n
'
,
revision
[
'
message
'
]])
if
revision
[
'
message
'
]
is
not
None
:
components
.
extend
([
b
'
\n
'
,
revision
[
'
message
'
]])
commit_raw
=
b
''
.
join
(
components
)
commit_raw
=
b
''
.
join
(
components
)
return
identifier_to_str
(
hash_git_data
(
commit_raw
,
'
commit
'
))
return
identifier_to_str
(
hash_git_data
(
commit_raw
,
'
commit
'
))
...
@@ -360,6 +362,7 @@ def release_identifier(release):
...
@@ -360,6 +362,7 @@ def release_identifier(release):
format_date_offset
(
release
[
'
date
'
]),
b
'
\n
'
,
format_date_offset
(
release
[
'
date
'
]),
b
'
\n
'
,
])
])
components
.
extend
([
b
'
\n
'
,
release
[
'
message
'
]])
if
release
[
'
message
'
]
is
not
None
:
components
.
extend
([
b
'
\n
'
,
release
[
'
message
'
]])
return
identifier_to_str
(
hash_git_data
(
b
''
.
join
(
components
),
'
tag
'
))
return
identifier_to_str
(
hash_git_data
(
b
''
.
join
(
components
),
'
tag
'
))
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