piston 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 2.0.4 2009-07-20
2
+
3
+ * Enable git support to work with more versions of Git by specifying th
4
+ remote's name when checking out the branch.
5
+
1
6
  == 2.0.2 2009-04-07
2
7
 
3
8
  * Fixed a bug in the command line parser that was interpreting status as statu.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :minor: 0
3
- :patch: 3
2
+ :patch: 4
4
3
  :major: 2
4
+ :minor: 0
@@ -51,6 +51,20 @@ Feature: Import remote repository into a Git repository
51
51
  And a remote Subversion project named libcalc using the classic layout
52
52
  And a file named libcalc.rb with content "a\nb\nc" in remote libcalc project
53
53
  When I import libcalc/trunk into vendor/libcalc
54
- And I should see a successful import message from Piston
54
+ Then I should see a successful import message from Piston
55
55
  And I should find a vendor/libcalc folder
56
56
  And I should find a vendor/libcalc/libcalc.rb file
57
+
58
+ Scenario: Import from a branch
59
+ Given a newly created Git project
60
+ And a remote Git project named rails
61
+ And a file named rails.rb with content "a\n" in remote rails project
62
+ And a branch on the rails project named "2-3-stable"
63
+ And a file named 2-3-README with content "Rails 2.3\n" in remote rails project
64
+ When I import the "2-3-stable" branch of rails
65
+ Then I should see "2-3-stable"
66
+ And I should see a successful import message from Piston
67
+ And I should find a rails folder
68
+ And I should find a rails/rails.rb file
69
+ And I should find a rails/2-3-README file
70
+ And I should find a rails/.piston.yml file
@@ -172,7 +172,7 @@ Then /^I should see "([^"]+)"(\s+debug)?$/ do |regexp, debug|
172
172
  @stdout.should =~ re
173
173
  end
174
174
 
175
- Then /^I should( not)? find a ([\w+\/]+) folder$/ do |not_find, name|
175
+ Then /^I should( not)? find a ([-\w+\/]+) folder$/ do |not_find, name|
176
176
  if not_find then
177
177
  File.exist?(@wcdir + name).should_not be_true
178
178
  File.directory?(@wcdir + name).should_not be_true
@@ -182,7 +182,7 @@ Then /^I should( not)? find a ([\w+\/]+) folder$/ do |not_find, name|
182
182
  end
183
183
  end
184
184
 
185
- Then /^I should (not )?find a ([.\w+\/]+) file$/ do |not_find, name|
185
+ Then /^I should (not )?find a ([-.\w+\/]+) file$/ do |not_find, name|
186
186
  if not_find then
187
187
  File.exist?(@wcdir + name).should be_false
188
188
  File.file?(@wcdir + name).should be_false
@@ -192,7 +192,7 @@ Then /^I should (not )?find a ([.\w+\/]+) file$/ do |not_find, name|
192
192
  end
193
193
  end
194
194
 
195
- Then /^I should find "([^"]+)" in ([\w\/.]+)$/ do |content, path|
195
+ Then /^I should find "([^"]+)" in ([-\w\/.]+)$/ do |content, path|
196
196
  File.read(@wcdir + path).should =~ Regexp.new(content, Regexp::MULTILINE + Regexp::IGNORECASE)
197
197
  end
198
198
 
@@ -211,3 +211,25 @@ Then /^I should see a successful update message from Piston$/ do
211
211
  @stdout.should =~ /Updated .*\/libcalc to revision \d+/
212
212
  end
213
213
  end
214
+
215
+ Given /^a branch on the ([^ ]+) project named "([^\"]*)"$/ do |project, branch|
216
+ Dir.chdir(@remotewcdir) do
217
+ if (@remotewcdir + ".git").directory? then
218
+ git :checkout, "-b", branch
219
+ @stdout = git :branch
220
+ @stdout.should =~ /^\*\s+#{branch}/
221
+ else
222
+ pending
223
+ end
224
+ end
225
+ end
226
+
227
+ When /^I import the "([^\"]+)" branch of ([^ ]+)(?: into ([\w\/]+))?$/ do |branch, project, into|
228
+ Dir.chdir(@wcdir) do
229
+ cmd = "#{Tmpdir.piston} import --verbose 5 --commit #{branch} file://#{@remotereposdir} 2>&1"
230
+ cmd << " #{into}" if into
231
+ STDERR.puts cmd.inspect if $DEBUG
232
+ @stdout = `#{cmd}`
233
+ STDERR.puts @stdout if $DEBUG
234
+ end
235
+ end
@@ -49,6 +49,8 @@ module Piston
49
49
  super
