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
6612ca09
Commit
6612ca09
authored
May 05, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update repo and wiki repo bundler to use git bundle instead of compressing via tar
parent
773c39cc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
app/services/projects/import_export/export_service.rb
app/services/projects/import_export/export_service.rb
+6
-0
lib/gitlab/import_export/repo_bundler.rb
lib/gitlab/import_export/repo_bundler.rb
+1
-2
lib/gitlab/import_export/wiki_repo_bundler.rb
lib/gitlab/import_export/wiki_repo_bundler.rb
+1
-2
No files found.
app/services/projects/import_export/export_service.rb
View file @
6612ca09
...
@@ -4,8 +4,10 @@ module Projects
...
@@ -4,8 +4,10 @@ module Projects
def
execute
(
options
=
{})
def
execute
(
options
=
{})
@shared
=
Gitlab
::
ImportExport
::
Shared
.
new
(
relative_path:
File
.
join
(
project
.
path_with_namespace
,
'work'
))
@shared
=
Gitlab
::
ImportExport
::
Shared
.
new
(
relative_path:
File
.
join
(
project
.
path_with_namespace
,
'work'
))
# TODO handle errors
save_project_tree
save_project_tree
bundle_repo
bundle_repo
bundle_wiki_repo
save_all
save_all
end
end
...
@@ -19,6 +21,10 @@ module Projects
...
@@ -19,6 +21,10 @@ module Projects
Gitlab
::
ImportExport
::
RepoBundler
.
new
(
project:
project
,
shared:
@shared
).
bundle
Gitlab
::
ImportExport
::
RepoBundler
.
new
(
project:
project
,
shared:
@shared
).
bundle
end
end
def
bundle_wiki_repo
Gitlab
::
ImportExport
::
WikiRepoBundler
.
new
(
project:
project
,
shared:
@shared
).
bundle
end
def
save_all
def
save_all
Gitlab
::
ImportExport
::
Saver
.
save
(
storage_path:
@shared
.
export_path
)
Gitlab
::
ImportExport
::
Saver
.
save
(
storage_path:
@shared
.
export_path
)
end
end
...
...
lib/gitlab/import_export/repo_bundler.rb
View file @
6612ca09
...
@@ -20,9 +20,8 @@ module Gitlab
...
@@ -20,9 +20,8 @@ module Gitlab
def
bundle_to_disk
def
bundle_to_disk
FileUtils
.
mkdir_p
(
@export_path
)
FileUtils
.
mkdir_p
(
@export_path
)
tar_cf
(
archive:
full_path
,
dir:
path_to_repo
)
git_bundle
(
repo_path:
path_to_repo
,
bundle_path:
@full_path
)
rescue
rescue
#TODO: handle error
false
false
end
end
...
...
lib/gitlab/import_export/wiki_repo_bundler.rb
View file @
6612ca09
...
@@ -3,7 +3,7 @@ module Gitlab
...
@@ -3,7 +3,7 @@ module Gitlab
class
WikiRepoBundler
<
RepoBundler
class
WikiRepoBundler
<
RepoBundler
def
bundle
def
bundle
@wiki
=
ProjectWiki
.
new
(
@project
)
@wiki
=
ProjectWiki
.
new
(
@project
)
return
false
if
!
wiki?
return
true
if
!
wiki?
# it's okay to have no Wiki
@full_path
=
File
.
join
(
@export_path
,
project_filename
)
@full_path
=
File
.
join
(
@export_path
,
project_filename
)
bundle_to_disk
bundle_to_disk
end
end
...
@@ -12,7 +12,6 @@ module Gitlab
...
@@ -12,7 +12,6 @@ module Gitlab
FileUtils
.
mkdir_p
(
@export_path
)
FileUtils
.
mkdir_p
(
@export_path
)
git_bundle
(
repo_path:
path_to_repo
,
bundle_path:
@full_path
)
git_bundle
(
repo_path:
path_to_repo
,
bundle_path:
@full_path
)
rescue
rescue
#TODO: handle error
false
false
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