Commit 2ca7568d authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Merged backup of wikis into release branch

--HG--
branch : heptapod-0-13
......@@ -31,6 +31,8 @@ def initialize(project, user = nil)
delegate :repository_storage, :hashed_storage?, to: :project
delegate :vcs_type, :mercurial?, to: :project
def path
@project.path + '.wiki'
end
......
......@@ -171,13 +171,17 @@ def restore
wiki = ProjectWiki.new(project)
path_to_wiki_bundle = path_to_bundle(wiki)
if File.exist?(path_to_wiki_bundle)
path_to_hg_wiki_bundle = path_to_hg_bundle(wiki)
if File.exist?(path_to_wiki_bundle) || File.exist?(path_to_hg_wiki_bundle)
progress.print " * #{wiki.full_path} ... "
begin
wiki.repository.create_from_bundle(path_to_wiki_bundle)
restore_custom_hooks(wiki)
if has_git
wiki.repository.create_from_bundle(path_to_wiki_bundle)
restore_custom_hooks(wiki)
end
if project.mercurial?
restore_hg_repo(wiki)
end
progress.puts "[DONE]".color(:green)
rescue => e
progress.puts "[Failed] restoring #{wiki.full_path} wiki".color(:red)
......@@ -236,7 +240,7 @@ def custom_hooks_tar(project)
end
def path_to_hg_tars(project, dir = nil)
path = File.join(backup_repos_path, project.disk_path.ext('.hg'))
path = File.join(backup_repos_path, project.disk_path + '.hg')
if dir
File.join(path, "#{dir}.tar")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment