Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
9d0038f2
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9d0038f2
编写于
6月 03, 2016
作者:
J
James Lopez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
started refactoring a bunch of stuff based on feedback
上级
398f0071
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
28 addition
and
31 deletion
+28
-31
app/services/projects/import_export/export_service.rb
app/services/projects/import_export/export_service.rb
+18
-15
lib/gitlab/import_export/import_export.yml
lib/gitlab/import_export/import_export.yml
+2
-0
lib/gitlab/import_export/repo_saver.rb
lib/gitlab/import_export/repo_saver.rb
+2
-2
lib/gitlab/import_export/uploads_saver.rb
lib/gitlab/import_export/uploads_saver.rb
+0
-4
lib/gitlab/import_export/version_saver.rb
lib/gitlab/import_export/version_saver.rb
+0
-4
lib/gitlab/import_export/wiki_repo_saver.rb
lib/gitlab/import_export/wiki_repo_saver.rb
+2
-2
spec/lib/gitlab/import_export/repo_bundler_spec.rb
spec/lib/gitlab/import_export/repo_bundler_spec.rb
+2
-2
spec/lib/gitlab/import_export/wiki_repo_bundler_spec.rb
spec/lib/gitlab/import_export/wiki_repo_bundler_spec.rb
+2
-2
未找到文件。
app/services/projects/import_export/export_service.rb
浏览文件 @
9d0038f2
...
...
@@ -2,36 +2,39 @@ module Projects
module
ImportExport
class
ExportService
<
BaseService
def
execute
(
options
=
{})
def
execute
(
_
options
=
{})
@shared
=
Gitlab
::
ImportExport
::
Shared
.
new
(
relative_path:
File
.
join
(
project
.
path_with_namespace
,
'work'
))
save_all
if
[
save_version
,
save_project_tree
,
save_uploads
,
bundle_repo
,
bundle_wiki_repo
].
all?
cleanup_and_notify_worker
if
@shared
.
errors
.
any?
save_all
end
private
def
save_version
Gitlab
::
ImportExport
::
VersionSaver
.
save
(
shared:
@shared
)
def
save_all
if
[
version_saver
,
project_tree_saver
,
uploads_saver
,
repo_saver
,
wiki_repo_saver
].
all?
(
&
:save
)
Gitlab
::
ImportExport
::
Saver
.
save
(
shared:
@shared
)
else
cleanup_and_notify_worker
end
end
def
save_project_tree
Gitlab
::
ImportExport
::
ProjectTreeSaver
.
new
(
project:
project
,
shared:
@shared
).
save
def
version_saver
Gitlab
::
ImportExport
::
VersionSaver
.
new
(
shared:
@shared
)
end
def
save_uploads
Gitlab
::
ImportExport
::
UploadsSaver
.
save
(
project:
project
,
shared:
@shared
)
def
project_tree_saver
Gitlab
::
ImportExport
::
ProjectTreeSaver
.
new
(
project:
project
,
shared:
@shared
)
end
def
bundle_repo
Gitlab
::
ImportExport
::
RepoBundler
.
new
(
project:
project
,
shared:
@shared
).
bundle
def
uploads_saver
Gitlab
::
ImportExport
::
UploadsSaver
.
new
(
project:
project
,
shared:
@shared
)
end
def
bundle_wiki_repo
Gitlab
::
ImportExport
::
WikiRepoBundler
.
new
(
project:
project
,
shared:
@shared
).
bundle
def
repo_saver
Gitlab
::
ImportExport
::
RepoSaver
.
new
(
project:
project
,
shared:
@shared
)
end
def
save_all
Gitlab
::
ImportExport
::
Saver
.
save
(
shared:
@shared
)
def
wiki_repo_saver
Gitlab
::
ImportExport
::
WikiRepoSaver
.
new
(
project:
project
,
shared:
@shared
)
end
def
cleanup_and_notify_worker
...
...
lib/gitlab/import_export/import_export.yml
浏览文件 @
9d0038f2
...
...
@@ -16,6 +16,8 @@ project_tree:
-
:merge_request_diff
-
ci_commits
:
-
:statuses
-
notes
:
:author
-
:variables
-
:triggers
-
:deploy_keys
...
...
lib/gitlab/import_export/repo_
bundl
er.rb
→
lib/gitlab/import_export/repo_
sav
er.rb
浏览文件 @
9d0038f2
module
Gitlab
module
ImportExport
class
Repo
Bundl
er
class
Repo
Sav
er
include
Gitlab
::
ImportExport
::
CommandLineUtil
attr_reader
:full_path
...
...
@@ -10,7 +10,7 @@ module Gitlab
@shared
=
shared
end
def
bundl
e
def
sav
e
return
false
if
@project
.
empty_repo?
@full_path
=
File
.
join
(
@shared
.
export_path
,
ImportExport
.
project_bundle_filename
)
bundle_to_disk
...
...
lib/gitlab/import_export/uploads_saver.rb
浏览文件 @
9d0038f2
...
...
@@ -2,10 +2,6 @@ module Gitlab
module
ImportExport
class
UploadsSaver
def
self
.
save
(
*
args
)
new
(
*
args
).
save
end
def
initialize
(
project
:,
shared
:)
@project
=
project
@shared
=
shared
...
...
lib/gitlab/import_export/version_saver.rb
浏览文件 @
9d0038f2
...
...
@@ -2,10 +2,6 @@ module Gitlab
module
ImportExport
class
VersionSaver
def
self
.
save
(
*
args
)
new
(
*
args
).
save
end
def
initialize
(
shared
:)
@shared
=
shared
end
...
...
lib/gitlab/import_export/wiki_repo_
bundl
er.rb
→
lib/gitlab/import_export/wiki_repo_
sav
er.rb
浏览文件 @
9d0038f2
module
Gitlab
module
ImportExport
class
WikiRepo
Bundler
<
RepoBundl
er
def
bundl
e
class
WikiRepo
Saver
<
RepoSav
er
def
sav
e
@wiki
=
ProjectWiki
.
new
(
@project
)
return
true
unless
wiki_repository_exists?
# it's okay to have no Wiki
bundle_to_disk
(
File
.
join
(
@shared
.
export_path
,
project_filename
))
...
...
spec/lib/gitlab/import_export/repo_bundler_spec.rb
浏览文件 @
9d0038f2
require
'spec_helper'
describe
Gitlab
::
ImportExport
::
Repo
Bundl
er
,
services:
true
do
describe
Gitlab
::
ImportExport
::
Repo
Sav
er
,
services:
true
do
describe
'bundle a project Git repo'
do
let
(
:user
)
{
create
(
:user
)
}
...
...
@@ -19,7 +19,7 @@ describe Gitlab::ImportExport::RepoBundler, services: true do
end
it
'bundles the repo successfully'
do
expect
(
bundler
.
bundl
e
).
to
be
true
expect
(
bundler
.
sav
e
).
to
be
true
end
end
end
spec/lib/gitlab/import_export/wiki_repo_bundler_spec.rb
浏览文件 @
9d0038f2
require
'spec_helper'
describe
Gitlab
::
ImportExport
::
WikiRepo
Bundl
er
,
services:
true
do
describe
Gitlab
::
ImportExport
::
WikiRepo
Sav
er
,
services:
true
do
describe
'bundle a wiki Git repo'
do
let
(
:user
)
{
create
(
:user
)
}
...
...
@@ -22,7 +22,7 @@ describe Gitlab::ImportExport::WikiRepoBundler, services: true do
end
it
'bundles the repo successfully'
do
expect
(
wiki_bundler
.
bundl
e
).
to
be
true
expect
(
wiki_bundler
.
sav
e
).
to
be
true
end
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录