piston 1.3.3 → 1.4.0

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/CHANGELOG CHANGED
@@ -1,5 +1,12 @@
1
1
  *SVN*
2
2
 
3
+ 2008-02-07 1.4.0
4
+ * New piston diff subcommand, implemented by Graeme Mathieson.
5
+ http://rubyforge.org/tracker/index.php?func=detail&aid=17116&group_id=2105&atid=8179
6
+ * Per http://rubyforge.org/tracker/?func=detail&atid=8179&aid=10717&group_id=2105
7
+ Don't set LC_ALL, but set LANGUAGE so that repositories with foreign
8
+ characters can be used. Thanks go to Per Wigren.
9
+
3
10
  2007-03-22 1.3.3
4
11
  * Repaired problems with import subcommand. Wrote specifications to prevent
5
12
  the same failure mode again.
@@ -37,7 +37,7 @@ module Piston
37
37
  command = "svn #{args.join(' ')}"
38
38
  logging_stream.puts command if verbose
39
39
  return if dry_run
40
- ENV['LC_ALL'] = 'C'
40
+ ENV['LANGUAGE'] = 'en_US'
41
41
  result = `#{command}`
42
42
  logging_stream.puts result if verbose
43
43
  raise "Command #{command} resulted in an error:\n\n#{result}" unless $?.exitstatus.zero?
@@ -48,5 +48,21 @@ module Piston
48
48
  def logging_stream
49
49
  @logging_stream ||= $stdout
50
50
  end
51
+
52
+ def skip(dir, msg, header=true)
53
+ logging_stream.print "Skipping '#{dir}': " if header
54
+ logging_stream.puts msg
55
+ end
56
+
57
+ def find_targets
58
+ targets = Array.new
59
+ svn(:propget, '--recursive', Piston::ROOT).each_line do |line|
60
+ next unless line =~ /^([^ ]+)\s-\s.*$/
61
+ targets << $1
62
+ end
63
+
64
+ targets
65
+ end
66
+
51
67
  end
52
68
  end
@@ -0,0 +1,55 @@
1
+ require "piston"
2
+ require "piston/command"
3
+ require 'find'
4
+
5
+ module Piston
6
+ module Commands
7
+ class Diff < Piston::Command
8
+ def run
9
+ (args.empty? ? find_targets : args).each do |dir|
10
+ diff dir
11
+ end
12
+ end
13
+
14
+ def diff(dir)
15
+ return unless File.directory?(dir)
16
+ logging_stream.puts "Processing '#{dir}'..."
17
+ repos = svn(:propget, Piston::ROOT, dir).chomp
18
+ uuid = svn(:propget, Piston::UUID, dir).chomp
19
+ remote_revision = svn(:propget, Piston::REMOTE_REV, dir).chomp.to_i
20
+
21
+ logging_stream.puts " Fetching remote repository's latest revision and UUID"
22
+ info = YAML::load(svn(:info, repos))
23
+ return skip(dir, "Repository UUID changed\n Expected #{uuid}\n Found #{info['Repository UUID']}\n Repository: #{repos}") unless uuid == info['Repository UUID']
24
+
25
+ logging_stream.puts " Checking out repository at revision #{remote_revision}"
26
+ svn :checkout, '--ignore-externals', '--quiet', '--revision', remote_revision, repos, dir.tmp
27
+
28
+ puts run_diff(dir.tmp, dir)
29
+
30
+ logging_stream.puts " Removing temporary files / folders"
31
+ FileUtils.rm_rf dir.tmp
32
+
33
+ end
34
+
35
+ def run_diff(dir1, dir2)
36
+ `diff -urN --exclude=.svn #{dir1} #{dir2}`
37
+ end
38
+
39
+ def self.help
40
+ "Shows the differences between the local repository and the pristine upstream"
41
+ end
42
+
43
+ def self.detailed_help
44
+ <<EOF
45
+ usage: diff [DIR [...]]
46
+
47
+ This operation has the effect of producing a diff between the pristine upstream
48
+ (at the last updated revision) and your local version. In other words, it
49
+ gives you the changes you have made in your repository that have not been
50
+ incorporated upstream.
51
+ EOF
52
+ end
53
+ end
54
+ end
55
+ end
@@ -11,16 +11,6 @@ module Piston
11
11
  end
12
12
  end
13
13
 
14
- def find_targets
15
- targets = Array.new
16
- svn(:propget, '--recursive', Piston::ROOT).each_line do |line|
17
- next unless line =~ /^([^ ]+)\s-\s.*$/
18
- targets << $1
19
- end
20
-
21
- targets
22
- end
23
-
24
14
  def update(dir)
25
15
  return unless File.directory?(dir)
26
16
  return skip(dir, "locked") unless svn(:propget, Piston::LOCKED, dir) == ''
@@ -114,11 +104,6 @@ module Piston
114
104
  FileUtils.cp(File.join(dir.tmp, file), File.join(dir, file))
115
105
  end
116
106
 
117
- def skip(dir, msg, header=true)
118
- logging_stream.print "Skipping '#{dir}': " if header
119
- logging_stream.puts msg
120
- end
121
-
122
107
  def self.help
