Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
proto3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Insights
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
protokollsystem
proto3
Commits
baeab64f
Commit
baeab64f
authored
8 years ago
by
Administrator
Browse files
Options
Downloads
Patches
Plain Diff
Reuse the old todo-id when recompiling a protocol
parent
7fe2bb97
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tasks.py
+10
-0
10 additions, 0 deletions
tasks.py
with
10 additions
and
0 deletions
tasks.py
+
10
−
0
View file @
baeab64f
...
@@ -143,11 +143,15 @@ def parse_protocol_async_inner(protocol, encoded_kwargs):
...
@@ -143,11 +143,15 @@ def parse_protocol_async_inner(protocol, encoded_kwargs):
db
.
session
.
commit
()
db
.
session
.
commit
()
return
return
# todos
# todos
old_todo_number_map
=
{}
for
todo
in
protocol
.
todos
:
old_todo_number_map
[
todo
.
description
]
=
todo
.
get_id
()
protocol
.
delete_orphan_todos
()
protocol
.
delete_orphan_todos
()
db
.
session
.
commit
()
db
.
session
.
commit
()
old_todos
=
list
(
protocol
.
todos
)
old_todos
=
list
(
protocol
.
todos
)
for
todo
in
old_todos
:
for
todo
in
old_todos
:
protocol
.
todos
.
remove
(
todo
)
protocol
.
todos
.
remove
(
todo
)
print
(
old_todo_number_map
)
db
.
session
.
commit
()
db
.
session
.
commit
()
tags
=
tree
.
get_tags
()
tags
=
tree
.
get_tags
()
todo_tags
=
[
tag
for
tag
in
tags
if
tag
.
name
==
"
todo
"
]
todo_tags
=
[
tag
for
tag
in
tags
if
tag
.
name
==
"
todo
"
]
...
@@ -225,6 +229,12 @@ def parse_protocol_async_inner(protocol, encoded_kwargs):
...
@@ -225,6 +229,12 @@ def parse_protocol_async_inner(protocol, encoded_kwargs):
db
.
session
.
add
(
error
)
db
.
session
.
add
(
error
)
db
.
session
.
commit
()
db
.
session
.
commit
()
return
return
if
todo
is
None
and
field_id
is
None
and
what
in
old_todo_number_map
:
todo
=
Todo
(
type_id
=
protocol
.
protocoltype
.
id
,
who
=
who
,
description
=
what
,
state
=
field_state
,
date
=
field_date
,
number
=
old_todo_number_map
[
what
])
db
.
session
.
add
(
todo
)
db
.
session
.
commit
()
if
todo
is
None
:
if
todo
is
None
:
protocol_key
=
protocol
.
get_identifier
()
protocol_key
=
protocol
.
get_identifier
()
old_candidates
=
OldTodo
.
query
.
filter
(
old_candidates
=
OldTodo
.
query
.
filter
(
...
...
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