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
Boxiang Sun
gitlab-ce
Commits
2c260962
Commit
2c260962
authored
Aug 01, 2017
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small refactor in LegacyNamespace and moved back send_update_instructions
parent
597e6190
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
app/models/concerns/storage/legacy_namespace.rb
app/models/concerns/storage/legacy_namespace.rb
+2
-9
app/models/namespace.rb
app/models/namespace.rb
+6
-0
No files found.
app/models/concerns/storage/legacy_namespace.rb
View file @
2c260962
...
...
@@ -7,7 +7,7 @@ module Storage
raise
Gitlab
::
UpdatePathError
.
new
(
'Namespace cannot be moved, because at least one project has tags in container registry'
)
end
# Move the namespace directory in all storage
s
paths used by member projects
# Move the namespace directory in all storage paths used by member projects
repository_storage_paths
.
each
do
|
repository_storage_path
|
# Ensure old directory exists before moving it
gitlab_shell
.
add_namespace
(
repository_storage_path
,
full_path_was
)
...
...
@@ -49,12 +49,6 @@ module Storage
private
def
send_update_instructions
projects
.
each
do
|
project
|
project
.
send_move_instructions
(
"
#{
full_path_was
}
/
#{
project
.
path
}
"
)
end
end
def
old_repository_storage_paths
@old_repository_storage_paths
||=
repository_storage_paths
end
...
...
@@ -76,8 +70,7 @@ module Storage
new_path
=
"
#{
full_path
}
+
#{
id
}
+deleted"
if
gitlab_shell
.
mv_namespace
(
repository_storage_path
,
full_path
,
new_path
)
message
=
"Namespace directory
\"
#{
full_path
}
\"
moved to
\"
#{
new_path
}
\"
"
Gitlab
::
AppLogger
.
info
message
Gitlab
::
AppLogger
.
info
%Q(Namespace directory "
#{
full_path
}
" moved to "
#{
new_path
}
")
# Remove namespace directroy async with delay so
# GitLab has time to remove all projects first
...
...
app/models/namespace.rb
View file @
2c260962
...
...
@@ -124,6 +124,12 @@ class Namespace < ActiveRecord::Base
all_projects
.
any?
(
&
:has_container_registry_tags?
)
end
def
send_update_instructions
projects
.
each
do
|
project
|
project
.
send_move_instructions
(
"
#{
full_path_was
}
/
#{
project
.
path
}
"
)
end
end
def
kind
type
==
'Group'
?
'group'
:
'user'
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