Project: Piston
Revision:
Author:
Date: 07 Feb 2008 10:27:20
Changes:Reverting r137: Preparing 1.4.0 release
Files:modified: /branches/piston1/lib/piston/command.rb (
try)
modified: /branches/piston1/lib/piston.rb (
try)
modified: /branches/piston1/CHANGELOG (
try)
modified: /branches/piston1/lib/piston/commands/update.rb (
try)
modified: /branches/piston1/lib/piston/version.rb (
try)
deleted: /branches/piston1/lib/piston/commands/diff.rb
Diff:
| ... | ...@@ -48,21 +48,5 @@ |
| 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 | | |
| 67 | 51 | end |
| 68 | 52 | end |
| ... | ...@@ -61,7 +61,6 @@ |
| 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) |
| 65 | 64 | command :import, Piston::Commands::Import, :valid_options => %w(lock dry_run force revision quiet verbose) |
| 66 | 65 | command :convert, Piston::Commands::Convert, :valid_options => %w(lock verbose dry_run) |
| 67 | 66 | command :unlock, Piston::Commands::Unlock, :valid_options => %w(force dry_run verbose) |
| ... | ...@@ -1,8 +1,5 @@ |
| 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 | 3 | * Per http://rubyforge.org/tracker/?func=detail&atid=8179&aid=10717&group_id=2105 |
| 7 | 4 | Don't set LC_ALL, but set LANGUAGE so that repositories with foreign |
| 8 | 5 | characters can be used. Thanks go to Per Wigren. |
| ... | ...@@ -11,6 +11,16 @@ |
| 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 | |
| 14 | 24 | def update(dir) |
| 15 | 25 | return unless File.directory?(dir) |
| 16 | 26 | return skip(dir, "locked") unless svn(:propget, Piston::LOCKED, dir) == '' |
| ... | ...@@ -104,6 +114,11 @@ |
| 104 | 114 | FileUtils.cp(File.join(dir.tmp, file), File.join(dir, file)) |
| 105 | 115 | end |
| 106 | 116 | |
| 117 | def skip(dir, msg, header=true) |
| 118 | logging_stream.print "Skipping '#{dir}': " if header |
| 119 | logging_stream.puts msg |
| 120 | end |
| 121 | |
| 107 | 122 | def self.help |
| 108 | 123 | "Updates all or specified folders to the latest revision" |
| 109 | 124 | end |
| ... | ...@@ -3,8 +3,8 @@ |
| 3 | 3 | module Piston |
| 4 | 4 | module VERSION #:nodoc: |
| 5 | 5 | MAJOR = 1 |
| 6 | | MINOR = 4 |
| 7 | | TINY = 0 |
| 6 | MINOR = 3 |
| 7 | TINY = 3 |
| 8 | 8 | |
| 9 | 9 | STRING = [MAJOR, MINOR, TINY].join('.') |
| 10 | 10 | end |
| ... | ...@@ -1,55 +0,0 @@ |
| 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 |
To list