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 integration tests for svn/git import.
francois (author)
Sat Mar 22 19:59:05 -0700 2008
commit  a620cf070668a272884670d46319a4d8ddc8a2c8
tree    ba76dde58bb13738d73f650b199eccdb4bb23f1c
parent  68f3e271170a14fe0d20f844703b80e5d62e9aa6
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
0
@@ -1 +1,52 @@
0
+require File.dirname(__FILE__) + "/../test_helper"
0
+require File.dirname(__FILE__) + "/../integration_helpers"
0
+
0
+class TestImportSvnGit < Test::Unit::TestCase
0
+ attr_reader :root_path, :repos_path, :wc_path
0
+
0
+ def setup
0
+ @root_path = Pathname.new("/tmp/import_svn_git")
0
+ @repos_path = @root_path + "repos"
0
+ @wc_path = @root_path + "wc"
0
+
0
+ root_path.rmtree rescue nil
0
+ root_path.mkpath
0
+
0
+ wc_path.mkpath
0
+ Dir.chdir(wc_path) do
0
+ git(:init)
0
+ File.open(wc_path + "README", "wb") {|f| f.write "Hello World!"}
0
+ (wc_path + "vendor").mkdir
0
+ File.open(wc_path + "vendor/.gitignore", "wb") {|f| f.write "*.swp"}
0
+ git(:add, ".")
0
+ git(:commit, "-m", "'first commit'")
0
+ end
0
+ end
0
+
0
+ def teardown
0
+ root_path.rmtree rescue nil
0
+ end
0
+
0
+ def test_import
0
+ piston :import, "http://dev.rubyonrails.org/svn/rails/plugins/ssl_requirement/", wc_path + "vendor/ssl_requirement"
0
+
0
+ Dir.chdir(wc_path) do
0
+ assert_equal %Q(# On branch master
0
+# Changes to be committed:
0
+# (use "git reset HEAD <file>..." to unstage)
0
+#
0
+#\tnew file: vendor/ssl_requirement/.piston.yml
0
+#\tnew file: vendor/ssl_requirement/README
0
+#\tnew file: vendor/ssl_requirement/lib/ssl_requirement.rb
0
+#\tnew file: vendor/ssl_requirement/test/ssl_requirement_test.rb
0
+#
0
+).split("\n").sort, git(:status).split("\n").sort
0
+ end
0
+
0
+ info = YAML.load(File.read(wc_path + "vendor/ssl_requirement/.piston.yml"))
0
+ assert_equal 1, info["format"]
0
+ assert_equal "http://dev.rubyonrails.org/svn/rails/plugins/ssl_requirement", info["handler"][Piston::Svn::ROOT]
0
+ assert_equal "5ecf4fe2-1ee6-0310-87b1-e25e094e27de", info["handler"][Piston::Svn::UUID]
0
+ end
0
+end
...
20
21
22
 
 
 
 
23
24
25
...
20
21
22
23
24
25
26
27
28
29
0
@@ -20,6 +20,10 @@
0
   runcmd(:svnadmin, *args)
0
 end
0
 
0
+def git(*args)
0
+ runcmd(:git, *args)
0
+end
0
+
0
 def piston(*args)
0
   runcmd(:ruby, "-I", PISTON_ROOT + "lib", PISTON_ROOT + "bin/piston", *args)
0
 end

Comments

    No one has commented yet.