Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
steering
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
Container registry
Model registry
Operate
Environments
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
AURA
steering
Commits
ae4297b6
Verified
Commit
ae4297b6
authored
11 months ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
fix: simplify comparisons of start & end of timeslots
parent
03020542
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
program/services.py
+6
-6
6 additions, 6 deletions
program/services.py
with
6 additions
and
6 deletions
program/services.py
+
6
−
6
View file @
ae4297b6
...
...
@@ -668,7 +668,7 @@ def generate_conflicts(timeslots: list[TimeSlot]) -> Conflicts:
solution_choices
.
add
(
"
theirs
"
)
solution_choices
.
add
(
"
ours
"
)
# Partly overlapping:
projected starts earlier than existing and ends earlier
# Partly overlapping:
timeslot start before existing start, end before existing end
#
# ex. pr.
# +--+
...
...
@@ -678,11 +678,11 @@ def generate_conflicts(timeslots: list[TimeSlot]) -> Conflicts:
# | |
# +--+
#
if
timeslot
.
end
>
existing
.
start
>
timeslot
.
start
<
=
existing
.
end
:
if
timeslot
.
start
<
existing
.
start
and
timeslot
.
end
<
existing
.
end
:
solution_choices
.
add
(
"
theirs-end
"
)
solution_choices
.
add
(
"
ours-end
"
)
# Partly overlapping:
projected starts later than existing and ends later
# Partly overlapping:
timeslot start after existing start, end after existing ends
#
# ex. pr.
# +--+
...
...
@@ -692,11 +692,11 @@ def generate_conflicts(timeslots: list[TimeSlot]) -> Conflicts:
# | |
# +--+
#
if
existing
.
start
<=
timeslot
.
start
<
existing
.
e
nd
<
timeslot
.
end
:
if
timeslot
.
start
>
existing
.
start
a
nd
timeslot
.
end
>
existing
.
end
:
solution_choices
.
add
(
"
theirs-start
"
)
solution_choices
.
add
(
"
ours-start
"
)
# Fully overlapping
/Superset: projected starts earlier and ends later than
existing
# Fully overlapping
: timeslot start before existing start, end after
existing
end
#
# ex. pr.
# +--+
...
...
@@ -710,7 +710,7 @@ def generate_conflicts(timeslots: list[TimeSlot]) -> Conflicts:
solution_choices
.
add
(
"
theirs-start
"
)
solution_choices
.
add
(
"
theirs-both
"
)
# Fully overlapping
/Subset: projected starts later and ends earlier than
existing
# Fully overlapping
: timeslot start after existing start, end before
existing
end
#
# ex. pr.
# +--+
...
...
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