svn_wc_tree 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/lib/svn_wc_broker.rb +3 -3
- data/lib/svn_wc_client.rb +14 -1
- data/svn_wc_tree/js/swt.js +29 -3
- metadata +4 -4
data/README.rdoc
CHANGED
data/lib/svn_wc_broker.rb
CHANGED
@@ -79,6 +79,7 @@ module SvnWcBroker
|
|
79
79
|
|
80
80
|
action = params['svn_action'].to_s.strip.downcase
|
81
81
|
files = params['svn_files']
|
82
|
+
@dir = params['dir']
|
82
83
|
|
83
84
|
begin
|
84
85
|
if files and files.to_a.size > 0
|
@@ -97,10 +98,9 @@ module SvnWcBroker
|
|
97
98
|
# eval known actions only
|
98
99
|
# svn_list takes args # svn_status takes args
|
99
100
|
if action == 'list' || action == 'status'
|
100
|
-
#eval("svn_#{action}('#{params['filter_re']}','#{params['filter_amt']}')")
|
101
101
|
eval("svn_#{action}('#{params['filter_re']}','#{params['filter_amt']}','#{params['dir']}')")
|
102
102
|
else
|
103
|
-
#
|
103
|
+
# NOTE only eval known supported actions
|
104
104
|
eval("svn_#{action}") if SUPPORTED_ACTIONS.index(action)
|
105
105
|
end
|
106
106
|
rescue Exception => exn
|
@@ -158,7 +158,7 @@ module SvnWcBroker
|
|
158
158
|
|
159
159
|
def ret_just_files_list(file_status_list) # :nodoc:
|
160
160
|
just_files = Array.new
|
161
|
-
return file_status_list unless file_status_list.
|
161
|
+
return file_status_list unless file_status_list.respond_to?('each')
|
162
162
|
file_status_list.each do |f_list_str|
|
163
163
|
f_stat, f_name = f_list_str.split(/\s/)
|
164
164
|
just_files.push(f_name)
|
data/lib/svn_wc_client.rb
CHANGED
@@ -131,6 +131,7 @@ module SvnRepoClient
|
|
131
131
|
get_repo
|
132
132
|
rev = Array.new
|
133
133
|
begin
|
134
|
+
raise 'svn commit requires file list!' if @files.empty?
|
134
135
|
@content = "Committed. Revision: #{@@svn_wc.commit(@files)}
|
135
136
|
Files:
|
136
137
|
#{@files.join("\n")}"
|
@@ -147,6 +148,7 @@ module SvnRepoClient
|
|
147
148
|
get_repo
|
148
149
|
rev = Array.new
|
149
150
|
begin
|
151
|
+
raise 'svn add requires file list!' if @files.empty?
|
150
152
|
@content = "Added. #{@@svn_wc.add(@files).to_a.join("\n")}"
|
151
153
|
rev.push info_data
|
152
154
|
rescue SvnWc::RepoAccessError => e
|
@@ -160,8 +162,17 @@ module SvnRepoClient
|
|
160
162
|
def svn_update
|
161
163
|
get_repo
|
162
164
|
remote_files = Array.new
|
165
|
+
@dir = @repo_root unless @dir and not @dir.empty?
|
163
166
|
begin
|
164
|
-
|
167
|
+
#@content = "Updated: Revision #{@@svn_wc.update.to_a.join("\n")}"
|
168
|
+
@content = 'Updated: Revision '
|
169
|
+
@content << @@svn_wc.update(@dir).to_a.join("\n")
|
170
|
+
#if @dir and not @dir.empty?
|
171
|
+
# @content = 'Updated: Revision '
|
172
|
+
# @content << @@svn_wc.update(@dir).to_a.join("\n")
|
173
|
+
#else
|
174
|
+
# @content = "Updated: Revision #{@@svn_wc.update.to_a.join("\n")}"
|
175
|
+
#end
|
165
176
|
remote_files.push info_data
|
166
177
|
rescue SvnWc::RepoAccessError => e
|
167
178
|
@error = e.message
|
@@ -175,6 +186,7 @@ module SvnRepoClient
|
|
175
186
|
get_repo
|
176
187
|
rev = Array.new
|
177
188
|
begin
|
189
|
+
raise 'svn delete requires file list!' if @files.empty?
|
178
190
|
@content = "Deleted. #{@@svn_wc.delete(@files).to_a.join("\n")}"
|
179
191
|
rev.push info_data
|
180
192
|
rescue SvnWc::RepoAccessError => e
|
@@ -203,6 +215,7 @@ module SvnRepoClient
|
|
203
215
|
get_repo
|
204
216
|
infos = Array.new
|
205
217
|
begin
|
218
|
+
raise 'svn revert requires file list!' if @files.empty?
|
206
219
|
@content = "Reverted: #{@@svn_wc.revert(@files)}
|
207
220
|
Files:
|
208
221
|
#{@files.join("\n")}"
|
data/svn_wc_tree/js/swt.js
CHANGED
@@ -26,6 +26,7 @@ var POST_URL = '';
|
|
26
26
|
|
27
27
|
var STATUS_SPACER = "\t"; // " "
|
28
28
|
var SVN_ACTION = '';
|
29
|
+
var PASS_USER_SET_DIR = '';
|
29
30
|
|
30
31
|
// jQuery BlockUI Plugin (v2)
|
31
32
|
$.blockUI.defaults.message = '<img src="img/swt_spinner.gif" /> Processing... ';
|
@@ -186,10 +187,28 @@ $(document).ready(function(){
|
|
186
187
|
var re_filter = $("#swt_filter_re").val();
|
187
188
|
var dir = $("#swt_dir").val();
|
188
189
|
//console.log(re_filter);
|
190
|
+
PASS_USER_SET_DIR = '';
|
189
191
|
// set current filter to a cookie
|
190
192
|
if (re_filter) $.cookie('swt_filter_re', re_filter);
|
191
193
|
if (dir) $.cookie('swt_dir', dir);
|
194
|
+
|
192
195
|
window.location.reload();
|
196
|
+
|
197
|
+
//console.log(document.referrer);
|
198
|
+
//('#svn_frame').attr('src', $('#svn_frame').attr('src'));
|
199
|
+
//try{
|
200
|
+
// //document.getElementById('svn_frame').location.reload();
|
201
|
+
// if ($.browser.msie){
|
202
|
+
// document.getElementById('svn_frame').contentWindow.location.reload(true);
|
203
|
+
// } else {
|
204
|
+
// document.getElementById('svn_frame').src = document.getElementById('svn_frame').src;
|
205
|
+
// //('#svn_frame').attr('src', $('#svn_frame').attr('src'));
|
206
|
+
// }
|
207
|
+
//}
|
208
|
+
//catch(e){
|
209
|
+
// alert('moo');
|
210
|
+
// //window.location.reload();
|
211
|
+
//}
|
193
212
|
//history.go();
|
194
213
|
},
|
195
214
|
separator_before : true
|
@@ -252,11 +271,13 @@ $(document).ready(function(){
|
|
252
271
|
},
|
253
272
|
beforedata : function(NODE, TREE_OBJ) {
|
254
273
|
//console.log('beforedata' + $(NODE).attr('id'));
|
274
|
+
|
255
275
|
return {
|
256
276
|
'do_svn_action': 'Do Svn Action',
|
257
277
|
'svn_action' : SVN_ACTION,
|
258
278
|
'svn_files' : [gather_selected_files()],
|
259
279
|
'dir' : $("#swt_dir").val(),
|
280
|
+
'udir' : PASS_USER_SET_DIR,
|
260
281
|
'filter_re' : $("#swt_filter_re").val(),
|
261
282
|
'filter_amt' : $("#swt_filter_amt").val()
|
262
283
|
}
|
@@ -356,7 +377,9 @@ $(document).ready(function(){
|
|
356
377
|
POST_URL, {
|
357
378
|
'do_svn_action': 'Do Svn Action',
|
358
379
|
'svn_action' : svn_action,
|
359
|
-
'svn_files' : [gather_selected_files()]
|
380
|
+
'svn_files' : [gather_selected_files()],
|
381
|
+
'dir' : $("#swt_dir").val(),
|
382
|
+
'udir' : PASS_USER_SET_DIR
|
360
383
|
},
|
361
384
|
// server response for svn action
|
362
385
|
function(resp){
|
@@ -370,6 +393,7 @@ $(document).ready(function(){
|
|
370
393
|
|
371
394
|
function gather_selected_files(){
|
372
395
|
var svn_files = new Array;
|
396
|
+
PASS_USER_SET_DIR = '';
|
373
397
|
($.tree.plugins.checkbox.get_checked(
|
374
398
|
$.tree.reference("#svn_repo_entries_tree"))).each(
|
375
399
|
function () {
|
@@ -383,19 +407,21 @@ $(document).ready(function(){
|
|
383
407
|
//var abs_pn = info[0] + ' ' + $("#svn_local_repo_root").val() + info[1]
|
384
408
|
//console.log('in checked files');
|
385
409
|
//console.log(info);
|
410
|
+
PASS_USER_SET_DIR = info[0];
|
386
411
|
|
387
|
-
var abs_pn = info[0] + ' ' + info[1]
|
412
|
+
var abs_pn = info[0] + ' ' + info[1];
|
388
413
|
|
389
414
|
// XXX this is a hck fix, figure it out
|
390
415
|
// odd bug, svn_files /home/httpd undefined
|
391
416
|
// just repo root sent, other files not seen!?
|
392
|
-
if (info[1] === undefined) abs_pn = info[1] + ' ' + info[0]
|
417
|
+
if (info[1] === undefined) abs_pn = info[1] + ' ' + info[0];
|
393
418
|
|
394
419
|
svn_files.push(abs_pn);
|
395
420
|
}
|
396
421
|
//console.log(svn_files);
|
397
422
|
}
|
398
423
|
)
|
424
|
+
//console.log(svn_files);
|
399
425
|
return svn_files;
|
400
426
|
}
|
401
427
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: svn_wc_tree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 9
|
10
|
+
version: 0.0.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David Wright
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2012-02-07 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|