svn-command 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/subversion.rb +0 -1
- data/lib/svn_command.rb +35 -34
- metadata +2 -4
- data/bin/change_all_externals.rb +0 -32
- data/bin/change_all_externals.sh +0 -13
data/lib/subversion.rb
CHANGED
@@ -12,7 +12,6 @@ require 'facets/core/enumerable/uniq_by'
|
|
12
12
|
require 'facets/core/kernel/silence_stream'
|
13
13
|
|
14
14
|
require_gem 'qualitysmith_extensions', '>=0.0.3'
|
15
|
-
require 'capture_output'
|
16
15
|
|
17
16
|
# Had a lot of trouble getting ActiveSupport to load without giving errors! Eventually gave up on that idea since I only needed it for mattr_accessor and Facets supplies that.
|
18
17
|
#require_gem 'activesupport' # mattr_accessor
|
data/lib/svn_command.rb
CHANGED
@@ -444,44 +444,42 @@ End
|
|
444
444
|
$ignore_dry_run_option = false
|
445
445
|
begin
|
446
446
|
response = ""
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
else
|
458
|
-
puts "File contents:"
|
459
|
-
# Only show the first x bytes so that we don't accidentally dump the contens of some 20 GB log file to screen...
|
460
|
-
contents = File.read(file, threshold = 2000) || ''
|
461
|
-
print contents
|
462
|
-
puts if contents[-1] && contents[-1].chr != "\n" # Make sure we end with a newline character
|
463
|
-
puts "..." if contents.length >= threshold # So they know that there may be *more* to the file than what's shown
|
464
|
-
end
|
465
|
-
elsif File.directory?(file)
|
466
|
-
puts "Directory contains:"
|
467
|
-
Dir.new(file).reject {|f| ['.','..'].include? f}.each do |f|
|
468
|
-
puts f
|
469
|
-
end
|
447
|
+
|
448
|
+
puts( ('-'*100).green )
|
449
|
+
puts "What do you want to do with '#{file.white.underline}'?".white.bold
|
450
|
+
begin
|
451
|
+
if !File.exist?(file)
|
452
|
+
raise "#{file} doesn't seem to exist -- even though it was reported by svn status"
|
453
|
+
end
|
454
|
+
if File.file?(file)
|
455
|
+
if FileTest.binary_file?(file)
|
456
|
+
puts "(Binary file -- cannot show preview)".bold
|
470
457
|
else
|
471
|
-
|
458
|
+
puts "File contents:"
|
459
|
+
# Only show the first x bytes so that we don't accidentally dump the contens of some 20 GB log file to screen...
|
460
|
+
contents = File.read(file, threshold = 2000) || ''
|
461
|
+
print contents
|
462
|
+
puts if contents[-1] && contents[-1].chr != "\n" # Make sure we end with a newline character
|
463
|
+
puts "..." if contents.length >= threshold # So they know that there may be *more* to the file than what's shown
|
464
|
+
end
|
465
|
+
elsif File.directory?(file)
|
466
|
+
puts "Directory contains:"
|
467
|
+
Dir.new(file).reject {|f| ['.','..'].include? f}.each do |f|
|
468
|
+
puts f
|
472
469
|
end
|
470
|
+
else
|
471
|
+
raise "#{file} is not a file or directory -- what *is* it then???"
|
473
472
|
end
|
474
|
-
print(
|
475
|
-
"Add".menu_item(:green) + ", " +
|
476
|
-
"Delete".menu_item(:red) + ", " +
|
477
|
-
"add to " + "svn:".yellow + "Ignore".menu_item(:yellow) + " property, " +
|
478
|
-
"or [" + "Enter".white.bold + "] to do nothing > "
|
479
|
-
)
|
480
|
-
response = ""
|
481
|
-
response = $stdin.getc.chr while !['a', 'd', 'i', "\n"].include?(begin response.downcase!; response end)
|
482
|
-
|
483
|
-
break
|
484
473
|
end
|
474
|
+
print(
|
475
|
+
"Add".menu_item(:green) + ", " +
|
476
|
+
"Delete".menu_item(:red) + ", " +
|
477
|
+
"add to " + "svn:".yellow + "Ignore".menu_item(:yellow) + " property, " +
|
478
|
+
"or " + "any other key".white.bold + " to do nothing > "
|
479
|
+
)
|
480
|
+
response = ""
|
481
|
+
response = $stdin.getc.chr # while !['a', 'd', 'i', "\n"].include?(begin response.downcase!; response end)
|
482
|
+
|
485
483
|
|
486
484
|
case response
|
487
485
|
when 'a'
|
@@ -513,6 +511,9 @@ End
|
|
513
511
|
print "\nIgnoring... "
|
514
512
|
Subversion.ignore file
|
515
513
|
puts
|
514
|
+
else
|
515
|
+
# Skip / Do nothing with this file
|
516
|
+
puts
|
516
517
|
end
|
517
518
|
rescue Interrupt
|
518
519
|
puts "Goodbye"
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: svn-command
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
7
|
-
date: 2007-03-
|
6
|
+
version: 0.0.9
|
7
|
+
date: 2007-03-26 00:00:00 -07:00
|
8
8
|
summary: A nifty wrapper command for Subversion's command-line svn client
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -39,9 +39,7 @@ files:
|
|
39
39
|
- test/shared/test_helper.rb
|
40
40
|
- test/shared/test_helpers/test_colorizer.rb
|
41
41
|
- bin/rscm_test
|
42
|
-
- bin/change_all_externals.sh
|
43
42
|
- bin/command_completion_for_svn_command
|
44
|
-
- bin/change_all_externals.rb
|
45
43
|
- bin/svn
|
46
44
|
- Readme
|
47
45
|
test_files:
|
data/bin/change_all_externals.rb
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require 'find'
|
3
|
-
|
4
|
-
Find.find(ARGV[0]) do |path|
|
5
|
-
if FileTest.directory?(path)
|
6
|
-
if File.basename(path)[0] == ?. # Don't look in directories beginning with .
|
7
|
-
Find.prune # Don't look any further into this directory.
|
8
|
-
else
|
9
|
-
ext = `svn pg svn:externals #{path} 2>&1`.strip
|
10
|
-
next if ext =~ /not under version control/
|
11
|
-
next if ext =~ /not a working copy/
|
12
|
-
next if path =~ /plugins\//
|
13
|
-
if ext.size > 0 and ext =~ /_tasks/
|
14
|
-
puts "-"*80
|
15
|
-
puts path
|
16
|
-
puts ext
|
17
|
-
|
18
|
-
# puts "svn up #{path}"
|
19
|
-
# puts `svn up #{path}`
|
20
|
-
# puts "svn pe svn:externals #{path}"
|
21
|
-
# exec "svn pe svn:externals #{path}" if fork.nil?
|
22
|
-
# Process.wait
|
23
|
-
# puts `svn up #{path}`
|
24
|
-
# puts "svn ci #{path} -m \"Fixing svn:externals\""
|
25
|
-
# puts `svn ci #{path} -m \"Fixing svn:externals\"`
|
26
|
-
end
|
27
|
-
|
28
|
-
next
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
data/bin/change_all_externals.sh
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
svn pe svn:externals svn/code/gemables/dev_scripts/tasks
|
2
|
-
svn ci svn/code/gemables/dev_scripts/tasks -m 'Fixed svn:externals'
|
3
|
-
svn pe svn:externals svn/code/gemables/our_extensions/tasks
|
4
|
-
svn ci svn/code/gemables/our_extensions/tasks -m 'Fixed svn:externals'
|
5
|
-
svn pe svn:externals svn/code/applications/underlord/vendor/plugins
|
6
|
-
svn ci svn/code/applications/underlord/vendor/plugins -m 'Fixed svn:externals'
|
7
|
-
svn pe svn:externals svn/glass/rails_backend/vendor/plugins
|
8
|
-
svn ci svn/glass/rails_backend/vendor/plugins -m 'Fixed svn:externals'
|
9
|
-
svn pe svn:externals svn/glass.net/backend/vendor/plugins
|
10
|
-
svn ci svn/glass.net/backend/vendor/plugins -m 'Fixed svn:externals'
|
11
|
-
svn pe svn:externals svn/glass.net/shops/vendor/plugins
|
12
|
-
svn ci svn/glass.net/shops/vendor/plugins -m 'Fixed svn:externals'
|
13
|
-
|