50
50
  git(:clone, repository.url, @dir)
51
51
  Dir.chdir(@dir) do
52
+ target = commit
53
+ target = "origin/#{target}" unless target.include?("/") || target =~ /^[a-f\d]+$/i
52
54
  git(:checkout, "-b", branch_name, commit)
53
55
  response = git(:log, "-n", "1")
54
56
  @sha1 = $1 if response =~ /commit\s+([a-f\d]{40})/i
@@ -55,18 +55,19 @@ module Piston
55
55
  end
56
56
 
57
57
  def after_remember(path)
58
- Dir.chdir(self.path) { git(:add, path.relative_path_from(self.path)) }
58
+ Dir.chdir(self.path) { git(:add, "-f", path.relative_path_from(self.path)) }
59
59
  end
60
60
 
61
61
  def finalize
62
- Dir.chdir(path) { git(:add, ".") }
62
+ Dir.chdir(path) { git(:add, "-f", ".") }
63
63
  end
64
64
 
65
65
  def add(added)
66
66
  Dir.chdir(path) do
67
67
  added.each do |item|
68
- item.mkdir unless item.exist?
69
- git(:add, item)
68
+ target = path + item
69
+ target.mkdir unless target.exist?
70
+ git(:add, "-f", item)
70
71
  end
71
72
  end
72
73
  end
data/piston.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{piston}
5
- s.version = "2.0.3"
5
+ s.version = "2.0.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Francois Beausoleil"]
9
- s.date = %q{2009-07-17}
9
+ s.date = %q{2009-07-20}
10
10
  s.default_executable = %q{piston}
11
11
  s.description = %q{Piston makes it easy to merge vendor branches into your own repository, without worrying about which revisions were grabbed or not. Piston will also keep your local changes in addition to the remote changes.}
12
12
  s.email = %q{francois@teksol.info}
@@ -18,7 +18,6 @@ Gem::Specification.new do |s|
18
18
  ".gitignore",
19
19
  "History.txt",
20
20
  "License.txt",
21
- "Manifest.txt",
22
21
  "README.txt",
23
22
  "Rakefile",
24
23
  "TODO",
@@ -67,8 +66,6 @@ Gem::Specification.new do |s|
67
66
  "script/txt2html",
68
67
  "setup.rb",
69
68
  "tasks/environment.rake",
70
- "tasks/features.rake",
71
- "tasks/manifest.rake",
72
69
  "tasks/test.rake",
73
70
  "tasks/website.rake",
74
71
  "test/integration_helpers.rb",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: piston
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francois Beausoleil
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-07-17 00:00:00 -04:00
12
+ date: 2009-07-20 00:00:00 -04:00
13
13
  default_executable: piston
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -64,7 +64,6 @@ files:
64
64
  - .gitignore
65
65
  - History.txt
66
66
  - License.txt
67
- - Manifest.txt
68
67
  - README.txt
69
68
  - Rakefile
70
69
  - TODO
@@ -113,8 +112,6 @@ files:
113
112
  - script/txt2html
114
113
  - setup.rb
115
114
  - tasks/environment.rake
116
- - tasks/features.rake
117
- - tasks/manifest.rake
118
115
  - tasks/test.rake
119
116
  - tasks/website.rake
120
117
  - test/integration_helpers.rb
