Patches: Browse | Submit New | Admin

[#16698] Fix for add and delete problems when that action has already been done in the non-vendor branch repository

Date:
2007-12-29 23:03
Priority:
3
Submitted By:
Walter McGinnis (mcginniwa)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Fix for add and delete problems when that action has already been done in the non-vendor branch repository

Detailed description
I've changed lib/piston/command.rb line 43 from:

      raise "Command #{command} resulted in an error:\n\n#{result}" unless $?.exitstatus.zero?

to

      # Walter McGinnis, 2007-12-30
      # handle cases where
      # the file or directory has already been added to svn repository
      # or the file or directory has already been deleted
      unless $?.exitstatus.zero?
        should_raise = true
        path_arg = args.last.to_s
        # this could probably be more succint to check that
        # that the file has also been added to version control
        svn_status = `svn status --verbose #{path_arg}`
        case args[0].to_s
        when 'remove'
          # if it has already been deleted, just skip
          should_raise = false if !File.exists?(path_arg) and svn_status.empty?
        when *['add', 'mkdir']
          # if it has already been added to repository, just skip
          should_raise = false if File.exists?(path_arg) and !svn_status.empty?
        end
        raise "Command #{command} resulted in an error:\n\n#{result}" if should_raise
      end

Still warns about the missing or already existing files, but continues on.  What do you think?

Cheers,
Walter

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item