123
108
  "Updates all or specified folders to the latest revision"
124
109
  end
@@ -3,8 +3,8 @@ require "piston"
3
3
  module Piston
4
4
  module VERSION #:nodoc:
5
5
  MAJOR = 1
6
- MINOR = 3
7
- TINY = 3
6
+ MINOR = 4
7
+ TINY = 0
8
8
 
9
9
  STRING = [MAJOR, MINOR, TINY].join('.')
10
10
  end
data/lib/piston.rb CHANGED
@@ -18,8 +18,8 @@
18
18
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
19
  # THE SOFTWARE.
20
20
 
21
- # $HeadURL: svn+ssh://fbos@rubyforge.org/var/svn/piston/tags/1.3.3/lib/piston.rb $
22
- # $Id: piston.rb 93 2007-03-13 19:41:08Z fbos $
21
+ # $HeadURL: svn+ssh://rubyforge.org/var/svn/piston/tags/1.4.0/lib/piston.rb $
22
+ # $Id: piston.rb 139 2008-02-07 15:28:24Z fbos $
23
23
 
24
24
  require 'yaml'
25
25
  require 'uri'
@@ -61,6 +61,7 @@ PistonCommandLineProcessor = Transat::Parser.new do
61
61
 
62
62
  command :switch, Piston::Commands::Switch, :valid_options => %w(lock dry_run force revision quiet verbose)
63
63
  command :update, Piston::Commands::Update, :valid_options => %w(lock dry_run force revision quiet verbose)
64
+ command :diff, Piston::Commands::Diff, :valid_options => %w(lock dry_run force revision quiet verbose)
64
65
  command :import, Piston::Commands::Import, :valid_options => %w(lock dry_run force revision quiet verbose)
65
66
  command :convert, Piston::Commands::Convert, :valid_options => %w(lock verbose dry_run)
66
67
  command :unlock, Piston::Commands::Unlock, :valid_options => %w(force dry_run verbose)
metadata CHANGED
@@ -1,33 +1,26 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.2
3
- specification_version: 1
4
2
  name: piston
5
3
  version: !ruby/object:Gem::Version
6
- version: 1.3.3
7
- date: 2007-03-22 00:00:00 -04:00
8
- summary: Piston is a utility that enables merge tracking of remote repositories.
9
- require_paths:
10
- - lib
11
- email: francois@teksol.info
12
- homepage: http://piston.rubyforge.org/
13
- rubyforge_project: piston
14
- description: This is similar to svn:externals, except you have a local copy of the files, which you can modify at will. As long as the changes are mergeable, you should have no problems.
15
- autorequire:
16
- default_executable: piston
17
- bindir: bin
18
- has_rdoc: false
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
25
- platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
4
+ version: 1.4.0
5
+ platform: ""
29
6
  authors:
30
7
  - Francois Beausoleil
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-02-08 00:00:00 -05:00
13
+ default_executable: piston
14
+ dependencies: []
15
+
16
+ description: This is similar to svn:externals, except you have a local copy of the files, which you can modify at will. As long as the changes are mergeable, you should have no problems.
17
+ email: francois@teksol.info
18
+ executables:
19
+ - piston
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
31
24
  files:
32
25
  - CHANGELOG
33
26
  - README
@@ -38,32 +31,47 @@ files:
38
31
  - lib/core_ext
39
32
  - lib/core_ext/string.rb
40
33
  - lib/core_ext/range.rb
34
+ - lib/transat
35
+ - lib/transat/parser.rb
41
36
  - lib/piston
42
37
  - lib/piston/commands
43
- - lib/piston/commands/convert.rb
44
- - lib/piston/commands/switch.rb
45
- - lib/piston/commands/update.rb
46
- - lib/piston/commands/status.rb
38
+ - lib/piston/commands/diff.rb
47
39
  - lib/piston/commands/lock.rb
40
+ - lib/piston/commands/convert.rb
48
41
  - lib/piston/commands/import.rb
49
42
  - lib/piston/commands/unlock.rb
43
+ - lib/piston/commands/update.rb
44
+ - lib/piston/commands/status.rb
45
+ - lib/piston/commands/switch.rb
46
+ - lib/piston/command_error.rb
50
47
  - lib/piston/command.rb
51
48
  - lib/piston/version.rb
52
- - lib/piston/command_error.rb
53
- - lib/transat
54
- - lib/transat/parser.rb
55
49
  - lib/piston.rb
56
- test_files: []
57
-
50
+ has_rdoc: false
51
+ homepage: http://piston.rubyforge.org/
52
+ post_install_message:
58
53
  rdoc_options: []
59
54
 
60
- extra_rdoc_files: []
61
-
62
- executables:
63
- - piston
64
- extensions: []
65
-
55
+ require_paths:
56
+ - lib
57
+ required_ruby_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: "0"
62
+ version:
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ version:
66
69
  requirements: []
67
70
 
68
- dependencies: []
71
+ rubyforge_project: piston
72
+ rubygems_version: 0.9.5
73
+ signing_key:
74
+ specification_version: 2
75
+ summary: Piston is a utility that enables merge tracking of remote repositories.
76
+ test_files: []
69
77