evilchelu-braid 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +4 -0
- data/License.txt +20 -0
- data/Manifest.txt +33 -0
- data/README.txt +49 -0
- data/Rakefile +4 -0
- data/bin/braid +218 -0
- data/braid.gemspec +26 -0
- data/config/hoe.rb +68 -0
- data/config/requirements.rb +17 -0
- data/lib/braid/command.rb +53 -0
- data/lib/braid/commands/add.rb +53 -0
- data/lib/braid/commands/diff.rb +10 -0
- data/lib/braid/commands/remove.rb +25 -0
- data/lib/braid/commands/setup.rb +40 -0
- data/lib/braid/commands/update.rb +77 -0
- data/lib/braid/config.rb +148 -0
- data/lib/braid/exceptions.rb +31 -0
- data/lib/braid/operations.rb +266 -0
- data/lib/braid/version.rb +9 -0
- data/lib/braid.rb +27 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/setup.rb +1585 -0
- data/spec/braid_spec.rb +7 -0
- data/spec/config_spec.rb +117 -0
- data/spec/operations_spec.rb +21 -0
- data/spec/spec.opts +3 -0
- data/spec/spec_helper.rb +11 -0
- data/tasks/deployment.rake +27 -0
- data/tasks/environment.rake +7 -0
- data/tasks/rspec.rake +32 -0
- data/tasks/website.rake +9 -0
- metadata +108 -0
data/History.txt
ADDED
data/License.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2007 Cristi Balan
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Manifest.txt
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
History.txt
|
2
|
+
License.txt
|
3
|
+
Manifest.txt
|
4
|
+
README.txt
|
5
|
+
Rakefile
|
6
|
+
TODO.txt
|
7
|
+
bin/braid
|
8
|
+
config/hoe.rb
|
9
|
+
config/requirements.rb
|
10
|
+
lib/braid.rb
|
11
|
+
lib/braid/command.rb
|
12
|
+
lib/braid/commands/add.rb
|
13
|
+
lib/braid/commands/diff.rb
|
14
|
+
lib/braid/commands/remove.rb
|
15
|
+
lib/braid/commands/setup.rb
|
16
|
+
lib/braid/commands/update.rb
|
17
|
+
lib/braid/config.rb
|
18
|
+
lib/braid/exceptions.rb
|
19
|
+
lib/braid/operations.rb
|
20
|
+
lib/braid/version.rb
|
21
|
+
braid.gemspec
|
22
|
+
script/destroy
|
23
|
+
script/generate
|
24
|
+
setup.rb
|
25
|
+
spec/braid_spec.rb
|
26
|
+
spec/config_spec.rb
|
27
|
+
spec/operations_spec.rb
|
28
|
+
spec/spec.opts
|
29
|
+
spec/spec_helper.rb
|
30
|
+
tasks/deployment.rake
|
31
|
+
tasks/environment.rake
|
32
|
+
tasks/rspec.rake
|
33
|
+
tasks/website.rake
|
data/README.txt
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
Braid is a simple tool to help track git and svn vendor branches in a git
|
2
|
+
repository.
|
3
|
+
|
4
|
+
In purpose, it's similar to piston, but it's especially built on top of git
|
5
|
+
commands. This allows better integration with git and easier management of
|
6
|
+
merges.
|
7
|
+
|
8
|
+
The braid homepage is:http://evil.che.lu/projects/braid.
|
9
|
+
|
10
|
+
Braid is "hosted on github":http://github.com/evilchelu/braid.
|
11
|
+
|
12
|
+
*NOTE:* You will need at least git 1.5.4.5+ to run braid. You'll also need the
|
13
|
+
open4 and main gems.
|
14
|
+
|
15
|
+
h3. Install with rubygems
|
16
|
+
|
17
|
+
gem sources -a http://gems.github.com/ # only need to do this once
|
18
|
+
gem install evilchelu-braid
|
19
|
+
|
20
|
+
h3. Get it from the git repository
|
21
|
+
|
22
|
+
Get a clone of the git repository using:
|
23
|
+
|
24
|
+
git clone git://github.com/evilchelu/braid.git
|
25
|
+
cd braid
|
26
|
+
rake install_gem
|
27
|
+
braid --help # see usage
|
28
|
+
|
29
|
+
h3. Usage
|
30
|
+
|
31
|
+
braid help
|
32
|
+
braid help COMMANDNAME
|
33
|
+
|
34
|
+
For more usage examples, documentation, feature requests and bug reporting,
|
35
|
+
check out the "braid wiki":http://github.com/evilchelu/braid/wikis.
|
36
|
+
|
37
|
+
h3. Contributing
|
38
|
+
|
39
|
+
If you want to send a patch in, please fork the project on github, commit your
|
40
|
+
changes and send a pull request.
|
41
|
+
|
42
|
+
h3. Mad props
|
43
|
+
|
44
|
+
Braid used to be quite lame before "Norbert Crombach":http://primetheory.org/
|
45
|
+
("github":http://github.com/norbert) resuscitated it by contribuing a bunch of
|
46
|
+
code.
|
47
|
+
|
48
|
+
He rocks! Go buy him a beer.
|
49
|
+
|
data/Rakefile
ADDED
data/bin/braid
ADDED
@@ -0,0 +1,218 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib"))
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubygems'
|
6
|
+
rescue LoadError
|
7
|
+
end
|
8
|
+
require 'main'
|
9
|
+
|
10
|
+
require 'braid'
|
11
|
+
|
12
|
+
Home = File.expand_path(ENV['HOME'] || '~')
|
13
|
+
|
14
|
+
# mostly blantantly stolen from ara's punch script
|
15
|
+
# main kicks ass!
|
16
|
+
Main {
|
17
|
+
description <<-TXT
|
18
|
+
braid is a simple tool to help track git or svn repositories inside a git repository.
|
19
|
+
|
20
|
+
Run 'braid help commandname' for more details.
|
21
|
+
|
22
|
+
All operations will be executed in the braid/track branch.
|
23
|
+
You can then merge back or cherry-pick changes.
|
24
|
+
TXT
|
25
|
+
|
26
|
+
mode(:add) {
|
27
|
+
description <<-TXT
|
28
|
+
Add a new mirror to be tracked.
|
29
|
+
|
30
|
+
* adds metadata about the mirror to .braids
|
31
|
+
* adds the git or git svn remotes to .git/config
|
32
|
+
* fetches and merges remote code into given directory
|
33
|
+
|
34
|
+
--type defaults:
|
35
|
+
|
36
|
+
* svn://path # => svn
|
37
|
+
* git://path # => git
|
38
|
+
* http://path/trunk # => svn
|
39
|
+
* http://path.git # => git
|
40
|
+
|
41
|
+
Name defaults:
|
42
|
+
|
43
|
+
* remote/path # => path
|
44
|
+
* remote/path/trunk # => path
|
45
|
+
* remote/path.git # => path
|
46
|
+
TXT
|
47
|
+
|
48
|
+
examples <<-TXT
|
49
|
+
. braid add svn://remote/path
|
50
|
+
. braid add svn://remote/path local/dir
|
51
|
+
. braid add git://remote/path local/dir
|
52
|
+
. braid add http://remote/path.git local/dir
|
53
|
+
. braid add http://remote/path --type git local/dir
|
54
|
+
. braid add svn://remote/path --branch notmaster
|
55
|
+
TXT
|
56
|
+
|
57
|
+
mixin :argument_remote, :option_type, :optional_mirror, :option_branch, :option_rails_plugin, :option_revision, :option_full
|
58
|
+
|
59
|
+
run {
|
60
|
+
Braid::Command.run(:add, remote, { "type" => type, "mirror" => mirror, "branch" => branch, "rails_plugin" => rails_plugin, "revision" => revision, "full" => full })
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
mode(:update) {
|
65
|
+
description <<-TXT
|
66
|
+
Update a braid mirror.
|
67
|
+
|
68
|
+
* get new changes from remote
|
69
|
+
* always creates a merge commit
|
70
|
+
* updates metadata in .braids when revisions are changed
|
71
|
+
|
72
|
+
Defaults to updating all unlocked mirrors if none is specified.
|
73
|
+
TXT
|
74
|
+
|
75
|
+
examples <<-TXT
|
76
|
+
. braid update
|
77
|
+
. braid update local/dir
|
78
|
+
TXT
|
79
|
+
|
80
|
+
mixin :optional_mirror, :option_revision, :option_head
|
81
|
+
|
82
|
+
run {
|
83
|
+
Braid::Command.run(:update, mirror, { "revision" => revision, "head" => head })
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
mode(:remove) {
|
88
|
+
description <<-TXT
|
89
|
+
Remove a mirror.
|
90
|
+
|
91
|
+
* removes metadata from .braids
|
92
|
+
* removes the local directory and commits the removal
|
93
|
+
* does NOT remove the git and git svn remotes in case you still need them around
|
94
|
+
TXT
|
95
|
+
|
96
|
+
examples <<-TXT
|
97
|
+
. braid remove local/dir
|
98
|
+
TXT
|
99
|
+
|
100
|
+
mixin :argument_mirror
|
101
|
+
|
102
|
+
run {
|
103
|
+
Braid::Command.run(:remove, mirror)
|
104
|
+
}
|
105
|
+
}
|
106
|
+
|
107
|
+
mode(:setup) {
|
108
|
+
description <<-TXT
|
109
|
+
Set up git and git-svn remotes.
|
110
|
+
TXT
|
111
|
+
|
112
|
+
examples <<-TXT
|
113
|
+
. braid setup local/dir
|
114
|
+
TXT
|
115
|
+
|
116
|
+
mixin :optional_mirror
|
117
|
+
|
118
|
+
run {
|
119
|
+
Braid::Command.run(:setup, mirror)
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
mode(:diff) {
|
124
|
+
description <<-TXT
|
125
|
+
Show diff between '#{Braid::WORK_BRANCH}' and HEAD.
|
126
|
+
TXT
|
127
|
+
|
128
|
+
examples <<-TXT
|
129
|
+
. braid diff local/dir
|
130
|
+
TXT
|
131
|
+
|
132
|
+
mixin :argument_mirror
|
133
|
+
|
134
|
+
run {
|
135
|
+
Braid::Command.run(:diff, mirror)
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
mode(:version) {
|
140
|
+
description 'Show braid version.'
|
141
|
+
|
142
|
+
run {
|
143
|
+
puts "braid #{Braid::VERSION::STRING}"
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
mixin(:argument_mirror) {
|
148
|
+
argument(:mirror) {
|
149
|
+
attr
|
150
|
+
}
|
151
|
+
}
|
152
|
+
|
153
|
+
mixin(:optional_mirror) {
|
154
|
+
argument(:mirror) {
|
155
|
+
optional
|
156
|
+
attr
|
157
|
+
}
|
158
|
+
}
|
159
|
+
|
160
|
+
mixin(:argument_remote) {
|
161
|
+
argument(:remote) {
|
162
|
+
attr
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
mixin(:option_type) {
|
167
|
+
option(:type, :t) {
|
168
|
+
optional
|
169
|
+
argument :required
|
170
|
+
desc 'mirror type'
|
171
|
+
attr
|
172
|
+
}
|
173
|
+
}
|
174
|
+
|
175
|
+
mixin(:option_branch) {
|
176
|
+
option(:branch, :b) {
|
177
|
+
optional
|
178
|
+
argument :required
|
179
|
+
desc 'remote branch name'
|
180
|
+
attr
|
181
|
+
}
|
182
|
+
}
|
183
|
+
|
184
|
+
mixin(:option_rails_plugin) {
|
185
|
+
option(:rails_plugin, :p) {
|
186
|
+
optional
|
187
|
+
desc 'added mirror is a Rails plugin'
|
188
|
+
attr
|
189
|
+
}
|
190
|
+
}
|
191
|
+
|
192
|
+
mixin(:option_revision) {
|
193
|
+
option(:revision, :r) {
|
194
|
+
optional
|
195
|
+
argument :required
|
196
|
+
desc 'revision to track'
|
197
|
+
attr
|
198
|
+
}
|
199
|
+
}
|
200
|
+
|
201
|
+
mixin(:option_head) {
|
202
|
+
option(:head) {
|
203
|
+
optional
|
204
|
+
desc 'mirror head'
|
205
|
+
attr
|
206
|
+
}
|
207
|
+
}
|
208
|
+
|
209
|
+
mixin(:option_full) {
|
210
|
+
option(:full) {
|
211
|
+
optional
|
212
|
+
desc 'include mirror history' # FIXME
|
213
|
+
attr
|
214
|
+
}
|
215
|
+
}
|
216
|
+
|
217
|
+
run { help! }
|
218
|
+
}
|
data/braid.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = %q{braid}
|
3
|
+
s.version = "0.3.5"
|
4
|
+
|
5
|
+
s.specification_version = 2 if s.respond_to? :specification_version=
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Cristi Balan", "Norbert Crombach"]
|
9
|
+
s.date = %q{2008-04-29}
|
10
|
+
s.default_executable = %q{braid}
|
11
|
+
s.description = %q{Braid is a simple tool to help track git and svn vendor branches in a git repository}
|
12
|
+
s.email = %q{evil@che.lu}
|
13
|
+
s.executables = ["braid"]
|
14
|
+
s.extra_rdoc_files = ["History.txt", "License.txt", "Manifest.txt", "README.txt", "TODO.txt"]
|
15
|
+
s.files = ["History.txt", "License.txt", "Manifest.txt", "README.txt", "Rakefile", "TODO.txt", "bin/braid", "config/hoe.rb", "config/requirements.rb", "lib/braid.rb", "lib/braid/command.rb", "lib/braid/commands/add.rb", "lib/braid/commands/diff.rb", "lib/braid/commands/remove.rb", "lib/braid/commands/setup.rb", "lib/braid/commands/update.rb", "lib/braid/config.rb", "lib/braid/exceptions.rb", "lib/braid/operations.rb", "lib/braid/version.rb", "braid.gemspec", "script/destroy", "script/generate", "setup.rb", "spec/braid_spec.rb", "spec/config_spec.rb", "spec/operations_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks/deployment.rake", "tasks/environment.rake", "tasks/rspec.rake", "tasks/website.rake"]
|
16
|
+
s.has_rdoc = true
|
17
|
+
s.homepage = %q{http://evil.che.lu/projects/braid}
|
18
|
+
s.rdoc_options = ["--main", "README.txt"]
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
s.rubyforge_project = %q{braid}
|
21
|
+
s.rubygems_version = %q{1.1.0}
|
22
|
+
s.summary = %q{Braid is a simple tool to help track git and svn vendor branches in a git repository}
|
23
|
+
|
24
|
+
s.add_dependency(%q<main>, [">= 2.8.0"])
|
25
|
+
s.add_dependency(%q<open4>, [">= 0.9.6"])
|
26
|
+
end
|
data/config/hoe.rb
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
require 'braid/version'
|
2
|
+
|
3
|
+
AUTHOR = ["Cristi Balan", "Norbert Crombach"]
|
4
|
+
EMAIL = "evil@che.lu"
|
5
|
+
DESCRIPTION = "Braid is a simple tool to help track git and svn vendor branches in a git repository"
|
6
|
+
GEM_NAME = 'braid' # what ppl will type to install your gem
|
7
|
+
RUBYFORGE_PROJECT = 'braid' # The unix name for your project
|
8
|
+
HOMEPATH = "http://evil.che.lu/projects/braid"
|
9
|
+
DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
|
10
|
+
|
11
|
+
@config_file = "~/.rubyforge/user-config.yml"
|
12
|
+
@config = nil
|
13
|
+
RUBYFORGE_USERNAME = "unknown"
|
14
|
+
def rubyforge_username
|
15
|
+
unless @config
|
16
|
+
begin
|
17
|
+
@config = YAML.load(File.read(File.expand_path(@config_file)))
|
18
|
+
rescue
|
19
|
+
puts <<-EOS
|
20
|
+
ERROR: No rubyforge config file found: #{@config_file}"
|
21
|
+
Run 'rubyforge setup' to prepare your env for access to Rubyforge
|
22
|
+
- See http://newgem.rubyforge.org/rubyforge.html for more details
|
23
|
+
EOS
|
24
|
+
exit
|
25
|
+
end
|
26
|
+
end
|
27
|
+
RUBYFORGE_USERNAME.replace @config["username"]
|
28
|
+
end
|
29
|
+
|
30
|
+
|
31
|
+
REV = nil
|
32
|
+
VERS = Braid::VERSION::STRING + (REV ? ".#{REV}" : "")
|
33
|
+
RDOC_OPTS = ['--quiet', '--title', 'braid documentation',
|
34
|
+
"--opname", "index.html",
|
35
|
+
"--line-numbers",
|
36
|
+
"--main", "README",
|
37
|
+
"--inline-source"]
|
38
|
+
|
39
|
+
class Hoe
|
40
|
+
def extra_deps
|
41
|
+
@extra_deps.reject! { |x| Array(x).first == 'hoe' }
|
42
|
+
@extra_deps
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# Generate all the Rake tasks
|
47
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
48
|
+
hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
49
|
+
p.author = AUTHOR
|
50
|
+
p.description = DESCRIPTION
|
51
|
+
p.email = EMAIL
|
52
|
+
p.summary = DESCRIPTION
|
53
|
+
p.url = HOMEPATH
|
54
|
+
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
|
55
|
+
p.test_globs = ["test/**/test_*.rb"]
|
56
|
+
p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
|
57
|
+
|
58
|
+
# == Optional
|
59
|
+
p.changes = p.paragraphs_of("History.txt", 0..1).join("\\n\\n")
|
60
|
+
p.extra_deps = [ ['main', '>=2.8.0'], ['open4', '>=0.9.6'] ]
|
61
|
+
|
62
|
+
#p.spec_extras = {} # A hash of extra values to set in the gemspec.
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
|
67
|
+
PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
|
68
|
+
hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
include FileUtils
|
3
|
+
|
4
|
+
require 'rubygems'
|
5
|
+
%w[rake hoe newgem rubigen main open4].each do |req_gem|
|
6
|
+
begin
|
7
|
+
require req_gem
|
8
|
+
rescue LoadError
|
9
|
+
puts "This Rakefile requires the '#{req_gem}' RubyGem."
|
10
|
+
puts "Installation: gem install #{req_gem} -y"
|
11
|
+
exit
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
|
16
|
+
|
17
|
+
require 'braid'
|