Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

continue towards update selected files only

  • Loading branch information...
commit c81ab2719be09e4ba9a8ef99932fbde503fb737e 1 parent 1f568f6
@dvwright authored
Showing with 50 additions and 23 deletions.
  1. +2 −1  lib/svn_wc_broker.rb
  2. +48 −22 lib/svn_wc_client.rb
View
3  lib/svn_wc_broker.rb
@@ -85,12 +85,13 @@ def do_requested_action(params)
if files and files.to_a.size > 0
files_striped = ret_just_files_list(
process_params_to_list_of_files(files.to_s))
+ #return svn_results debug_request(process_params_to_list_of_files(files.to_s))
@files = files_striped.to_a.uniq
#@files.uniq
#return svn_results debug_request(@files)
# diff need status info
- if ('diff' == action )
+ if ('diff' == action || 'update_selected' == action)
@files = process_params_to_list_of_files(files.to_s).to_a.uniq
end
View
70 lib/svn_wc_client.rb
@@ -132,15 +132,17 @@ def svn_status_show_updates(f_regex=nil, f_amt=nil, dir=nil)
svn_list(f_regex, f_amt, dir)
end
- def not_new_rev(svn_e)
+ def not_new_rev(svn_e, ent)
lcr = svn_e[:last_changed_rev] rescue nil
return true if lcr.nil?
- enty = lcr[:entry]
- return true if enty.nil?
- # skip if file is on remote and local, we want remote only
- return true if File.file?(enty) || File.directory?(enty)
# return false if is a new revision
- return false if lcr > @current_rev
+ #return false if lcr > @current_rev
+ #raise "1.#{enty} 2.#{svn_e[:entry]} 3.#{svn_e.inspect}"
+ if lcr > @current_rev
+ # skip if file is on remote and local, we want remote only
+ return true if File.file?(ent) || File.directory?(ent)
+ return false
+ end
true
end
private :not_new_rev
@@ -221,21 +223,45 @@ def svn_update
remote_files
end
+ ## update, returns 'updated' message, revision and update data
+ #def svn_update_selected
+ # get_repo
+ # remote_files = Array.new
+ # begin
+ # #@error = "1.#{@files} 2.#{@files.class} 3.#{@files[1]}"
+ # #remote_files.push info_data
+ # raise 'svn update selected requires file list!' if @files.nil?
+ # @content = 'Updated: Revision '
+ # @content << @@svn_wc.update(@files.to_s).to_a.join("\n")
+ # remote_files.push info_data
+ # rescue SvnWc::RepoAccessError => e
+ # @error = e.message
+ # remote_files.push info_data
+ # end
+ # remote_files
+ #end
+
# update, returns 'updated' message, revision and update data
def svn_update_selected
- get_repo
- remote_files = Array.new
- begin
- @content = 'Updated: Revision '
- @content << @@svn_wc.update(@files.to_s).to_a.join("\n")
- remote_files.push info_data
- #@error = "1.#{@files} 2.#{files}"
- #remote_files.push info_data
- rescue SvnWc::RepoAccessError => e
- @error = e.message
- remote_files.push info_data
- end
- remote_files
+ raise 'svn update selected requires file list!' if @files.nil?
+ remote_files = Array.new
+ @files.each { |f_list_str|
+ f_stat, f_name = f_list_str.split(/\s/)
+ #@error = "1.#{@files} 2.#{@files.class} 3.#{@files[1]}"
+ #remote_files.push info_data
+ begin
+ get_repo
+ @path = f_name
+ #@content = @@svn_wc.diff(f_name).to_s
+ @content = 'Updated: Revision '
+ @content << @@svn_wc.update(f_name).to_s
+ remote_files.push info_data
+ rescue SvnWc::RepoAccessError => e
+ @error = e.message
+ remote_files.push info_data
+ end
+ }
+ remote_files
end
# delete
@@ -311,10 +337,10 @@ def svn_list(f_regex=nil, f_amt=nil, dir=nil)
begin
l_svn_list = Array.new
@@svn_wc.list(dir).each { |el|
- next if not_new_rev(el) if @current_rev
- status_info = {}
- #fqpn = File.join(@repo_root, el[:entry])
fqpn = File.join(dir, el[:entry])
+ next if not_new_rev(el, fqpn) if @current_rev
+ #fqpn = File.join(@repo_root, el[:entry])
+ status_info = {}
#status_info[:last_changed_rev] = el[:last_changed_rev]
status_info[:entry_name] = fqpn
status_info[:status] = ' '
Please sign in to comment.
Something went wrong with that request. Please try again.