git-si 0.2.0 → 0.2.1
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.
- checksums.yaml +4 -4
- data/lib/git/si/version.rb +1 -1
- data/lib/git/si.rb +27 -13
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37dde5ac525eb3b802d3fa5b03b08a2e7765ae22
|
4
|
+
data.tar.gz: 500f725cea23eb47729ec7ea5dd498057601e83a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1b9ae5573ebbf80e2c82d8d1645732c905f8b558558ed278da948c569208fb113b24140c5661d85e02dcc1babaa9ab6b953ca352ba79c6f6f549e120f5f53c2
|
7
|
+
data.tar.gz: 238e6bfded56e3d2f42d22e1d95464ced6dd731b991eda462572c8e33edd0ca26f27f0449e97f13cd057eb1c1822980c919feba4d939e1833dfcb4bf68300089
|
data/lib/git/si/version.rb
CHANGED
data/lib/git/si.rb
CHANGED
@@ -199,25 +199,29 @@ continue, it's wise to reset the master branch afterward."
|
|
199
199
|
svn_status = `#{command}`
|
200
200
|
raise SvnError.new("Failed to get the svn status. I'm not sure why. Check for any errors above.") if ! $?.success?
|
201
201
|
files_to_add = []
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
202
|
+
using_stderr do
|
203
|
+
svn_status.each_line do |line|
|
204
|
+
case line.strip!
|
205
|
+
when /^X/, /\.git/, /\.swp$/
|
206
|
+
when /^\?\s+(\S.+)/
|
207
|
+
filename = $1
|
208
|
+
file_in_git = `git ls-files #{filename}`
|
209
|
+
raise GitError.new("Failed to list git files. I'm not sure why. Check for any errors above.") unless $?.success?
|
210
|
+
files_to_add << filename if file_in_git
|
211
|
+
say filename
|
212
|
+
end
|
211
213
|
end
|
212
214
|
end
|
213
215
|
if files_to_add.empty?
|
214
216
|
notice_message "There are no files to add."
|
215
217
|
return
|
216
218
|
end
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
219
|
+
using_stderr do
|
220
|
+
if yes? "Do you want to add the above files to svn? [y/N] ", :green
|
221
|
+
command = "svn add " + files_to_add.join(' ')
|
222
|
+
run_command(command)
|
223
|
+
success_message "Added files to svn that had been added to git."
|
224
|
+
end
|
221
225
|
end
|
222
226
|
end
|
223
227
|
end
|
@@ -330,6 +334,16 @@ continue, it's wise to reset the master branch afterward."
|
|
330
334
|
end
|
331
335
|
end
|
332
336
|
|
337
|
+
def using_stderr(&block)
|
338
|
+
old_stdout = $stdout
|
339
|
+
$stdout = $stderr
|
340
|
+
begin
|
341
|
+
yield
|
342
|
+
ensure
|
343
|
+
$stdout = old_stdout
|
344
|
+
end
|
345
|
+
end
|
346
|
+
|
333
347
|
def success_message(message)
|
334
348
|
$stderr.puts set_color message, :green
|
335
349
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-si
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Payton Swick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|