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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
d361aa71
Commit
d361aa71
authored
May 07, 2018
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Force creation of new import_state when setting an import state field
parent
cedc0974
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
app/models/project.rb
app/models/project.rb
+18
-18
No files found.
app/models/project.rb
View file @
d361aa71
...
@@ -659,8 +659,8 @@ class Project < ActiveRecord::Base
...
@@ -659,8 +659,8 @@ class Project < ActiveRecord::Base
}
}
end
end
def
ensure_import_state
def
ensure_import_state
(
force:
false
)
return
if
self
[
:import_status
]
==
'none'
||
self
[
:import_status
].
nil?
return
if
!
force
&&
(
self
[
:import_status
]
==
'none'
||
self
[
:import_status
].
nil?
)
return
unless
import_state
.
nil?
return
unless
import_state
.
nil?
create_import_state
(
import_state_args
)
create_import_state
(
import_state_args
)
...
@@ -669,39 +669,39 @@ class Project < ActiveRecord::Base
...
@@ -669,39 +669,39 @@ class Project < ActiveRecord::Base
end
end
def
import_schedule
def
import_schedule
ensure_import_state
ensure_import_state
(
force:
true
)
import_state
&
.
schedule
import_state
.
schedule
end
end
def
force_import_start
def
force_import_start
ensure_import_state
ensure_import_state
(
force:
true
)
import_state
&
.
force_start
import_state
.
force_start
end
end
def
import_start
def
import_start
ensure_import_state
ensure_import_state
(
force:
true
)
import_state
&
.
start
import_state
.
start
end
end
def
import_fail
def
import_fail
ensure_import_state
ensure_import_state
(
force:
true
)
import_state
&
.
fail_op
import_state
.
fail_op
end
end
def
import_finish
def
import_finish
ensure_import_state
ensure_import_state
(
force:
true
)
import_state
&
.
finish
import_state
.
finish
end
end
def
import_jid
=
(
new_jid
)
def
import_jid
=
(
new_jid
)
ensure_import_state
ensure_import_state
(
force:
true
)
import_state
&
.
jid
=
new_jid
import_state
.
jid
=
new_jid
end
end
def
import_jid
def
import_jid
...
@@ -711,9 +711,9 @@ class Project < ActiveRecord::Base
...
@@ -711,9 +711,9 @@ class Project < ActiveRecord::Base
end
end
def
import_error
=
(
new_error
)
def
import_error
=
(
new_error
)
ensure_import_state
ensure_import_state
(
force:
true
)
import_state
&
.
last_error
=
new_error
import_state
.
last_error
=
new_error
end
end
def
import_error
def
import_error
...
@@ -723,9 +723,9 @@ class Project < ActiveRecord::Base
...
@@ -723,9 +723,9 @@ class Project < ActiveRecord::Base
end
end
def
import_status
=
(
new_status
)
def
import_status
=
(
new_status
)
ensure_import_state
ensure_import_state
(
force:
true
)
import_state
&
.
status
=
new_status
import_state
.
status
=
new_status
end
end
def
import_status
def
import_status
...
...
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