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
8dce2158
Commit
8dce2158
authored
Apr 22, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged rename and transfer into "Move" service.
parent
16117b06
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
app/services/geo/move_repository_service.rb
app/services/geo/move_repository_service.rb
+4
-1
app/services/geo/schedule_repo_move_service.rb
app/services/geo/schedule_repo_move_service.rb
+1
-1
app/workers/geo_repository_move_worker.rb
app/workers/geo_repository_move_worker.rb
+2
-2
No files found.
app/services/geo/
renam
e_repository_service.rb
→
app/services/geo/
mov
e_repository_service.rb
View file @
8dce2158
module
Geo
class
Renam
eRepositoryService
class
Mov
eRepositoryService
include
Gitlab
::
ShellAdapter
attr_reader
:id
,
:name
,
:old_path_with_namespace
,
:new_path_with_namespace
...
...
@@ -15,6 +15,9 @@ module Geo
project
=
Project
.
find
(
id
)
project
.
expire_caches_before_rename
(
old_path_with_namespace
)
# Make sure target directory exists (used when transfering repositories)
project
.
namespace
.
ensure_dir_exist
if
gitlab_shell
.
mv_repository
(
old_path_with_namespace
,
new_path_with_namespace
)
# If repository moved successfully we need to send update instructions to users.
# However we cannot allow rollback since we moved repository
...
...
app/services/geo/schedule_repo_
renam
e_service.rb
→
app/services/geo/schedule_repo_
mov
e_service.rb
View file @
8dce2158
...
...
@@ -10,7 +10,7 @@ module Geo
end
def
execute
GeoRepository
Renam
eWorker
.
perform_async
(
id
,
name
,
old_path_with_namespace
,
path_with_namespace
)
GeoRepository
Mov
eWorker
.
perform_async
(
id
,
name
,
old_path_with_namespace
,
path_with_namespace
)
end
end
end
app/workers/geo_repository_
renam
e_worker.rb
→
app/workers/geo_repository_
mov
e_worker.rb
View file @
8dce2158
class
GeoRepository
Renam
eWorker
class
GeoRepository
Mov
eWorker
include
Sidekiq
::
Worker
sidekiq_options
queue: :default
def
perform
(
id
,
name
,
old_path_with_namespace
,
new_path_with_namespace
)
Geo
::
Renam
eRepositoryService
.
new
(
id
,
name
,
old_path_with_namespace
,
new_path_with_namespace
).
execute
Geo
::
Mov
eRepositoryService
.
new
(
id
,
name
,
old_path_with_namespace
,
new_path_with_namespace
).
execute
end
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