piston 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +9 -0
- data/History.txt +4 -0
- data/Rakefile +25 -0
- data/TODO +6 -0
- data/VERSION.yml +2 -2
- data/features/import_to_git.feature +56 -0
- data/features/import_to_svn.feature +54 -0
- data/features/step_definitions/repository.rb +213 -0
- data/features/support/env.rb +27 -0
- data/features/support/svn.rb +23 -0
- data/features/update_to_git.feature +137 -0
- data/features/update_to_svn.feature +137 -0
- data/lib/piston/commands/lock.rb +14 -0
- data/lib/piston/commands/lock_unlock.rb +0 -5
- data/lib/piston/commands/unlock.rb +14 -0
- data/lib/piston/git/commit.rb +1 -0
- data/lib/piston/svn/revision.rb +1 -0
- data/log/.gitignore +0 -0
- data/piston.gemspec +184 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/script/txt2html +74 -0
- data/setup.rb +1585 -0
- data/tasks/environment.rake +7 -0
- data/tasks/features.rake +6 -0
- data/tasks/manifest.rake +4 -0
- data/tasks/test.rake +62 -0
- data/tasks/website.rake +20 -0
- metadata +75 -26
data/.gitignore
ADDED
data/History.txt
CHANGED
data/Rakefile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
Dir["tasks/**/*.rake"].each { |rake| load rake }
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'jeweler'
|
5
|
+
Jeweler::Tasks.new do |s|
|
6
|
+
s.name = "piston"
|
7
|
+
s.summary = "Ease your vendor branch management worries"
|
8
|
+
s.email = "francois@teksol.info"
|
9
|
+
s.homepage = "http://francois.github.com/piston"
|
10
|
+
s.description = "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."
|
11
|
+
s.authors = "Francois Beausoleil"
|
12
|
+
s.has_rdoc = false
|
13
|
+
s.rubyforge_project = "piston"
|
14
|
+
|
15
|
+
s.add_development_dependency "cucumber", ">= 0.1.16"
|
16
|
+
|
17
|
+
s.add_runtime_dependency "main", ">= 2.8.3"
|
18
|
+
s.add_runtime_dependency "log4r", ">= 1.0.5"
|
19
|
+
s.add_runtime_dependency "activesupport", ">= 2.0.0"
|
20
|
+
end
|
21
|
+
rescue LoadError
|
22
|
+
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
23
|
+
end
|
24
|
+
|
25
|
+
task :default => :test
|
data/TODO
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
= Integration tests to verify
|
2
|
+
|
3
|
+
* Port conflicts in temporary checkout directory to working copy:
|
4
|
+
It detects and marks conflicts with changes after last update. But when some changes, which were made before last update, conflict when merging in temporary directory, file is merged correctly but conflicts are not marked
|
5
|
+
In Piston 1.x old changes were lost, even without conflicts
|
6
|
+
* Force addition of Git repositories, because the files might be ignored in .gitignore
|
data/VERSION.yml
CHANGED
@@ -0,0 +1,56 @@
|
|
1
|
+
|
2
|
+
Feature: Import remote repository into a Git repository
|
3
|
+
In order to speed up deployments and to only deploy code that's been tested tested
|
4
|
+
A developer
|
5
|
+
Wants to import remote repositories
|
6
|
+
So that he is protected from inadvertent updates
|
7
|
+
|
8
|
+
Scenario: Importing from a Git repository
|
9
|
+
Given a newly created Git project
|
10
|
+
And a remote Git project named libcalc
|
11
|
+
And a file named libcalc.rb with content "a\nb\nc" in remote libcalc project
|
12
|
+
When I import libcalc
|
13
|
+
Then I should see a successful import message from Piston
|
14
|
+
And I should find a libcalc folder
|
15
|
+
And I should find a libcalc/libcalc.rb file
|
16
|
+
And I should find a libcalc/.piston.yml file
|
17
|
+
|
18
|
+
Scenario: Importing from a Git repository to a named folder
|
19
|
+
Given a newly created Git project
|
20
|
+
And a remote Git project named libcalc
|
21
|
+
And a file named libcalc.rb with content "a\nb\nc" in remote libcalc project
|
22
|
+
And an existing vendor folder
|
23
|
+
When I import libcalc into vendor/libcalc
|
24
|
+
Then I should see a successful import message from Piston
|
25
|
+
And I should find a vendor/libcalc folder
|
26
|
+
And I should find a vendor/libcalc/libcalc.rb file
|
27
|
+
And I should find a vendor/libcalc/.piston.yml file
|
28
|
+
|
29
|
+
Scenario: Importing from a Subversion repository
|
30
|
+
Given a newly created Git project
|
31
|
+
And a remote Subversion project named libcalc
|
32
|
+
And a file named libcalc.rb with content "a\nb\nc" in remote libcalc project
|
33
|
+
When I import libcalc
|
34
|
+
Then I should see a successful import message from Piston
|
35
|
+
And I should find a libcalc folder
|
36
|
+
And I should find a libcalc/libcalc.rb file
|
37
|
+
And I should find a libcalc/.piston.yml file
|
38
|
+
|
39
|
+
Scenario: Importing from a classic Subversion project layout automatically uses project's name and not trunk for the local folder name
|
40
|
+
Given a newly created Git project
|
41
|
+
And a remote Subversion project named libcalc using the classic layout
|
42
|
+
And a file named libcalc.rb with content "a\nb\nc" in remote libcalc project
|
43
|
+
When I import libcalc/trunk
|
44
|
+
Then I should see a successful import message from Piston
|
45
|
+
And I should find a libcalc folder
|
46
|
+
And I should find a libcalc/libcalc.rb file
|
47
|
+
And I should find a libcalc/.piston.yml file
|
48
|
+
|
49
|
+
Scenario: Importing into a specific folder when the parent folders doesn't exist succeeds
|
50
|
+
Given a newly created Git project
|
51
|
+
And a remote Subversion project named libcalc using the classic layout
|
52
|
+
And a file named libcalc.rb with content "a\nb\nc" in remote libcalc project
|
53
|
+
When I import libcalc/trunk into vendor/libcalc
|
54
|
+
And I should see a successful import message from Piston
|
55
|
+
And I should find a vendor/libcalc folder
|
56
|
+
And I should find a vendor/libcalc/libcalc.rb file
|
@@ -0,0 +1,54 @@
|
|
1
|
+
Feature: Import remote repository into a Subversion repository
|
2
|
+
In order to speed up deployments and to only deploy code that's been tested tested
|
3
|
+
A developer
|
4
|
+
Wants to import remote repositories
|
5
|
+
So that he is protected from inadvertent updates
|
6
|
+
|
7
|
+
Scenario: Importing from a Git repository
|
8
|
+
Given a newly created Subversion project
|
9
|
+
And a remote Git project named libcalc
|
10
|
+
And a file named libcalc.rb with content "a\nb\nc" in remote libcalc project
|
11
|
+
When I import libcalc
|
12
|
+
Then I should see a successful import message from Piston
|
13
|
+
And I should find a libcalc folder
|
14
|
+
And I should find a libcalc/libcalc.rb file
|
15
|
+
And I should find a libcalc/.piston.yml file
|
16
|
+
|
17
|
+
Scenario: Importing from a Git repository to a named folder
|
18
|
+
Given a newly created Subversion project
|
19
|
+
And a remote Git project named libcalc
|
20
|
+
And a file named libcalc.rb with content "a\nb\nc" in remote libcalc project
|
21
|
+
And an existing vendor folder
|
22
|
+
When I import libcalc into vendor/libcalc
|
23
|
+
Then I should see a successful import message from Piston
|
24
|
+
And I should find a vendor/libcalc folder
|
25
|
+
And I should find a vendor/libcalc/libcalc.rb file
|
26
|
+
And I should find a vendor/libcalc/.piston.yml file
|
27
|
+
|
28
|
+
Scenario: Importing from a Subversion repository
|
29
|
+
Given a newly created Subversion project
|
30
|
+
And a remote Subversion project named libcalc
|
31
|
+
And a file named libcalc.rb with content "a\nb\nc" in remote libcalc project
|
32
|
+
When I import libcalc
|
33
|
+
Then I should see a successful import message from Piston
|
34
|
+
And I should find a libcalc folder
|
35
|
+
And I should find a libcalc/libcalc.rb file
|
36
|
+
And I should find a libcalc/.piston.yml file
|
37
|
+
|
38
|
+
Scenario: Importing from a classic Subversion project layout automatically uses project's name and not trunk for the local folder name
|
39
|
+
Given a newly created Subversion project
|
40
|
+
And a remote Subversion project named libcalc using the classic layout
|
41
|
+
And a file named libcalc.rb with content "a\nb\nc" in remote libcalc project
|
42
|
+
When I import libcalc/trunk
|
43
|
+
Then I should see a successful import message from Piston
|
44
|
+
And I should find a libcalc folder
|
45
|
+
And I should find a libcalc/libcalc.rb file
|
46
|
+
And I should find a libcalc/.piston.yml file
|
47
|
+
|
48
|
+
Scenario: Importing into a specific folder bails if the parent folders doesn't exist
|
49
|
+
Given a newly created Subversion project
|
50
|
+
And a remote Subversion project named libcalc using the classic layout
|
51
|
+
And a file named libcalc.rb with content "a\nb\nc" in remote libcalc project
|
52
|
+
When I import libcalc/trunk into vendor/libcalc
|
53
|
+
Then I should see "Folder .*/vendor/libcalc could not be created. Is .*/vendor a working copy\? \(Tip: svn mkdir it\)"
|
54
|
+
And I should not find a vendor/libcalc folder
|
@@ -0,0 +1,213 @@
|
|
1
|
+
Given /^a newly created Git project$/ do
|
2
|
+
@wcdir = Tmpdir.where(:wc)
|
3
|
+
@wcdir.mkpath
|
4
|
+
Dir.chdir(@wcdir) do
|
5
|
+
git :init
|
6
|
+
touch :README
|
7
|
+
git :add, "."
|
8
|
+
@stdout = git :commit, "--message", "first commit"
|
9
|
+
@stdout.should =~ /Created (?:initial )?commit [a-fA-F0-9]+/
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
Given /^a newly created Subversion project$/ do
|
14
|
+
@reposdir = Tmpdir.where(:repos)
|
15
|
+
@reposdir.mkpath
|
16
|
+
svnadmin :create, @reposdir
|
17
|
+
@wcdir = Tmpdir.where(:wc)
|
18
|
+
svn :checkout, "file:///#{@reposdir}", @wcdir
|
19
|
+
end
|
20
|
+
|
21
|
+
Given /^a remote Git project named (\w+)$/ do |name|
|
22
|
+
@remotewcdir = @remotereposdir = Tmpdir.where("remote/#{name}.git")
|
23
|
+
@remotereposdir.mkpath
|
24
|
+
Dir.chdir(@remotereposdir) do
|
25
|
+
git :init
|
26
|
+
touch :README
|
27
|
+
git :add, "."
|
28
|
+
@stdout = git :commit, "--message", "initial commit"
|
29
|
+
@stdout.should =~ /Created (?:initial )?commit [a-fA-F0-9]+/
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
Given /^a remote Subversion project named (\w+)( using the classic layout)?$/ do |name, classic|
|
34
|
+
@remotereposdir = Tmpdir.where("remote/repos/#{name}")
|
35
|
+
@remotereposdir.mkpath
|
36
|
+
svnadmin :create, @remotereposdir
|
37
|
+
@remotewcdir = Tmpdir.where("remote/wc/#{name}")
|
38
|
+
svn :checkout, "file:///#{@remotereposdir}", @remotewcdir
|
39
|
+
if classic then
|
40
|
+
svn :mkdir, @remotewcdir + "trunk", @remotewcdir + "branches", @remotewcdir + "tags"
|
41
|
+
@stdout = svn :commit, "--message", "classic layout", @remotewcdir
|
42
|
+
@stdout.should =~ /Committed revision \d+/
|
43
|
+
@remotewcdir = @remotewcdir + "trunk"
|
44
|
+
@remotereposdir = @remotereposdir + "trunk"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
Given /^a file named ([^\s]+) was deleted in remote (\w+) project$/ do |filename, project|
|
49
|
+
Dir.chdir(@remotewcdir) do
|
50
|
+
if (@remotewcdir + ".git").directory? then
|
51
|
+
git :rm, filename
|
52
|
+
@stdout = git :commit, "--message", "removing #{filename}"
|
53
|
+
@stdout.should =~ /Created (?:initial )?commit [a-fA-F0-9]+/
|
54
|
+
else
|
55
|
+
svn :rm, filename
|
56
|
+
@stdout = svn :commit, "--message", "removing #{filename}"
|
57
|
+
@stdout.should =~ /Committed revision \d+/
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
Given /^a file named ([^\s]+) with content "([^"]+)" in remote (\w+) project$/ do |filename, content, project|
|
63
|
+
content.gsub!("\\n", "\n")
|
64
|
+
File.open(@remotewcdir + filename, "w+") {|io| io.puts(content)}
|
65
|
+
Dir.chdir(@remotewcdir) do
|
66
|
+
if (@remotewcdir + ".git").directory? then
|
67
|
+
git :add, "."
|
68
|
+
@stdout = git :commit, "--message", "adding #{filename}"
|
69
|
+
@stdout.should =~ /Created (?:initial )?commit [a-fA-F0-9]/
|
70
|
+
else
|
71
|
+
svn :add, filename
|
72
|
+
@stdout = svn :commit, "--message", "adding #{filename}"
|
73
|
+
@stdout.should =~ /Committed revision \d+/
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
Given /^a file named ([^\s]+) was renamed to ([^\s]+) in remote (\w+) project$/ do |from, to, project|
|
79
|
+
Dir.chdir(@remotewcdir) do
|
80
|
+
if (@remotewcdir + ".git").directory? then
|
81
|
+
git :mv, from, to
|
82
|
+
@stdout = git :commit, "--message", "moved #{from} to #{to}"
|
83
|
+
@stdout.should =~ /Created (?:initial )?commit [a-fA-F0-9]/
|
84
|
+
else
|
85
|
+
svn :mv, from, to
|
86
|
+
@stdout = svn :commit, "--message", "moved #{from} to #{to}"
|
87
|
+
@stdout.should =~ /Committed revision \d+/
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
Given /^a file named ([^\s]+) was updated with "([^"]+)" in remote (\w+) project$/ do |filename, content, project|
|
93
|
+
content.gsub!("\\n", "\n")
|
94
|
+
File.open(@remotewcdir + filename, "w+") {|io| io.puts(content)}
|
95
|
+
Dir.chdir(@remotewcdir) do
|
96
|
+
if (@remotewcdir + ".git").directory? then
|
97
|
+
git :add, "."
|
98
|
+
@stdout = git :commit, "--message", "updating #{filename}"
|
99
|
+
@stdout.should =~ /Created (?:initial )?commit [a-fA-F0-9]/
|
100
|
+
else
|
101
|
+
@stdout = svn :commit, "--message", "updating #{filename}"
|
102
|
+
@stdout.should =~ /Committed revision \d+/
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
Given /^I changed ([\w\/.]+) to "([^"]+)"$/ do |filename, content|
|
108
|
+
content.gsub!("\\n", "\n")
|
109
|
+
File.open(@wcdir + filename, "w+") {|io| io.puts(content)}
|
110
|
+
Dir.chdir(@wcdir) do
|
111
|
+
if (@wcdir + ".git").directory? then
|
112
|
+
git :add, "."
|
113
|
+
@stdout = git :commit, "--message", "adding #{filename}"
|
114
|
+
@stdout.should =~ /Created (?:initial )?commit [a-fA-F0-9]/
|
115
|
+
else
|
116
|
+
@stdout = svn :commit, "--message", "adding #{filename}"
|
117
|
+
@stdout.should =~ /Committed revision \d+/
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
Given /^an existing ([\w\/]+) folder$/ do |name|
|
123
|
+
if (@wcdir + ".git").directory? then
|
124
|
+
(@wcdir + "vendor").mkpath
|
125
|
+
touch(@wcdir + "vendor/.gitignore")
|
126
|
+
Dir.chdir(@wcdir) do
|
127
|
+
git :add, "."
|
128
|
+
@stdout = git :commit, "--message", "registered #{name}/"
|
129
|
+
@stdout.should =~ /Created (?:initial )?commit [a-fA-F0-9]+/
|
130
|
+
end
|
131
|
+
else
|
132
|
+
svn :mkdir, @wcdir + name
|
133
|
+
@stdout = svn :commit, "--message", "creating #{name}", @wcdir
|
134
|
+
@stdout.should =~ /Committed revision \d+/
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
When /^I import(?:ed)? ([\w\/]+)(?: into ([\w\/]+))?$/ do |project, into|
|
139
|
+
Dir.chdir(@wcdir) do
|
140
|
+
cmd = "#{Tmpdir.piston} import --verbose 5 file://#{@remotereposdir} 2>&1"
|
141
|
+
cmd << " #{into}" if into
|
142
|
+
STDERR.puts cmd.inspect if $DEBUG
|
143
|
+
@stdout = `#{cmd}`
|
144
|
+
STDERR.puts @stdout if $DEBUG
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
When /^I update(?:ed)? ([\w\/]+)$/ do |path|
|
149
|
+
Dir.chdir(@wcdir) do
|
150
|
+
cmd = "#{Tmpdir.piston} update --verbose 5 #{@wcdir + path} 2>&1"
|
151
|
+
STDERR.puts cmd.inspect if $DEBUG
|
152
|
+
@stdout = `#{cmd}`
|
153
|
+
STDERR.puts @stdout if $DEBUG
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
When /^I committed$/ do
|
158
|
+
if (@wcdir + ".git").directory?
|
159
|
+
Dir.chdir(@wcdir) do
|
160
|
+
@stdout = git :commit, "--message", "commit", "--all"
|
161
|
+
@stdout.should =~ /Created (?:initial )?commit [a-fA-F0-9]+/
|
162
|
+
end
|
163
|
+
else
|
164
|
+
@stdout = svn(:commit, "--message", "commit", @wcdir)
|
165
|
+
@stdout.should =~ /Committed revision \d+/
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
Then /^I should see "([^"]+)"(\s+debug)?$/ do |regexp, debug|
|
170
|
+
re = Regexp.new(regexp, Regexp::IGNORECASE + Regexp::MULTILINE)
|
171
|
+
STDERR.puts @stdout if debug
|
172
|
+
@stdout.should =~ re
|
173
|
+
end
|
174
|
+
|
175
|
+
Then /^I should( not)? find a ([\w+\/]+) folder$/ do |not_find, name|
|
176
|
+
if not_find then
|
177
|
+
File.exist?(@wcdir + name).should_not be_true
|
178
|
+
File.directory?(@wcdir + name).should_not be_true
|
179
|
+
else
|
180
|
+
File.exist?(@wcdir + name).should be_true
|
181
|
+
File.directory?(@wcdir + name).should be_true
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
Then /^I should (not )?find a ([.\w+\/]+) file$/ do |not_find, name|
|
186
|
+
if not_find then
|
187
|
+
File.exist?(@wcdir + name).should be_false
|
188
|
+
File.file?(@wcdir + name).should be_false
|
189
|
+
else
|
190
|
+
File.exist?(@wcdir + name).should be_true
|
191
|
+
File.file?(@wcdir + name).should be_true
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
Then /^I should find "([^"]+)" in ([\w\/.]+)$/ do |content, path|
|
196
|
+
File.read(@wcdir + path).should =~ Regexp.new(content, Regexp::MULTILINE + Regexp::IGNORECASE)
|
197
|
+
end
|
198
|
+
|
199
|
+
Then /^I should see a successful import message from Piston$/ do
|
200
|
+
if (@remotewcdir + ".git").directory? then
|
201
|
+
@stdout.should =~ /Imported commit [\da-f]+ from .*\/\w+.git/
|
202
|
+
else
|
203
|
+
@stdout.should =~ /Imported revision \d+ from .*\/\w+/
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
Then /^I should see a successful update message from Piston$/ do
|
208
|
+
if (@remotewcdir + ".git").directory? then
|
209
|
+
@stdout.should =~ /Updated .*\/libcalc to commit [a-fA-F0-9]+/
|
210
|
+
else
|
211
|
+
@stdout.should =~ /Updated .*\/libcalc to revision \d+/
|
212
|
+
end
|
213
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'cucumber/formatters/unicode' # Comment out this line if you don't want Cucumber Unicode support
|
2
|
+
require "pathname"
|
3
|
+
require "fileutils"
|
4
|
+
require File.dirname(__FILE__) + "/svn"
|
5
|
+
require "spec"
|
6
|
+
|
7
|
+
class Tmpdir
|
8
|
+
def self.where(subpath=nil)
|
9
|
+
@tmpdir ||= Pathname.new(ENV["TMPDIR"] || ENV["TMP"] || "tmp") + "piston"
|
10
|
+
@tmpdir + subpath.to_s
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.piston
|
14
|
+
return @piston if @piston
|
15
|
+
bin = (Pathname.new(File.dirname(__FILE__)) + "../../bin/piston").realpath
|
16
|
+
lib = (Pathname.new(File.dirname(__FILE__)) + "../../lib").realpath
|
17
|
+
@piston = "ruby -I #{lib} #{bin}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
STDERR.puts "Removing #{Tmpdir.where}" if $DEBUG
|
22
|
+
|
23
|
+
Before do
|
24
|
+
_ = Tmpdir.piston
|
25
|
+
FileUtils.rm_rf(Tmpdir.where, :verbose => $DEBUG)
|
26
|
+
Tmpdir.where.mkpath
|
27
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
def svnadmin(*args)
|
2
|
+
run(:svnadmin, args)
|
3
|
+
end
|
4
|
+
|
5
|
+
def svn(*args)
|
6
|
+
run(:svn, args)
|
7
|
+
end
|
8
|
+
|
9
|
+
def git(*args)
|
10
|
+
run(:git, args)
|
11
|
+
end
|
12
|
+
|
13
|
+
def touch(*args)
|
14
|
+
run(:touch, args)
|
15
|
+
end
|
16
|
+
|
17
|
+
def run(program, args)
|
18
|
+
cmd = args.map{|o| o.to_s}.inject([program]) do |memo, arg|
|
19
|
+
memo << (arg.include?(" ") ? %Q("#{arg}") : arg)
|
20
|
+
end
|
21
|
+
STDERR.puts cmd.inspect if $DEBUG
|
22
|
+
`#{cmd.join(" ")}`
|
23
|
+
end
|
@@ -0,0 +1,137 @@
|
|
1
|
+
Feature: Updating from a remote Subversion repository
|
2
|
+
In order to be on the cutting edge and benefit from bug fixes
|
3
|
+
A developer
|
4
|
+
Wants to update his pistonised repositories
|
5
|
+
So that he keeps abreast of upstream changes
|
6
|
+
|
7
|
+
Scenario: Updating from a Subversion repository when there are no changes
|
8
|
+
Given a newly created Git project
|
9
|
+
And a remote Subversion project named libcalc
|
10
|
+
And I imported libcalc
|
11
|
+
And I committed
|
12
|
+
When I update libcalc
|
13
|
+
Then I should see "Upstream .*/libcalc was unchanged from revision \d+"
|
14
|
+
|
15
|
+
Scenario: Updating from a Subversion repository when a file was added
|
16
|
+
Given a newly created Git project
|
17
|
+
And a remote Subversion project named libcalc
|
18
|
+
And a file named libcalc.rb with content "a" in remote libcalc project
|
19
|
+
And I imported libcalc
|
20
|
+
And I committed
|
21
|
+
And a file named libcomplex.rb with content "b" in remote libcalc project
|
22
|
+
When I update libcalc
|
23
|
+
Then I should see a successful update message from Piston
|
24
|
+
And I should find a libcalc/libcomplex.rb file
|
25
|
+
|
26
|
+
Scenario: Updating from a Subversion repository when a file was removed
|
27
|
+
Given a newly created Git project
|
28
|
+
And a remote Subversion project named libcalc
|
29
|
+
And a file named libcalc.rb with content "a" in remote libcalc project
|
30
|
+
And I imported libcalc
|
31
|
+
And I committed
|
32
|
+
And a file named libcalc.rb was deleted in remote libcalc project
|
33
|
+
When I update libcalc
|
34
|
+
Then I should see a successful update message from Piston
|
35
|
+
And I should not find a libcalc/libcalc.rb file
|
36
|
+
|
37
|
+
Scenario: Updating from a Subversion repository when a file was updated
|
38
|
+
Given a newly created Git project
|
39
|
+
And a remote Subversion project named libcalc
|
40
|
+
And a file named libcalc.rb with content "a" in remote libcalc project
|
41
|
+
And I imported libcalc
|
42
|
+
And I committed
|
43
|
+
And a file named libcalc.rb was updated with "a\nb\nc" in remote libcalc project
|
44
|
+
When I update libcalc
|
45
|
+
Then I should see a successful update message from Piston
|
46
|
+
And I should find a libcalc/libcalc.rb file
|
47
|
+
And I should find "a\nb\nc" in libcalc/libcalc.rb
|
48
|
+
|
49
|
+
Scenario: Updating from a Subversion repository when a file was moved
|
50
|
+
Given a newly created Git project
|
51
|
+
And a remote Subversion project named libcalc
|
52
|
+
And a file named libcalc.rb with content "a" in remote libcalc project
|
53
|
+
And I imported libcalc
|
54
|
+
And I committed
|
55
|
+
And a file named libcalc.rb was renamed to libcomplex.rb in remote libcalc project
|
56
|
+
When I update libcalc
|
57
|
+
Then I should see a successful update message from Piston
|
58
|
+
And I should not find a libcalc/libcalc.rb file
|
59
|
+
And I should find a libcalc/libcomplex.rb file
|
60
|
+
|
61
|
+
Scenario: Updating from a Git repository when there are no changes
|
62
|
+
Given a newly created Git project
|
63
|
+
And a remote Git project named libcalc
|
64
|
+
And I imported libcalc
|
65
|
+
And I committed
|
66
|
+
When I update libcalc
|
67
|
+
Then I should see "Upstream .*/libcalc.git was unchanged from commit [a-fA-F0-9]+"
|
68
|
+
|
69
|
+
Scenario: Updating from a Git repository when a file was added
|
70
|
+
Given a newly created Git project
|
71
|
+
And a remote Git project named libcalc
|
72
|
+
And a file named libcalc.rb with content "a" in remote libcalc project
|
73
|
+
And I imported libcalc
|
74
|
+
And I committed
|
75
|
+
And a file named libcomplex.rb with content "b" in remote libcalc project
|
76
|
+
When I update libcalc
|
77
|
+
Then I should see a successful update message from Piston
|
78
|
+
And I should find a libcalc/libcomplex.rb file
|
79
|
+
|
80
|
+
Scenario: Updating from a Git repository when a file was removed
|
81
|
+
Given a newly created Git project
|
82
|
+
And a remote Git project named libcalc
|
83
|
+
And a file named libcalc.rb with content "a" in remote libcalc project
|
84
|
+
And I imported libcalc
|
85
|
+
And I committed
|
86
|
+
And a file named libcalc.rb was deleted in remote libcalc project
|
87
|
+
When I update libcalc
|
88
|
+
Then I should see a successful update message from Piston
|
89
|
+
And I should not find a libcalc/libcalc.rb file
|
90
|
+
|
91
|
+
Scenario: Updating from a Git repository when a file was updated
|
92
|
+
Given a newly created Git project
|
93
|
+
And a remote Git project named libcalc
|
94
|
+
And a file named libcalc.rb with content "a" in remote libcalc project
|
95
|
+
And I imported libcalc
|
96
|
+
And I committed
|
97
|
+
And a file named libcalc.rb was updated with "a\nb\nc" in remote libcalc project
|
98
|
+
When I update libcalc
|
99
|
+
Then I should see a successful update message from Piston
|
100
|
+
And I should find a libcalc/libcalc.rb file
|
101
|
+
And I should find "a\nb\nc" in libcalc/libcalc.rb
|
102
|
+
|
103
|
+
Scenario: Updating from a Git repository when a file was moved
|
104
|
+
Given a newly created Git project
|
105
|
+
And a remote Git project named libcalc
|
106
|
+
And a file named libcalc.rb with content "a" in remote libcalc project
|
107
|
+
And I imported libcalc
|
108
|
+
And I committed
|
109
|
+
And a file named libcalc.rb was renamed to libcomplex.rb in remote libcalc project
|
110
|
+
When I update libcalc
|
111
|
+
Then I should see a successful update message from Piston
|
112
|
+
And I should not find a libcalc/libcalc.rb file
|
113
|
+
And I should find a libcalc/libcomplex.rb file
|
114
|
+
|
115
|
+
Scenario: Updating from a Subversion repository when both local and remote changes have occured
|
116
|
+
Given a newly created Git project
|
117
|
+
And a remote Subversion project named libcalc
|
118
|
+
And a file named libcalc.rb with content "a\nb\nc\nd\ne" in remote libcalc project
|
119
|
+
And I imported libcaclc
|
120
|
+
And I committed
|
121
|
+
And a file named libcalc.rb was updated with "a\na\nb\nc\nd\ne" in remote libcalc project
|
122
|
+
And I changed libcalc/libcalc.rb to "a\nb\nc\nd\ne\ne"
|
123
|
+
When I update libcalc
|
124
|
+
Then I should see a successful update message from Piston
|
125
|
+
And I should find "a\na\nb\nc\nd\ne\ne" in libcalc/libcalc.rb
|
126
|
+
|
127
|
+
Scenario: Updating from a Git repository when both local and remote changes have occured
|
128
|
+
Given a newly created Git project
|
129
|
+
And a remote Git project named libcalc
|
130
|
+
And a file named libcalc.rb with content "a\nb\nc\nd\ne" in remote libcalc project
|
131
|
+
And I imported libcaclc
|
132
|
+
And I committed
|
133
|
+
And a file named libcalc.rb was updated with "a\na\nb\nc\nd\ne" in remote libcalc project
|
134
|
+
And I changed libcalc/libcalc.rb to "a\nb\nc\nd\ne\ne"
|
135
|
+
When I update libcalc
|
136
|
+
Then I should see a successful update message from Piston
|
137
|
+
And I should find "a\na\nb\nc\nd\ne\ne" in libcalc/libcalc.rb
|