braid 0.6.2 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +12 -0
- data/Gemfile +3 -0
- data/README.textile +5 -10
- data/Rakefile +3 -0
- data/bin/braid +13 -5
- data/braid.gemspec +26 -18
- data/lib/braid.rb +17 -7
- data/lib/braid/command.rb +70 -69
- data/lib/braid/commands/add.rb +3 -3
- data/lib/braid/commands/list.rb +32 -0
- data/lib/braid/commands/push.rb +1 -1
- data/lib/braid/commands/setup.rb +19 -18
- data/lib/braid/commands/update.rb +70 -69
- data/lib/braid/config.rb +9 -9
- data/lib/braid/mirror.rb +49 -48
- data/lib/braid/operations.rb +98 -69
- data/lib/braid/version.rb +3 -0
- data/lib/core_ext.rb +1 -1
- data/test/config_test.rb +1 -1
- data/test/integration/adding_test.rb +2 -2
- data/test/integration/updating_test.rb +4 -4
- data/test/integration_helper.rb +3 -3
- data/test/mirror_test.rb +2 -2
- data/test/operations_test.rb +2 -2
- metadata +101 -95
data/lib/core_ext.rb
CHANGED
data/test/config_test.rb
CHANGED
@@ -52,7 +52,7 @@ describe "Braid::Config, with one mirror" do
|
|
52
52
|
it "should update the mirror with new params" do
|
53
53
|
@mirror.branch = "other"
|
54
54
|
@config.update(@mirror)
|
55
|
-
@config.get("path").attributes.should == {
|
55
|
+
@config.get("path").attributes.should == {"branch" => "other"}
|
56
56
|
end
|
57
57
|
|
58
58
|
it "should raise when trying to update nonexistent mirror" do
|
@@ -19,7 +19,7 @@ describe "Adding a mirror in a clean repository" do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
file_name = "skit1/layouts/layout.liquid"
|
22
|
-
output
|
22
|
+
output = `diff -U 3 #{File.join(FIXTURE_PATH, file_name)} #{File.join(TMP_PATH, "shiny", file_name)}`
|
23
23
|
$?.should.be.success
|
24
24
|
|
25
25
|
output = `git log --pretty=oneline`.split("\n")
|
@@ -54,7 +54,7 @@ describe "Adding a mirror in a clean repository" do
|
|
54
54
|
end
|
55
55
|
|
56
56
|
file_name = "skit1/layouts/layout.liquid"
|
57
|
-
output
|
57
|
+
output = `diff -U 3 #{File.join(FIXTURE_PATH, file_name)} #{File.join(TMP_PATH, "shiny", file_name)}`
|
58
58
|
$?.should.be.success
|
59
59
|
|
60
60
|
output = `git log --pretty=oneline`.split("\n")
|
@@ -36,7 +36,7 @@ describe "Updating a mirror without conflicts" do
|
|
36
36
|
end
|
37
37
|
|
38
38
|
file_name = "layouts/layout.liquid"
|
39
|
-
output
|
39
|
+
output = `diff -U 3 #{File.join(FIXTURE_PATH, "skit1.2", file_name)} #{File.join(TMP_PATH, "shiny", "skit1", file_name)}`
|
40
40
|
$?.should.be.success
|
41
41
|
|
42
42
|
output = `git log --pretty=oneline`.split("\n")
|
@@ -48,8 +48,8 @@ describe "Updating a mirror without conflicts" do
|
|
48
48
|
|
49
49
|
describe "from a svn repository" do
|
50
50
|
before do
|
51
|
-
@shiny
|
52
|
-
@skit1
|
51
|
+
@shiny = create_git_repo_from_fixture("shiny")
|
52
|
+
@skit1 = create_svn_repo_from_fixture("skit1")
|
53
53
|
@skit1_wc = File.join(TMP_PATH, "skit1_wc")
|
54
54
|
|
55
55
|
in_dir(@shiny) do
|
@@ -74,7 +74,7 @@ describe "Updating a mirror without conflicts" do
|
|
74
74
|
end
|
75
75
|
|
76
76
|
file_name = "layouts/layout.liquid"
|
77
|
-
output
|
77
|
+
output = `diff -U 3 #{File.join(FIXTURE_PATH, "skit1.2", file_name)} #{File.join(TMP_PATH, "shiny", "skit1", file_name)}`
|
78
78
|
$?.should.be.success
|
79
79
|
|
80
80
|
output = `git log --pretty=oneline`.split("\n")
|
data/test/integration_helper.rb
CHANGED
@@ -6,8 +6,8 @@ require 'tempfile'
|
|
6
6
|
require 'fileutils'
|
7
7
|
require 'pathname'
|
8
8
|
|
9
|
-
TMP_PATH
|
10
|
-
BRAID_PATH
|
9
|
+
TMP_PATH = File.join(Dir.tmpdir, "braid_integration")
|
10
|
+
BRAID_PATH = Pathname.new(File.dirname(__FILE__)).parent.realpath
|
11
11
|
FIXTURE_PATH = File.join(BRAID_PATH, "test", "fixtures")
|
12
12
|
FileUtils.rm_rf(TMP_PATH)
|
13
13
|
FileUtils.mkdir_p(TMP_PATH)
|
@@ -51,7 +51,7 @@ def create_git_repo_from_fixture(fixture_name)
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def create_svn_repo_from_fixture(fixture_name)
|
54
|
-
svn_wc
|
54
|
+
svn_wc = File.join(TMP_PATH, fixture_name + "_wc")
|
55
55
|
svn_repo = File.join(TMP_PATH, fixture_name)
|
56
56
|
run_cmds(<<-EOD)
|
57
57
|
svnadmin create #{svn_repo}
|
data/test/mirror_test.rb
CHANGED
@@ -85,8 +85,8 @@ describe "Braid::Mirror#inferred_revision" do
|
|
85
85
|
it "should return the last commit before the most recent update" do
|
86
86
|
@mirror = new_from_options("git://path")
|
87
87
|
git.expects(:rev_list).times(2).returns(
|
88
|
-
|
89
|
-
|
88
|
+
"#{'a' * 40}\n",
|
89
|
+
"commit #{'b' * 40}\n#{'t' * 40}\n"
|
90
90
|
)
|
91
91
|
git.expects(:tree_hash).with(@mirror.path, 'a' * 40).returns('t' * 40)
|
92
92
|
@mirror.send(:inferred_revision).should == 'b' * 40
|
data/test/operations_test.rb
CHANGED
@@ -36,8 +36,8 @@ end
|
|
36
36
|
|
37
37
|
describe "Braid::Operations::Git#require_version" do
|
38
38
|
REQUIRED_VERSION = "1.5.4.5"
|
39
|
-
PASS_VERSIONS
|
40
|
-
FAIL_VERSIONS
|
39
|
+
PASS_VERSIONS = %w(1.5.4.6 1.5.5 1.6 1.5.4.5.2 1.5.5.1.98.gf0ec4)
|
40
|
+
FAIL_VERSIONS = %w(1.5.4.4 1.5.4 1.5.3 1.4.5.6)
|
41
41
|
|
42
42
|
def set_version(str)
|
43
43
|
git.expects(:exec).returns([0, "git version #{str}\n", ""])
|
metadata
CHANGED
@@ -1,132 +1,138 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: braid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 6
|
9
|
-
- 2
|
10
|
-
version: 0.6.2
|
4
|
+
prerelease:
|
5
|
+
version: 0.7.0
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
|
-
- Cristi Balan
|
14
|
-
- Norbert Crombach
|
8
|
+
- Cristi Balan
|
9
|
+
- Norbert Crombach
|
15
10
|
autorequire:
|
16
11
|
bindir: bin
|
17
12
|
cert_chain: []
|
18
13
|
|
19
|
-
date:
|
14
|
+
date: 2011-03-15 00:00:00 -04:00
|
20
15
|
default_executable: braid
|
21
16
|
dependencies:
|
22
|
-
- !ruby/object:Gem::Dependency
|
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
|
-
|
52
|
-
|
53
|
-
|
17
|
+
- !ruby/object:Gem::Dependency
|
18
|
+
name: main
|
19
|
+
prerelease: false
|
20
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
21
|
+
none: false
|
22
|
+
requirements:
|
23
|
+
- - ">="
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: 4.2.0
|
26
|
+
type: :runtime
|
27
|
+
version_requirements: *id001
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: test-spec
|
30
|
+
prerelease: false
|
31
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
32
|
+
none: false
|
33
|
+
requirements:
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 0.10.0
|
37
|
+
type: :development
|
38
|
+
version_requirements: *id002
|
39
|
+
- !ruby/object:Gem::Dependency
|
40
|
+
name: mocha
|
41
|
+
prerelease: false
|
42
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.9.11
|
48
|
+
type: :development
|
49
|
+
version_requirements: *id003
|
54
50
|
description: A simple tool for tracking vendor branches in git.
|
55
51
|
email: evil@che.lu
|
56
52
|
executables:
|
57
|
-
- braid
|
53
|
+
- braid
|
58
54
|
extensions: []
|
59
55
|
|
60
56
|
extra_rdoc_files: []
|
61
57
|
|
62
58
|
files:
|
63
|
-
-
|
64
|
-
-
|
65
|
-
-
|
66
|
-
-
|
67
|
-
-
|
68
|
-
-
|
69
|
-
-
|
70
|
-
- lib/braid
|
71
|
-
- lib/braid/
|
72
|
-
- lib/braid/
|
73
|
-
- lib/braid/
|
74
|
-
- lib/braid/
|
75
|
-
- lib/braid.rb
|
76
|
-
- lib/
|
77
|
-
-
|
78
|
-
-
|
79
|
-
-
|
80
|
-
-
|
81
|
-
-
|
82
|
-
-
|
83
|
-
-
|
84
|
-
- test/
|
85
|
-
- test/
|
86
|
-
- test/fixtures/
|
87
|
-
- test/
|
88
|
-
- test/
|
89
|
-
- test/
|
90
|
-
- test/
|
91
|
-
- test/
|
92
|
-
- test/
|
59
|
+
- .gitignore
|
60
|
+
- Gemfile
|
61
|
+
- LICENSE
|
62
|
+
- README.textile
|
63
|
+
- Rakefile
|
64
|
+
- bin/braid
|
65
|
+
- braid.gemspec
|
66
|
+
- lib/braid.rb
|
67
|
+
- lib/braid/command.rb
|
68
|
+
- lib/braid/commands/add.rb
|
69
|
+
- lib/braid/commands/diff.rb
|
70
|
+
- lib/braid/commands/list.rb
|
71
|
+
- lib/braid/commands/push.rb
|
72
|
+
- lib/braid/commands/remove.rb
|
73
|
+
- lib/braid/commands/setup.rb
|
74
|
+
- lib/braid/commands/update.rb
|
75
|
+
- lib/braid/config.rb
|
76
|
+
- lib/braid/mirror.rb
|
77
|
+
- lib/braid/operations.rb
|
78
|
+
- lib/braid/version.rb
|
79
|
+
- lib/core_ext.rb
|
80
|
+
- test/braid_test.rb
|
81
|
+
- test/config_test.rb
|
82
|
+
- test/fixtures/shiny/README
|
83
|
+
- test/fixtures/skit1.1/layouts/layout.liquid
|
84
|
+
- test/fixtures/skit1.2/layouts/layout.liquid
|
85
|
+
- test/fixtures/skit1/layouts/layout.liquid
|
86
|
+
- test/fixtures/skit1/preview.png
|
87
|
+
- test/integration/adding_test.rb
|
88
|
+
- test/integration/updating_test.rb
|
89
|
+
- test/integration_helper.rb
|
90
|
+
- test/mirror_test.rb
|
91
|
+
- test/operations_test.rb
|
92
|
+
- test/test_helper.rb
|
93
93
|
has_rdoc: true
|
94
94
|
homepage: http://evil.che.lu/projects/braid
|
95
95
|
licenses: []
|
96
96
|
|
97
97
|
post_install_message:
|
98
98
|
rdoc_options:
|
99
|
-
- --line-numbers
|
100
|
-
- --inline-source
|
101
|
-
- --title
|
102
|
-
- braid
|
103
|
-
- --main
|
99
|
+
- --line-numbers
|
100
|
+
- --inline-source
|
101
|
+
- --title
|
102
|
+
- braid
|
103
|
+
- --main
|
104
104
|
require_paths:
|
105
|
-
- lib
|
105
|
+
- lib
|
106
106
|
required_ruby_version: !ruby/object:Gem::Requirement
|
107
107
|
none: false
|
108
108
|
requirements:
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
segments:
|
113
|
-
- 0
|
114
|
-
version: "0"
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: "0"
|
115
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
113
|
none: false
|
117
114
|
requirements:
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
segments:
|
122
|
-
- 0
|
123
|
-
version: "0"
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: "0"
|
124
118
|
requirements: []
|
125
119
|
|
126
120
|
rubyforge_project: braid
|
127
|
-
rubygems_version: 1.
|
121
|
+
rubygems_version: 1.5.1
|
128
122
|
signing_key:
|
129
|
-
specification_version:
|
123
|
+
specification_version: 3
|
130
124
|
summary: A simple tool for tracking vendor branches in git.
|
131
|
-
test_files:
|
132
|
-
|
125
|
+
test_files:
|
126
|
+
- test/braid_test.rb
|
127
|
+
- test/config_test.rb
|
128
|
+
- test/fixtures/shiny/README
|
129
|
+
- test/fixtures/skit1.1/layouts/layout.liquid
|
130
|
+
- test/fixtures/skit1.2/layouts/layout.liquid
|
131
|
+
- test/fixtures/skit1/layouts/layout.liquid
|
132
|
+
- test/fixtures/skit1/preview.png
|
133
|
+
- test/integration/adding_test.rb
|
134
|
+
- test/integration/updating_test.rb
|
135
|
+
- test/integration_helper.rb
|
136
|
+
- test/mirror_test.rb
|
137
|
+
- test/operations_test.rb
|
138
|
+
- test/test_helper.rb
|