Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
f11e855b
Commit
f11e855b
authored
Feb 27, 2013
by
Sato Hiroyuki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finding free space from the way near commit which is downward
parent
aa36f07a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
app/models/graph/json_builder.rb
app/models/graph/json_builder.rb
+6
-6
No files found.
app/models/graph/json_builder.rb
View file @
f11e855b
...
...
@@ -136,9 +136,9 @@ module Graph
end
space
=
if
commit
.
space
>=
parent
.
space
then
find_free_parent_space
(
range
,
parent
.
space
,
1
,
commit
.
space
,
times
)
find_free_parent_space
(
range
,
parent
.
space
,
-
1
,
commit
.
space
,
times
)
else
find_free_parent_space
(
range
,
paren
t
.
space
,
-
1
,
parent
.
space
,
times
)
find_free_parent_space
(
range
,
commi
t
.
space
,
-
1
,
parent
.
space
,
times
)
end
mark_reserved
(
range
,
space
)
...
...
@@ -151,7 +151,7 @@ module Graph
def
find_free_parent_space
(
range
,
space_base
,
space_step
,
space_default
,
times
)
if
is_overlap?
(
range
,
times
,
space_default
)
then
find_free_space
(
range
,
space_base
,
space_step
)
find_free_space
(
range
,
space_base
,
space_step
,
space_default
)
else
space_default
end
...
...
@@ -221,17 +221,17 @@ module Graph
end
end
def
find_free_space
(
time_range
,
space_base
,
space_step
)
def
find_free_space
(
time_range
,
space_base
,
space_step
,
space_default
=
1
)
reserved
=
[]
for
day
in
time_range
reserved
+=
@_reserved
[
day
]
end
reserved
.
uniq!
space
=
space_
base
space
=
space_
default
while
reserved
.
include?
(
space
)
do
space
+=
space_step
if
space
<
=
0
then
if
space
<
space_base
then
space_step
*=
-
1
space
=
space_base
+
space_step
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment