braid 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,3 +1,6 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  gemspec
4
+
5
+ gem 'rake'
6
+
@@ -0,0 +1,115 @@
1
+ # Braid
2
+
3
+ Braid is a simple tool to help track git and svn vendor branches in a git repository.
4
+
5
+ The project homepage is [here](http://github.com/evilchelu/braid/wikis/home).
6
+
7
+ ## Requirements
8
+
9
+ * git 1.6+ (and git-svn if you want to mirror svn repositories)
10
+ * main >= 4.2.0
11
+ * open4 >= 1.0.1 (unless using jruby)
12
+
13
+ ## Installing using rubygems - official releases
14
+
15
+ gem install braid
16
+
17
+ ## Installing from source
18
+
19
+ git clone git://github.com/evilchelu/braid.git
20
+ cd braid
21
+ bundle install
22
+ rake install # possibly requiring sudo
23
+
24
+ ## Quick usage - ruby project
25
+
26
+ Let's assume we're writing something like gitnub that needs grit in lib/grit. Initialize the repo (nothing braid related here):
27
+
28
+ git init gritty
29
+ cd gritty
30
+ touch README
31
+ git add README
32
+ git commit -m "initial commit"
33
+
34
+ Now let's vendor grit:
35
+
36
+ braid add git://github.com/mojombo/grit.git lib/grit
37
+
38
+ And you're done! Braid vendored grit into lib/grit. Feel free to inspect the changes with git log or git show.
39
+
40
+ If further down the line, you want to bring new changes from grit in your repository, just update the mirror:
41
+
42
+ braid update lib/grit
43
+
44
+ ## Quick usage - rails project
45
+
46
+ Let's assume you want to start a new rails app called shiny. Initialize the repo (nothing braid related here):
47
+
48
+ git init shiny
49
+ cd shiny
50
+ touch README
51
+ git add README
52
+ git commit -m "initial commit"
53
+
54
+ Vendor rails (this might take a while because the rails repo is huge!):
55
+
56
+ braid add git://github.com/rails/rails.git vendor/rails
57
+
58
+ Create your new rails app (nothing braid related here):
59
+
60
+ ruby vendor/rails/railties/bin/rails .
61
+ git add .
62
+ git commit -m "rails ."
63
+
64
+ Add any plugins you might need:
65
+
66
+ braid add git://github.com/thoughtbot/shoulda.git -p
67
+ braid add git://github.com/thoughtbot/factory_girl.git -p
68
+ braid add git://github.com/mbleigh/subdomain-fu.git -p
69
+
70
+ And you're done! Braid vendored rails and your plugins. Feel free to inspect the changes with git log or git show.
71
+
72
+ If further down the line, you want to bring new changes from rails in your repository, just update the mirror:
73
+
74
+ braid update vendor/rails
75
+
76
+ Or, if you want all mirrors updated:
77
+
78
+ braid update
79
+
80
+ ## More usage
81
+
82
+ Use the built in help system to find out about all commands and options:
83
+
84
+ braid help
85
+ braid help add # or braid add --help
86
+
87
+ You may also want to read [Usage and examples](http://github.com/evilchelu/braid/wikis/usage-and-examples).
88
+
89
+ ## Troubleshooting
90
+
91
+ Check [Troubleshooting](http://github.com/evilchelu/braid/wikis/troubleshooting) if you're having issues.
92
+
93
+ ## Contributing
94
+
95
+ We appreciate any patches, error reports and usage ideas you may have. Please submit a lighthouse ticket or start a thread on the mailing list.
96
+
97
+ Bugs and feature requests: [braid project on lighthouse](http://evilchelu.lighthouseapp.com/projects/10600-braid)
98
+
99
+ Discussions and community support: [braid-gem google group](http://groups.google.com/group/braid-gem)
100
+
101
+ ## Authors
102
+
103
+ * Cristi Balan (evilchelu)
104
+ * Norbert Crombach (norbert)
105
+
106
+ ## Contributors (alphabetically)
107
+
108
+ * Alan Harper
109
+ * Christoph Sturm
110
+ * Dennis Muhlestein
111
+ * Ferdinand Svehla
112
+ * Michael Klishin
113
+ * Roman Heinrich
114
+ * Travis Tilley
115
+ * Tyler Rick
data/bin/braid CHANGED
@@ -137,10 +137,11 @@ Main {
137
137
  Set up git and git-svn remotes.
138
138
  TXT
139
139
 
140
- mixin :optional_path, :option_verbose
140
+ mixin :optional_path, :option_verbose, :option_force
141
141
 
142
142
  run {
143
143
  Braid.verbose = verbose
144
+ Braid.force = force
144
145
  Braid::Command.run(:setup, path)
145
146
  }
146
147
  }
@@ -156,7 +157,10 @@ Main {
156
157
  mode(:list) {
157
158
  description 'Show all tracked mirrors (and if updates are available).'
158
159
 
160
+ mixin :option_verbose
161
+
159
162
  run {
163
+ Braid.verbose = verbose
160
164
  Braid::Command.run(:list)
161
165
  }
162
166
  }
@@ -239,6 +243,14 @@ Main {
239
243
  }
240
244
  }
241
245
 
246
+ mixin(:option_force) {
247
+ option(:force, :f) {
248
+ optional
249
+ desc 'force'
250
+ attr
251
+ }
252
+ }
253
+
242
254
  mixin(:option_keep_remote) {
243
255
  option(:keep) {
244
256
  optional
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
25
25
  s.has_rdoc = false
26
26
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "braid", "--main"]
27
27
 
28
- s.add_dependency(%q<main>, [">= 4.2.0"])
28
+ s.add_dependency(%q<main>, [">= 4.7.3"])
29
29
  s.add_dependency(%q<open4>, [">= 1.0.1"]) unless defined?(JRUBY_VERSION)
30
30
 
31
31
  s.add_development_dependency(%q<test-spec>, [">= 0.10.0"])
@@ -13,6 +13,14 @@ module Braid
13
13
  @verbose = !!new_value
14
14
  end
15
15
 
16
+ def self.force
17
+ @force || false
18
+ end
19
+
20
+ def self.force=(new_value)
21
+ @force = !!new_value
22
+ end
23
+
16
24
  def self.use_local_cache
17
25
  [nil, "true", "1"].include?(ENV["BRAID_USE_LOCAL_CACHE"])
18
26
  end
@@ -38,6 +38,10 @@ module Braid
38
38
  Braid.verbose
39
39
  end
40
40
 
41
+ def force?
42
+ Braid.force
43
+ end
44
+
41
45
  private
42
46
 
43
47
  def setup_remote(mirror)
@@ -34,7 +34,7 @@ module Braid
34
34
  msg "Cloning mirror with local changes."
35
35
  git.init
36
36
  git.fetch(source_dir)
37
- git.fetch(remote_url)
37
+ git.fetch(remote_url, "+refs/heads/#{mirror.branch}")
38
38
  git.checkout(base_revision)
39
39
  git.apply(diff)
40
40
  system("git commit -v")
@@ -18,8 +18,13 @@ module Braid
18
18
  mirror = config.get!(path)
19
19
 
20
20
  if git.remote_url(mirror.remote)
21
- msg "Setup: Mirror '#{mirror.path}' already has a remote. Reusing it." if verbose?
22
- return
21
+ if force?
22
+ msg "Setup: Mirror '#{mirror.path}' already has a remote. Replacing it (force)" if verbose?
23
+ git.remote_rm(mirror.remote)
24
+ else
25
+ msg "Setup: Mirror '#{mirror.path}' already has a remote. Reusing it." if verbose?
26
+ return
27
+ end
23
28
  end
24
29
 
25
30
  msg "Setup: Creating remote for '#{mirror.path}'."
@@ -47,7 +47,7 @@ module Braid
47
47
  path = "vendor/plugins/#{path}"
48
48
  end
49
49
 
50
- remote = "braid/#{path}".gsub("_", '-') # stupid git svn changes all _ to ., weird
50
+ remote = "#{branch}/braid/#{path}".gsub("_", '-') # stupid git svn changes all _ to ., weird
51
51
  squashed = !options["full"]
52
52
  branch = nil if type == "svn"
53
53
 
@@ -118,6 +118,14 @@ module Braid
118
118
  git_cache.path(url)
119
119
  end
120
120
 
121
+ def remote
122
+ if (attributes["remote"] && attributes["remote"] =~ /^braid\//)
123
+ attributes["remote"] = "#{branch}/#{attributes["remote"]}"
124
+ else
125
+ attributes["remote"]
126
+ end
127
+ end
128
+
121
129
  private
122
130
 
123
131
  def method_missing(name, *args)
@@ -1,3 +1,3 @@
1
1
  module Braid
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
metadata CHANGED
@@ -1,138 +1,178 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: braid
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 1
4
5
  prerelease:
5
- version: 0.7.0
6
+ segments:
7
+ - 0
8
+ - 7
9
+ - 1
10
+ version: 0.7.1
6
11
  platform: ruby
7
12
  authors:
8
- - Cristi Balan
9
- - Norbert Crombach
13
+ - Cristi Balan
14
+ - Norbert Crombach
10
15
  autorequire:
11
16
  bindir: bin
12
17
  cert_chain: []
13
18
 
14
- date: 2011-03-15 00:00:00 -04:00
15
- default_executable: braid
19
+ date: 2011-08-25 00:00:00 Z
16
20
  dependencies:
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
21
+ - !ruby/object:Gem::Dependency
22
+ name: main
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 37
30
+ segments:
31
+ - 4
32
+ - 7
33
+ - 3
34
+ version: 4.7.3
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: open4
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 21
46
+ segments:
47
+ - 1
48
+ - 0
49
+ - 1
50
+ version: 1.0.1
51
+ type: :runtime
52
+ version_requirements: *id002
53
+ - !ruby/object:Gem::Dependency
54
+ name: test-spec
55
+ prerelease: false
56
+ requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ hash: 55
62
+ segments:
63
+ - 0
64
+ - 10
65
+ - 0
66
+ version: 0.10.0
67
+ type: :development
68
+ version_requirements: *id003
69
+ - !ruby/object:Gem::Dependency
70
+ name: mocha
71
+ prerelease: false
72
+ requirement: &id004 !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ hash: 45
78
+ segments:
79
+ - 0
80
+ - 9
81
+ - 11
82
+ version: 0.9.11
83
+ type: :development
84
+ version_requirements: *id004
50
85
  description: A simple tool for tracking vendor branches in git.
51
86
  email: evil@che.lu
52
87
  executables:
53
- - braid
88
+ - braid
54
89
  extensions: []
55
90
 
56
91
  extra_rdoc_files: []
57
92
 
58
93
  files:
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
- has_rdoc: true
94
+ - .gitignore
95
+ - Gemfile
96
+ - LICENSE
97
+ - README.md
98
+ - Rakefile
99
+ - bin/braid
100
+ - braid.gemspec
101
+ - lib/braid.rb
102
+ - lib/braid/command.rb
103
+ - lib/braid/commands/add.rb
104
+ - lib/braid/commands/diff.rb
105
+ - lib/braid/commands/list.rb
106
+ - lib/braid/commands/push.rb
107
+ - lib/braid/commands/remove.rb
108
+ - lib/braid/commands/setup.rb
109
+ - lib/braid/commands/update.rb
110
+ - lib/braid/config.rb
111
+ - lib/braid/mirror.rb
112
+ - lib/braid/operations.rb
113
+ - lib/braid/version.rb
114
+ - lib/core_ext.rb
115
+ - test/braid_test.rb
116
+ - test/config_test.rb
117
+ - test/fixtures/shiny/README
118
+ - test/fixtures/skit1.1/layouts/layout.liquid
119
+ - test/fixtures/skit1.2/layouts/layout.liquid
120
+ - test/fixtures/skit1/layouts/layout.liquid
121
+ - test/fixtures/skit1/preview.png
122
+ - test/integration/adding_test.rb
123
+ - test/integration/updating_test.rb
124
+ - test/integration_helper.rb
125
+ - test/mirror_test.rb
126
+ - test/operations_test.rb
127
+ - test/test_helper.rb
94
128
  homepage: http://evil.che.lu/projects/braid
95
129
  licenses: []
96
130
 
97
131
  post_install_message:
98
132
  rdoc_options:
99
- - --line-numbers
100
- - --inline-source
101
- - --title
102
- - braid
103
- - --main
133
+ - --line-numbers
134
+ - --inline-source
135
+ - --title
136
+ - braid
137
+ - --main
104
138
  require_paths:
105
- - lib
139
+ - lib
106
140
  required_ruby_version: !ruby/object:Gem::Requirement
107
141
  none: false
108
142
  requirements:
109
- - - ">="
110
- - !ruby/object:Gem::Version
111
- version: "0"
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ hash: 3
146
+ segments:
147
+ - 0
148
+ version: "0"
112
149
  required_rubygems_version: !ruby/object:Gem::Requirement
113
150
  none: false
114
151
  requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: "0"
152
+ - - ">="
153
+ - !ruby/object:Gem::Version
154
+ hash: 3
155
+ segments:
156
+ - 0
157
+ version: "0"
118
158
  requirements: []
119
159
 
120
160
  rubyforge_project: braid
121
- rubygems_version: 1.5.1
161
+ rubygems_version: 1.8.9
122
162
  signing_key:
123
163
  specification_version: 3
124
164
  summary: A simple tool for tracking vendor branches in git.
125
165
  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
166
+ - test/braid_test.rb
167
+ - test/config_test.rb
168
+ - test/fixtures/shiny/README
169
+ - test/fixtures/skit1.1/layouts/layout.liquid
170
+ - test/fixtures/skit1.2/layouts/layout.liquid
171
+ - test/fixtures/skit1/layouts/layout.liquid
172
+ - test/fixtures/skit1/preview.png
173
+ - test/integration/adding_test.rb
174
+ - test/integration/updating_test.rb
175
+ - test/integration_helper.rb
176
+ - test/mirror_test.rb
177
+ - test/operations_test.rb
178
+ - test/test_helper.rb
@@ -1,115 +0,0 @@
1
- h1. Braid
2
-
3
- Braid is a simple tool to help track git and svn vendor branches in a git repository.
4
-
5
- The project homepage is at "http://github.com/evilchelu/braid/wikis/home":http://github.com/evilchelu/braid/wikis/home
6
-
7
- h2. Requirements
8
-
9
- * git 1.6+ (and git-svn if you want to mirror svn repositories)
10
- * main >= 4.2.0
11
- * open4 >= 1.0.1 (unless using jruby)
12
-
13
- h2. Installing using rubygems - official releases
14
-
15
- gem install braid
16
-
17
- h2. Installing from source
18
-
19
- git clone git://github.com/evilchelu/braid.git
20
- cd braid
21
- bundle install
22
- rake install # possibly requiring sudo
23
-
24
- h2. Quick usage - ruby project
25
-
26
- Let's assume we're writing something like gitnub that needs grit in lib/grit. Initialize the repo (nothing braid related here):
27
-
28
- git init gritty
29
- cd gritty
30
- touch README
31
- git add README
32
- git commit -m "initial commit"
33
-
34
- Now let's vendor grit:
35
-
36
- braid add git://github.com/mojombo/grit.git lib/grit
37
-
38
- And you're done! Braid vendored grit into lib/grit. Feel free to inspect the changes with git log or git show.
39
-
40
- If further down the line, you want to bring new changes from grit in your repository, just update the mirror:
41
-
42
- braid update lib/grit
43
-
44
- h2. Quick usage - rails project
45
-
46
- Let's assume you want to start a new rails app called shiny. Initialize the repo (nothing braid related here):
47
-
48
- git init shiny
49
- cd shiny
50
- touch README
51
- git add README
52
- git commit -m "initial commit"
53
-
54
- Vendor rails (this might take a while because the rails repo is huge!):
55
-
56
- braid add git://github.com/rails/rails.git vendor/rails
57
-
58
- Create your new rails app (nothing braid related here):
59
-
60
- ruby vendor/rails/railties/bin/rails .
61
- git add .
62
- git commit -m "rails ."
63
-
64
- Add any plugins you might need:
65
-
66
- braid add git://github.com/thoughtbot/shoulda.git -p
67
- braid add git://github.com/thoughtbot/factory_girl.git -p
68
- braid add git://github.com/mbleigh/subdomain-fu.git -p
69
-
70
- And you're done! Braid vendored rails and your plugins. Feel free to inspect the changes with git log or git show.
71
-
72
- If further down the line, you want to bring new changes from rails in your repository, just update the mirror:
73
-
74
- braid update vendor/rails
75
-
76
- Or, if you want all mirrors updated:
77
-
78
- braid update
79
-
80
- h2. More usage
81
-
82
- Use the built in help system to find out about all commands and options:
83
-
84
- braid help
85
- braid help add # or braid add --help
86
-
87
- You may also want to read "Usage and examples":http://github.com/evilchelu/braid/wikis/usage-and-examples.
88
-
89
- h2. Troubleshooting
90
-
91
- Check "Troubleshooting":http://github.com/evilchelu/braid/wikis/troubleshooting if you're having issues.
92
-
93
- h2. Contributing
94
-
95
- We appreciate any patches, error reports and usage ideas you may have. Please submit a lighthouse ticket or start a thread on the mailing list.
96
-
97
- Bugs and feature requests: "*braid project on lighthouse*":http://evilchelu.lighthouseapp.com/projects/10600-braid
98
-
99
- Discussions and community support: "*braid-gem google group*":http://groups.google.com/group/braid-gem
100
-
101
- h2. Authors
102
-
103
- * Cristi Balan (evilchelu)
104
- * Norbert Crombach (norbert)
105
-
106
- h2. Contributors (alphabetically)
107
-
108
- * Alan Harper
109
- * Christoph Sturm
110
- * Dennis Muhlestein
111
- * Ferdinand Svehla
112
- * Michael Klishin
113
- * Roman Heinrich
114
- * Travis Tilley
115
- * Tyler Rick