public
Rubygem
Description: Simple tool to help track git and svn vendor branches in a git repository
Homepage: http://github.com/evilchelu/braid/wikis/home
Clone URL: git://github.com/evilchelu/braid.git
add fixture loading helper method
evilchelu (author)
Tue Jul 22 06:36:19 -0700 2008
commit  3dcee94bf7085f29a66e1ebb38bac532bd8ba1ed
tree    c26c405d08fb7906886480d6fb99dca8efe65d8e
parent  3edf5e99f7362058fc04a05d160ef0307613c242
...
34
35
36
 
 
 
 
 
 
37
38
39
 
 
40
41
42
...
44
45
46
 
47
48
49
50
51
 
52
53
54
55
56
57
 
58
59
60
...
34
35
36
37
38
39
40
41
42
43
44
 
45
46
47
48
49
...
51
52
53
54
55
56
57
58
 
59
60
61
62
63
64
 
65
66
67
68
0
@@ -34,9 +34,16 @@ def run_cmds(ary)
0
   end
0
 end
0
 
0
+def update_dir_from_fixture(dir, fixture = dir)
0
+  to_dir = File.join(TMP_PATH, dir)
0
+  FileUtils.mkdir_p(to_dir)
0
+  FileUtils.cp_r(File.join(FIXTURE_PATH, fixture) + "/.", to_dir)
0
+end
0
+
0
 def create_git_repo_from_fixture(fixture_name)
0
   git_repo = File.join(TMP_PATH, fixture_name)
0
-  FileUtils.cp_r(File.join(FIXTURE_PATH, fixture_name), TMP_PATH)
0
+  update_dir_from_fixture(fixture_name)
0
+
0
   in_dir(git_repo) do
0
     run_cmds(<<-EOD)
0
       git init
0
@@ -44,17 +51,18 @@ def create_git_repo_from_fixture(fixture_name)
0
       git commit -m "initial commit of #{fixture_name}"
0
     EOD
0
   end
0
+
0
   git_repo
0
 end
0
 
0
 def create_svn_repo_from_fixture(fixture_name)
0
-  svn_wc = File.join(TMP_PATH, fixture_name + "_repo")
0
+  svn_wc = File.join(TMP_PATH, fixture_name + "_wc")
0
   svn_repo = File.join(TMP_PATH, fixture_name)
0
   run_cmds(<<-EOD)
0
     svnadmin create #{svn_repo}
0
     svn co file://#{svn_repo} #{svn_wc}
0
   EOD
0
-  FileUtils.cp_r("#{FIXTURE_PATH}/#{fixture_name}/.", svn_wc)
0
+  update_dir_from_fixture(fixture_name + "_wc", fixture_name)
0
   in_dir(svn_wc) do
0
     run_cmds(<<-EOD)
0
       svn add *

Comments