data/Manifest.txt DELETED
@@ -1,109 +0,0 @@
1
- .gitignore
2
- bin/piston
3
- config/hoe.rb
4
- config/requirements.rb
5
- features/import_to_git.feature
6
- features/import_to_svn.feature
7
- features/step_definitions/repository.rb
8
- features/support/env.rb
9
- features/support/svn.rb
10
- features/update_to_git.feature
11
- features/update_to_svn.feature
12
- History.txt
13
- lib/piston/cli.rb
14
- lib/piston/commands/base.rb
15
- lib/piston/commands/convert.rb
16
- lib/piston/commands/import.rb
17
- lib/piston/commands/info.rb
18
- lib/piston/commands/lock_unlock.rb
19
- lib/piston/commands/status.rb
20
- lib/piston/commands/update.rb
21
- lib/piston/commands/upgrade.rb
22
- lib/piston/commands.rb
23
- lib/piston/git/client.rb
24
- lib/piston/git/commit.rb
25
- lib/piston/git/repository.rb
26
- lib/piston/git/working_copy.rb
27
- lib/piston/git.rb
28
- lib/piston/repository.rb
29
- lib/piston/revision.rb
30
- lib/piston/svn/client.rb
31
- lib/piston/svn/repository.rb
32
- lib/piston/svn/revision.rb
33
- lib/piston/svn/working_copy.rb
34
- lib/piston/svn.rb
35
- lib/piston/version.rb
36
- lib/piston/working_copy.rb
37
- lib/piston.rb
38
- lib/subclass_responsibility_error.rb
39
- License.txt
40
- log/.gitignore
41
- Manifest.txt
42
- piston.gemspec
43
- Rakefile
44
- README.txt
45
- samples/common.rb
46
- samples/import_git_git.rb
47
- samples/import_git_svn.rb
48
- samples/import_svn_git.rb
49
- samples/import_svn_svn.rb
50
- script/destroy
51
- script/generate
52
- script/txt2html
53
- setup.rb
54
- tasks/deployment.rake
55
- tasks/environment.rake
56
- tasks/manifest.rake
57
- tasks/samples.rake
58
- tasks/test.rake
59
- tasks/website.rake
60
- test/integration/test_git_git.rb
61
- test/integration/test_git_svn.rb
62
- test/integration/test_import_svn_git.rb
63
- test/integration/test_svn_svn.rb
64
- test/integration_helpers.rb
65
- test/spec_suite.rb
66
- test/test_helper.rb
67
- test/unit/git/commit/test_checkout.rb
68
- test/unit/git/commit/test_each.rb
69
- test/unit/git/commit/test_rememberance.rb
70
- test/unit/git/commit/test_validation.rb
71
- test/unit/git/repository/test_at.rb
72
- test/unit/git/repository/test_basename.rb
73
- test/unit/git/repository/test_branchanme.rb
74
- test/unit/git/repository/test_guessing.rb
75
- test/unit/git/working_copy/test_copying.rb
76
- test/unit/git/working_copy/test_creation.rb
77
- test/unit/git/working_copy/test_existence.rb
78
- test/unit/git/working_copy/test_finalization.rb
79
- test/unit/git/working_copy/test_guessing.rb
80
- test/unit/git/working_copy/test_rememberance.rb
81
- test/unit/svn/repository/test_at.rb
82
- test/unit/svn/repository/test_basename.rb
83
- test/unit/svn/repository/test_guessing.rb
84
- test/unit/svn/revision/test_checkout.rb
85
- test/unit/svn/revision/test_each.rb
86
- test/unit/svn/revision/test_rememberance.rb
87
- test/unit/svn/revision/test_validation.rb
88
- test/unit/svn/working_copy/test_copying.rb
89
- test/unit/svn/working_copy/test_creation.rb
90
- test/unit/svn/working_copy/test_existence.rb
91
- test/unit/svn/working_copy/test_externals.rb
92
- test/unit/svn/working_copy/test_finalization.rb
93
- test/unit/svn/working_copy/test_guessing.rb
94
- test/unit/svn/working_copy/test_rememberance.rb
95
- test/unit/test_info.rb
96
- test/unit/test_lock_unlock.rb
97
- test/unit/test_repository.rb
98
- test/unit/test_revision.rb
99
- test/unit/working_copy/test_guessing.rb
100
- test/unit/working_copy/test_info.rb
101
- test/unit/working_copy/test_rememberance.rb
102
- test/unit/working_copy/test_validate.rb
103
- tmp/.gitignore
104
- TODO
105
- website/index.html
106
- website/index.txt
107
- website/javascripts/rounded_corners_lite.inc.js
108
- website/stylesheets/screen.css
109
- website/template.rhtml
data/tasks/features.rake DELETED
@@ -1,6 +0,0 @@
1
- require "cucumber/rake/task"
2
-
3
- Cucumber::Rake::Task.new do |t|
4
- t.cucumber_opts = "--no-source"
5
- t.feature_list = FileList["features/*.feature"]
6
- end
data/tasks/manifest.rake DELETED
@@ -1,4 +0,0 @@
1
- desc "Refreshes the manifest: use this instead of manifest:refresh"
2
- task :manifest do
3
- sh "find . -type f | grep -v ./.git/ | grep -v -e '\.log$' | sed -e 's!^\./!!' > Manifest.txt"
4
- end