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
ff35b37f
Commit
ff35b37f
authored
Mar 25, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
transfer also wiki repository when transfer a project
parent
1fb99264
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
app/services/project_transfer_service.rb
app/services/project_transfer_service.rb
+8
-2
No files found.
app/services/project_transfer_service.rb
View file @
ff35b37f
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
class
ProjectTransferService
class
ProjectTransferService
include
Gitlab
::
ShellAdapter
include
Gitlab
::
ShellAdapter
class
TransferError
<
StandardError
;
end
attr_accessor
:project
attr_accessor
:project
def
transfer
(
project
,
new_namespace
)
def
transfer
(
project
,
new_namespace
)
...
@@ -19,14 +21,18 @@ class ProjectTransferService
...
@@ -19,14 +21,18 @@ class ProjectTransferService
project
.
namespace
=
new_namespace
project
.
namespace
=
new_namespace
project
.
save!
project
.
save!
# Move main repository
unless
gitlab_shell
.
mv_repository
(
old_path
,
new_path
)
unless
gitlab_shell
.
mv_repository
(
old_path
,
new_path
)
raise
TransferError
.
new
(
'Cannot move project'
)
raise
TransferError
.
new
(
'Cannot move project'
)
end
end
# Move wiki repo also if present
if
project
.
wikis
.
any?
gitlab_shell
.
mv_repository
(
"
#{
old_path
}
.wiki"
,
"
#{
new_path
}
.wiki"
)
end
true
true
end
end
rescue
=>
ex
raise
Project
::
TransferError
.
new
(
ex
.
message
)
end
end
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