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
Léo-Paul Géneau
gitlab-ce
Commits
58b0b1a6
Commit
58b0b1a6
authored
May 03, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
picking export stuff from the UI branch
parent
fedfba55
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
2 deletions
+22
-2
app/services/projects/import_export/export_service.rb
app/services/projects/import_export/export_service.rb
+2
-1
lib/gitlab/import_export/command_line_util.rb
lib/gitlab/import_export/command_line_util.rb
+14
-0
lib/gitlab/import_export/import_export_reader.rb
lib/gitlab/import_export/import_export_reader.rb
+3
-1
lib/gitlab/import_export/project_tree_saver.rb
lib/gitlab/import_export/project_tree_saver.rb
+1
-0
lib/gitlab/import_export/repo_bundler.rb
lib/gitlab/import_export/repo_bundler.rb
+1
-0
lib/gitlab/import_export/saver.rb
lib/gitlab/import_export/saver.rb
+1
-0
No files found.
app/services/projects/import_export/export_service.rb
View file @
58b0b1a6
module
Projects
module
ImportExport
class
ExportService
<
BaseService
def
execute
(
options
=
{})
@shared
=
Gitlab
::
ImportExport
::
Shared
.
new
(
relative_path:
project
.
path_with_namespace
)
@shared
=
Gitlab
::
ImportExport
::
Shared
.
new
(
relative_path:
File
.
join
(
project
.
path_with_namespace
,
'work'
)
)
save_project_tree
bundle_repo
save_all
...
...
lib/gitlab/import_export/command_line_util.rb
View file @
58b0b1a6
...
...
@@ -5,6 +5,14 @@ module Gitlab
tar_with_options
(
archive:
archive
,
dir:
dir
,
options:
'cf'
)
end
def
untar_zxf
(
archive
:,
dir
:)
untar_with_options
(
archive:
archive
,
dir:
dir
,
options:
'zxf'
)
end
def
untar_xf
(
archive
:,
dir
:)
untar_with_options
(
archive:
archive
,
dir:
dir
,
options:
'xf'
)
end
def
tar_czf
(
archive
:,
dir
:)
tar_with_options
(
archive:
archive
,
dir:
dir
,
options:
'czf'
)
end
...
...
@@ -20,6 +28,12 @@ module Gitlab
_output
,
status
=
Gitlab
::
Popen
.
popen
(
cmd
)
status
.
zero?
end
def
untar_with_options
(
archive
:,
dir
:,
options
:)
cmd
=
%W(tar -
#{
options
}
#{
archive
}
-C
#{
dir
}
)
_output
,
status
=
Gitlab
::
Popen
.
popen
(
cmd
)
status
.
zero?
end
end
end
end
lib/gitlab/import_export/import_export_reader.rb
View file @
58b0b1a6
...
...
@@ -57,8 +57,10 @@ module Gitlab
end
def
add_new_class
(
current_key
,
included_classes_hash
,
value
)
only_except_hash
=
check_only_and_except
(
value
)
# TODO: refactor this
value
=
(
value
.
is_a?
(
Hash
)
?
value
.
merge
(
only_except_hash
)
:
{
value
=>
only_except_hash
})
if
only_except_hash
new_hash
=
{
include:
value
}
new_hash
.
merge!
(
check_only_and_except
(
value
))
included_classes_hash
[
current_key
]
=
new_hash
end
...
...
lib/gitlab/import_export/project_tree_saver.rb
View file @
58b0b1a6
...
...
@@ -24,6 +24,7 @@ module Gitlab
false
end
# TODO remove magic keyword and move it to a shared config
def
project_filename
"project.json"
end
...
...
lib/gitlab/import_export/repo_bundler.rb
View file @
58b0b1a6
...
...
@@ -26,6 +26,7 @@ module Gitlab
false
end
# TODO remove magic keyword and move it to a shared config
def
project_filename
"project.bundle"
end
...
...
lib/gitlab/import_export/saver.rb
View file @
58b0b1a6
...
...
@@ -14,6 +14,7 @@ module Gitlab
def
save
if
compress_and_save
remove_storage_path
Rails
.
logger
.
info
(
"Saved project export
#{
archive_file
}
"
)
archive_file
else
false
...
...
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