cloning.rb revision 3bfc9e3ce3733056e676a1aec8ab6b401e731a63
require 'open3'
SCRIPT_REMOTE_ADD = "#{DIR}/remote_add_origin.sh"
SCRIPT_REMOTE_RM = "#{DIR}/remote_rm_origin.sh"
SCRIPT_PUSH = "#{DIR}/push.sh"
SCRIPT_PULL = "#{DIR}/pull.sh"
SCRIPT_SVN_REBASE = "#{DIR}/svn_rebase.sh"
# runs `git push`
end
# runs `git pull`
end
# runs `git svn rebase`
stdin, stdout, stderr, wait_thr = Open3.popen3 'sh', SCRIPT_SVN_REBASE, repo.path.split('/')[0..-2].join('/')
end
end
# clones a git repository into a bare git repository
end
# clones a git repository into a bare git repository and one with a working copy
# last parameter (max_revision) is used for testing only
else
return result_svn unless result_svn[:success]
return result_git unless result_git[:success]
return result_remote_rm unless result_remote_rm[:success]
return result_remote_add unless result_remote_add[:success]
end
end
if max_revision.nil?
else
stdin, stdout, stderr, wait_thr = Open3.popen3 'git', 'svn', 'clone', '-r', "0:#{max_revision}", source_path, target_path
end
end
end
end
end
end