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
0c7bd06a
Commit
0c7bd06a
authored
1 year ago
by
Miguel Angel Reina Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Some small fixes when dealing with empty lines
parent
0dbbb63b
No related branches found
No related tags found
No related merge requests found
Pipeline
#476
passed
1 year ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
generateChangemarks/changemarks.py
+14
-11
14 additions, 11 deletions
generateChangemarks/changemarks.py
with
14 additions
and
11 deletions
generateChangemarks/changemarks.py
+
14
−
11
View file @
0c7bd06a
...
@@ -273,15 +273,16 @@ https://forge.etsi.org/rep/cdm/pipeline-scripts/-/blob/main/common/Dockerfile.st
...
@@ -273,15 +273,16 @@ https://forge.etsi.org/rep/cdm/pipeline-scripts/-/blob/main/common/Dockerfile.st
index_gap
=
change
.
source_start
-
change
.
target_start
index_gap
=
change
.
source_start
-
change
.
target_start
if
existing_clause
:
if
existing_clause
:
j
=
j
+
1
j
=
j
+
previous_change_lines_added
logging
.
info
(
f
"
Change.source_start
{
change
.
source_start
}
"
)
logging
.
info
(
f
"
Change.source_start
{
change
.
source_start
}
"
)
logging
.
info
(
f
"
Changed_clause.from_id
{
changed_clause
.
from_id
}
"
)
logging
.
info
(
f
"
Changed_clause.from_id
{
changed_clause
.
from_id
}
"
)
for
line
in
change
:
for
line
in
change
:
if
line
.
source_line_no
!=
None
and
line
.
source_line_no
<
changed_clause
.
from_id
:
# It should deal with the case where source line number is not within the changed clause index (too many removed lines in other clauses, i.e.)
j
=
j
# It should deal with the case where source line number is not within the changed clause index (too many removed lines in other clauses, i.e.)
#if line.source_line_no != None and line.source_line_no < changed_clause.from_id:
continue
# j = j
else
:
# continue
#else:
#if (not (line.value.strip() == '') and (line.is_added)):
#if (not (line.value.strip() == '') and (line.is_added)):
#print(vars(line))
#print(vars(line))
if
line
.
is_added
:
if
line
.
is_added
:
...
@@ -300,15 +301,15 @@ https://forge.etsi.org/rep/cdm/pipeline-scripts/-/blob/main/common/Dockerfile.st
...
@@ -300,15 +301,15 @@ https://forge.etsi.org/rep/cdm/pipeline-scripts/-/blob/main/common/Dockerfile.st
else
:
else
:
if
not
line
.
value
.
strip
()
==
''
:
if
not
line
.
value
.
strip
()
==
''
:
if
line
.
value
.
startswith
(
"
![
"
):
# It is a figure
if
line
.
value
.
startswith
(
"
![
"
):
# It is a figure
clauseMDlines
.
insert
(
j
,
line
.
value
.
strip
()
+
"
\n
"
)
clauseMDlines
.
insert
(
j
,
line
.
value
.
strip
()
+
"
\n
\n
"
)
# clauseMDlines.insert(j, "<span class=\"underline\">" + line.value.strip() + "</span>\n") #Track change OK Caption Not OK
# clauseMDlines.insert(j, "<span class=\"underline\">" + line.value.strip() + "</span>\n") #Track change OK Caption Not OK
else
:
else
:
clauseMDlines
.
insert
(
j
,
"
<span class=
\"
underline
\"
>
"
+
line
.
value
.
strip
()
+
"
</span>
\n
"
)
#it works for simple lines, not for lines in a list
clauseMDlines
.
insert
(
j
,
"
<span class=
\"
underline
\"
>
"
+
line
.
value
.
strip
()
+
"
</span>
\n
\n
"
)
#it works for simple lines, not for lines in a list
#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)
else
:
else
:
clauseMDlines
.
insert
(
j
,
"
<span class=
\"
underline
\"
>
\t
<\span>
\n
"
)
#Add tab to simulate a added line - Not working in lines in list
clauseMDlines
.
insert
(
j
,
"
\n
"
)
#Add an extra line not marked as added
#elif (not (line.value.strip() == '') and (line.is_removed)):
#elif (not (line.value.strip() == '') and (line.is_removed)):
elif
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
...
@@ -327,11 +328,13 @@ https://forge.etsi.org/rep/cdm/pipeline-scripts/-/blob/main/common/Dockerfile.st
...
@@ -327,11 +328,13 @@ https://forge.etsi.org/rep/cdm/pipeline-scripts/-/blob/main/common/Dockerfile.st
else
:
else
:
logging
.
debug
(
f
"
Index to delete is
{
j
}
"
)
logging
.
debug
(
f
"
Index to delete is
{
j
}
"
)
if
not
line
.
value
.
strip
()
==
''
:
if
not
line
.
value
.
strip
()
==
''
:
clauseMDlines
.
insert
(
j
,
"
~~
"
+
line
.
value
.
strip
()
+
"
~~
\n
"
)
clauseMDlines
.
insert
(
j
,
"
~~
"
+
line
.
value
.
strip
()
+
"
~~
\n
\n
"
)
else
:
#
else:
# clauseMDlines.insert(j, "~~\t~~\n")
# clauseMDlines.insert(j, "~~\t~~\n")
clauseMDlines
.
insert
(
j
,
"
\n
"
)
#
clauseMDlines.insert(j, "\n")
if
(
j
+
1
)
<=
len
(
clauseMDlines
):
if
(
j
+
1
)
<=
len
(
clauseMDlines
):
logging
.
debug
(
f
'
Line marked as removed:
{
clauseMDlines
[
j
]
}
'
)
logging
.
debug
(
f
'
Line being removed:
{
clauseMDlines
[
j
+
1
]
}
'
)
clauseMDlines
.
pop
(
j
+
1
)
clauseMDlines
.
pop
(
j
+
1
)
j
=
j
+
1
j
=
j
+
1
...
...
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