Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Scripts
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
Specification Tools
Scripts
Commits
a92f0681
Commit
a92f0681
authored
1 year ago
by
Miguel Angel Reina Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Fix to include added/removed lines as change
parent
10470d17
No related branches found
No related tags found
No related merge requests found
Pipeline
#202
passed
1 year ago
Stage: build
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
generateChangemarks/changemarks.py
+11
-5
11 additions, 5 deletions
generateChangemarks/changemarks.py
with
11 additions
and
5 deletions
generateChangemarks/changemarks.py
+
11
−
5
View file @
a92f0681
...
@@ -157,6 +157,8 @@ https://forge.etsi.org/rep/cdm/pipeline-scripts/-/blob/main/common/Dockerfile.st
...
@@ -157,6 +157,8 @@ https://forge.etsi.org/rep/cdm/pipeline-scripts/-/blob/main/common/Dockerfile.st
lines_removed
=
0
lines_removed
=
0
for
change
in
patched_file
:
for
change
in
patched_file
:
change_start_line
,
change_end_line
,
change_lines_added
,
change_lines_removed
=
changeDetails
(
change
)
change_start_line
,
change_end_line
,
change_lines_added
,
change_lines_removed
=
changeDetails
(
change
)
logging
.
debug
(
f
"
Change starting at line
{
change_start_line
}
and ending at line
{
change_end_line
}
"
)
logging
.
debug
(
f
"
Change containing
{
change_lines_added
}
added lines and
{
change_lines_removed
}
lines removed
"
)
lines_added
=
lines_added
+
change_lines_added
lines_added
=
lines_added
+
change_lines_added
lines_removed
=
lines_removed
+
change_lines_removed
lines_removed
=
lines_removed
+
change_lines_removed
# Check the previous changed_clause
# Check the previous changed_clause
...
@@ -172,9 +174,11 @@ https://forge.etsi.org/rep/cdm/pipeline-scripts/-/blob/main/common/Dockerfile.st
...
@@ -172,9 +174,11 @@ https://forge.etsi.org/rep/cdm/pipeline-scripts/-/blob/main/common/Dockerfile.st
generateMDforChange
(
progress
,
mdLines
,
changed_clause
,
change
,
outDirectory
,
False
)
generateMDforChange
(
progress
,
mdLines
,
changed_clause
,
change
,
outDirectory
,
False
)
break
break
i
=
i
+
1
i
=
i
+
1
logging
.
info
(
f
"
Total number of lines added is
{
lines_added
}
"
)
logging
.
info
(
f
"
Total number of lines removed is
{
lines_removed
}
"
)
for
clause
in
changed_clauses
:
for
clause
in
changed_clauses
:
logging
.
debug
(
f
"
Clause
{
clause
.
clause_nr
}
contains modifications
"
)
logging
.
info
(
f
"
Clause
{
clause
.
clause_nr
}
contains modifications
"
)
return
changed_clauses
return
changed_clauses
...
@@ -185,7 +189,7 @@ def changeDetails(change) -> (int, int, int, int):
...
@@ -185,7 +189,7 @@ def changeDetails(change) -> (int, int, int, int):
change_start_line
=
change
.
target_start
change_start_line
=
change
.
target_start
change_end_line
=
change_start_line
change_end_line
=
change_start_line
for
line
in
change
:
for
line
in
change
:
print
(
vars
(
line
))
#
print(vars(line))
if
line
.
is_added
or
line
.
is_removed
:
if
line
.
is_added
or
line
.
is_removed
:
#if change_start_line == change.target_start:
#if change_start_line == change.target_start:
# change_start_line = change.target_start + i
# change_start_line = change.target_start + i
...
@@ -233,7 +237,8 @@ https://forge.etsi.org/rep/cdm/pipeline-scripts/-/blob/main/common/Dockerfile.st
...
@@ -233,7 +237,8 @@ https://forge.etsi.org/rep/cdm/pipeline-scripts/-/blob/main/common/Dockerfile.st
j
=
change
.
target_start
-
changed_clause
.
from_id
# index gap
j
=
change
.
target_start
-
changed_clause
.
from_id
# index gap
for
line
in
change
:
for
line
in
change
:
if
(
not
(
line
.
value
.
strip
()
==
''
)
and
(
line
.
is_added
)):
#if (not (line.value.strip() == '') and (line.is_added)):
if
line
.
is_added
:
if
line
.
value
.
strip
().
startswith
(
"
|
"
):
# It is a table
if
line
.
value
.
strip
().
startswith
(
"
|
"
):
# It is a table
tableElements
=
line
.
value
.
strip
().
split
(
"
|
"
)
tableElements
=
line
.
value
.
strip
().
split
(
"
|
"
)
modifiedElements
:
list
[
str
]
=
[]
modifiedElements
:
list
[
str
]
=
[]
...
@@ -251,7 +256,8 @@ https://forge.etsi.org/rep/cdm/pipeline-scripts/-/blob/main/common/Dockerfile.st
...
@@ -251,7 +256,8 @@ https://forge.etsi.org/rep/cdm/pipeline-scripts/-/blob/main/common/Dockerfile.st
#clauseMDlines.insert(j, "<mark>" + line.value.strip("\n") + "</mark>\n\n")
#clauseMDlines.insert(j, "<mark>" + line.value.strip("\n") + "</mark>\n\n")
if
(
j
+
1
)
<=
len
(
clauseMDlines
):
if
(
j
+
1
)
<=
len
(
clauseMDlines
):
clauseMDlines
.
pop
(
j
+
1
)
clauseMDlines
.
pop
(
j
+
1
)
elif
(
not
(
line
.
value
.
strip
()
==
''
)
and
(
line
.
is_removed
)):
#elif (not (line.value.strip() == '') and (line.is_removed)):
elif
line
.
is_removed
:
if
line
.
value
.
strip
().
startswith
(
"
|
"
):
# It is a table
if
line
.
value
.
strip
().
startswith
(
"
|
"
):
# It is a table
tableElements
=
line
.
value
.
strip
().
split
(
"
|
"
)
tableElements
=
line
.
value
.
strip
().
split
(
"
|
"
)
modifiedElements
:
list
[
str
]
=
[]
modifiedElements
:
list
[
str
]
=
[]
...
...
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