public
Description: Piston is a utility that eases vendor branch management. This repository is a complete reimplementation of Piston to provide different backends, depending on the repositories and working copies you pistonize from.
Homepage: http://piston.rubyforge.org/
Clone URL: git://github.com/francois/piston.git
Search Repo:
New samples/import_git_svn.rb
francois (author)
Sat Mar 15 11:51:49 -0700 2008
commit  3cc9ef912975532dbb7d9dacf08a9291285deec8
tree    a2d5e0e6f3ddb8ac83454cbbf2a4fbce8559d828
parent  45ec1b065d277124676838e33ec4b7d8fa69d334
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
0
@@ -1 +1,37 @@
0
+#!/usr/bin/env ruby
0
+#
0
+# Import a Git project into a Subversion working copy.
0
+require File.dirname(__FILE__) + "/common"
0
+
0
+@root = @root + "tmp/git_svn"
0
+@root.rmtree rescue nil
0
+@root.mkpath
0
+
0
+@repos = @root + "repos"
0
+@wc = @root + "wc"
0
+
0
+@plugin = @root + "plugin"
0
+@tmp = @root + "plugin.tmp"
0
+
0
+svnadmin :create, @repos
0
+svn :checkout, "--quiet", "file://" + @repos.realpath, @wc
0
+
0
+@plugin.mkpath
0
+File.open(@plugin + "README", "wb") {|f| f.puts "Hello World"}
0
+File.open(@plugin + "init.rb", "wb") {|f| f.puts "# Some initialization code here"}
0
+Dir.chdir(@plugin) do
0
+ logger.debug {"CWD: #{Dir.getwd}"}
0
+ git :init
0
+ git :add, "."
0
+ git :commit, "-m", "initial commit"
0
+end
0
+
0
+repos = Piston::Git::Repository.new("file://" + @plugin.realpath)
0
+commit = repos.at(:head)
0
+commit.checkout_to(@tmp)
0
+wc = Piston::Svn::WorkingCopy.new(@wc + "vendor")
0
+wc.create
0
+wc.copy_from(commit)
0
+wc.remember(commit.remember_values)
0
+wc.finalize

Comments

    No one has commented yet.