svn_wc_tree 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +4 -0
- data/LICENSE +165 -0
- data/Manifest +57 -0
- data/README.rdoc +333 -0
- data/bin/svn_wc_tree +190 -0
- data/cgi/svn_wc_broker.cgi +38 -0
- data/lib/svn_wc_broker.rb +161 -0
- data/lib/svn_wc_client.rb +266 -0
- data/svn_conf.yaml +9 -0
- data/svn_wc_tree/css/swt.css +4 -0
- data/svn_wc_tree/img/swt_spinner.gif +0 -0
- data/svn_wc_tree/index.html +137 -0
- data/svn_wc_tree/index.php +29 -0
- data/svn_wc_tree/js/jquery-1.3.2.js +4376 -0
- data/svn_wc_tree/js/jquery.blockUI-2.31.js +477 -0
- data/svn_wc_tree/js/jquery.cookie.js +96 -0
- data/svn_wc_tree/js/jquery.tree.checkbox.js +75 -0
- data/svn_wc_tree/js/jquery.tree.js +2058 -0
- data/svn_wc_tree/js/source/jquery.tree.js +2058 -0
- data/svn_wc_tree/js/source/jquery.tree.min.js +1 -0
- data/svn_wc_tree/js/source/lib/jquery.cookie.js +96 -0
- data/svn_wc_tree/js/source/lib/jquery.hotkeys.js +244 -0
- data/svn_wc_tree/js/source/lib/jquery.js +19 -0
- data/svn_wc_tree/js/source/lib/jquery.metadata.js +122 -0
- data/svn_wc_tree/js/source/lib/sarissa.js +110 -0
- data/svn_wc_tree/js/source/plugins/_jquery.tree.rtl.js +32 -0
- data/svn_wc_tree/js/source/plugins/jquery.tree.checkbox.js +75 -0
- data/svn_wc_tree/js/source/plugins/jquery.tree.contextmenu.js +129 -0
- data/svn_wc_tree/js/source/plugins/jquery.tree.cookie.js +70 -0
- data/svn_wc_tree/js/source/plugins/jquery.tree.hotkeys.js +78 -0
- data/svn_wc_tree/js/source/plugins/jquery.tree.metadata.js +17 -0
- data/svn_wc_tree/js/source/plugins/jquery.tree.themeroller.js +33 -0
- data/svn_wc_tree/js/source/plugins/jquery.tree.xml_flat.js +123 -0
- data/svn_wc_tree/js/source/plugins/jquery.tree.xml_nested.js +124 -0
- data/svn_wc_tree/js/source/themes/apple/bg.jpg +0 -0
- data/svn_wc_tree/js/source/themes/apple/dot_for_ie.gif +0 -0
- data/svn_wc_tree/js/source/themes/apple/icons.png +0 -0
- data/svn_wc_tree/js/source/themes/apple/style.css +34 -0
- data/svn_wc_tree/js/source/themes/apple/throbber.gif +0 -0
- data/svn_wc_tree/js/source/themes/checkbox/dot_for_ie.gif +0 -0
- data/svn_wc_tree/js/source/themes/checkbox/icons.png +0 -0
- data/svn_wc_tree/js/source/themes/checkbox/style.css +38 -0
- data/svn_wc_tree/js/source/themes/checkbox/throbber.gif +0 -0
- data/svn_wc_tree/js/source/themes/classic/dot_for_ie.gif +0 -0
- data/svn_wc_tree/js/source/themes/classic/icons.png +0 -0
- data/svn_wc_tree/js/source/themes/classic/style.css +31 -0
- data/svn_wc_tree/js/source/themes/classic/throbber.gif +0 -0
- data/svn_wc_tree/js/source/themes/default/dot_for_ie.gif +0 -0
- data/svn_wc_tree/js/source/themes/default/icons.png +0 -0
- data/svn_wc_tree/js/source/themes/default/style.css +30 -0
- data/svn_wc_tree/js/source/themes/default/throbber.gif +0 -0
- data/svn_wc_tree/js/source/themes/themeroller/dot_for_ie.gif +0 -0
- data/svn_wc_tree/js/source/themes/themeroller/icons.png +0 -0
- data/svn_wc_tree/js/source/themes/themeroller/style.css +39 -0
- data/svn_wc_tree/js/source/themes/themeroller/throbber.gif +0 -0
- data/svn_wc_tree/js/swt.js +534 -0
- data/svn_wc_tree.conf +9 -0
- metadata +122 -0
data/ChangeLog
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,165 @@
|
|
1
|
+
GNU LESSER GENERAL PUBLIC LICENSE
|
2
|
+
Version 3, 29 June 2007
|
3
|
+
|
4
|
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
5
|
+
Everyone is permitted to copy and distribute verbatim copies
|
6
|
+
of this license document, but changing it is not allowed.
|
7
|
+
|
8
|
+
|
9
|
+
This version of the GNU Lesser General Public License incorporates
|
10
|
+
the terms and conditions of version 3 of the GNU General Public
|
11
|
+
License, supplemented by the additional permissions listed below.
|
12
|
+
|
13
|
+
0. Additional Definitions.
|
14
|
+
|
15
|
+
As used herein, "this License" refers to version 3 of the GNU Lesser
|
16
|
+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
17
|
+
General Public License.
|
18
|
+
|
19
|
+
"The Library" refers to a covered work governed by this License,
|
20
|
+
other than an Application or a Combined Work as defined below.
|
21
|
+
|
22
|
+
An "Application" is any work that makes use of an interface provided
|
23
|
+
by the Library, but which is not otherwise based on the Library.
|
24
|
+
Defining a subclass of a class defined by the Library is deemed a mode
|
25
|
+
of using an interface provided by the Library.
|
26
|
+
|
27
|
+
A "Combined Work" is a work produced by combining or linking an
|
28
|
+
Application with the Library. The particular version of the Library
|
29
|
+
with which the Combined Work was made is also called the "Linked
|
30
|
+
Version".
|
31
|
+
|
32
|
+
The "Minimal Corresponding Source" for a Combined Work means the
|
33
|
+
Corresponding Source for the Combined Work, excluding any source code
|
34
|
+
for portions of the Combined Work that, considered in isolation, are
|
35
|
+
based on the Application, and not on the Linked Version.
|
36
|
+
|
37
|
+
The "Corresponding Application Code" for a Combined Work means the
|
38
|
+
object code and/or source code for the Application, including any data
|
39
|
+
and utility programs needed for reproducing the Combined Work from the
|
40
|
+
Application, but excluding the System Libraries of the Combined Work.
|
41
|
+
|
42
|
+
1. Exception to Section 3 of the GNU GPL.
|
43
|
+
|
44
|
+
You may convey a covered work under sections 3 and 4 of this License
|
45
|
+
without being bound by section 3 of the GNU GPL.
|
46
|
+
|
47
|
+
2. Conveying Modified Versions.
|
48
|
+
|
49
|
+
If you modify a copy of the Library, and, in your modifications, a
|
50
|
+
facility refers to a function or data to be supplied by an Application
|
51
|
+
that uses the facility (other than as an argument passed when the
|
52
|
+
facility is invoked), then you may convey a copy of the modified
|
53
|
+
version:
|
54
|
+
|
55
|
+
a) under this License, provided that you make a good faith effort to
|
56
|
+
ensure that, in the event an Application does not supply the
|
57
|
+
function or data, the facility still operates, and performs
|
58
|
+
whatever part of its purpose remains meaningful, or
|
59
|
+
|
60
|
+
b) under the GNU GPL, with none of the additional permissions of
|
61
|
+
this License applicable to that copy.
|
62
|
+
|
63
|
+
3. Object Code Incorporating Material from Library Header Files.
|
64
|
+
|
65
|
+
The object code form of an Application may incorporate material from
|
66
|
+
a header file that is part of the Library. You may convey such object
|
67
|
+
code under terms of your choice, provided that, if the incorporated
|
68
|
+
material is not limited to numerical parameters, data structure
|
69
|
+
layouts and accessors, or small macros, inline functions and templates
|
70
|
+
(ten or fewer lines in length), you do both of the following:
|
71
|
+
|
72
|
+
a) Give prominent notice with each copy of the object code that the
|
73
|
+
Library is used in it and that the Library and its use are
|
74
|
+
covered by this License.
|
75
|
+
|
76
|
+
b) Accompany the object code with a copy of the GNU GPL and this license
|
77
|
+
document.
|
78
|
+
|
79
|
+
4. Combined Works.
|
80
|
+
|
81
|
+
You may convey a Combined Work under terms of your choice that,
|
82
|
+
taken together, effectively do not restrict modification of the
|
83
|
+
portions of the Library contained in the Combined Work and reverse
|
84
|
+
engineering for debugging such modifications, if you also do each of
|
85
|
+
the following:
|
86
|
+
|
87
|
+
a) Give prominent notice with each copy of the Combined Work that
|
88
|
+
the Library is used in it and that the Library and its use are
|
89
|
+
covered by this License.
|
90
|
+
|
91
|
+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
92
|
+
document.
|
93
|
+
|
94
|
+
c) For a Combined Work that displays copyright notices during
|
95
|
+
execution, include the copyright notice for the Library among
|
96
|
+
these notices, as well as a reference directing the user to the
|
97
|
+
copies of the GNU GPL and this license document.
|
98
|
+
|
99
|
+
d) Do one of the following:
|
100
|
+
|
101
|
+
0) Convey the Minimal Corresponding Source under the terms of this
|
102
|
+
License, and the Corresponding Application Code in a form
|
103
|
+
suitable for, and under terms that permit, the user to
|
104
|
+
recombine or relink the Application with a modified version of
|
105
|
+
the Linked Version to produce a modified Combined Work, in the
|
106
|
+
manner specified by section 6 of the GNU GPL for conveying
|
107
|
+
Corresponding Source.
|
108
|
+
|
109
|
+
1) Use a suitable shared library mechanism for linking with the
|
110
|
+
Library. A suitable mechanism is one that (a) uses at run time
|
111
|
+
a copy of the Library already present on the user's computer
|
112
|
+
system, and (b) will operate properly with a modified version
|
113
|
+
of the Library that is interface-compatible with the Linked
|
114
|
+
Version.
|
115
|
+
|
116
|
+
e) Provide Installation Information, but only if you would otherwise
|
117
|
+
be required to provide such information under section 6 of the
|
118
|
+
GNU GPL, and only to the extent that such information is
|
119
|
+
necessary to install and execute a modified version of the
|
120
|
+
Combined Work produced by recombining or relinking the
|
121
|
+
Application with a modified version of the Linked Version. (If
|
122
|
+
you use option 4d0, the Installation Information must accompany
|
123
|
+
the Minimal Corresponding Source and Corresponding Application
|
124
|
+
Code. If you use option 4d1, you must provide the Installation
|
125
|
+
Information in the manner specified by section 6 of the GNU GPL
|
126
|
+
for conveying Corresponding Source.)
|
127
|
+
|
128
|
+
5. Combined Libraries.
|
129
|
+
|
130
|
+
You may place library facilities that are a work based on the
|
131
|
+
Library side by side in a single library together with other library
|
132
|
+
facilities that are not Applications and are not covered by this
|
133
|
+
License, and convey such a combined library under terms of your
|
134
|
+
choice, if you do both of the following:
|
135
|
+
|
136
|
+
a) Accompany the combined library with a copy of the same work based
|
137
|
+
on the Library, uncombined with any other library facilities,
|
138
|
+
conveyed under the terms of this License.
|
139
|
+
|
140
|
+
b) Give prominent notice with the combined library that part of it
|
141
|
+
is a work based on the Library, and explaining where to find the
|
142
|
+
accompanying uncombined form of the same work.
|
143
|
+
|
144
|
+
6. Revised Versions of the GNU Lesser General Public License.
|
145
|
+
|
146
|
+
The Free Software Foundation may publish revised and/or new versions
|
147
|
+
of the GNU Lesser General Public License from time to time. Such new
|
148
|
+
versions will be similar in spirit to the present version, but may
|
149
|
+
differ in detail to address new problems or concerns.
|
150
|
+
|
151
|
+
Each version is given a distinguishing version number. If the
|
152
|
+
Library as you received it specifies that a certain numbered version
|
153
|
+
of the GNU Lesser General Public License "or any later version"
|
154
|
+
applies to it, you have the option of following the terms and
|
155
|
+
conditions either of that published version or of any later version
|
156
|
+
published by the Free Software Foundation. If the Library as you
|
157
|
+
received it does not specify a version number of the GNU Lesser
|
158
|
+
General Public License, you may choose any version of the GNU Lesser
|
159
|
+
General Public License ever published by the Free Software Foundation.
|
160
|
+
|
161
|
+
If the Library as you received it specifies that a proxy can decide
|
162
|
+
whether future versions of the GNU Lesser General Public License shall
|
163
|
+
apply, that proxy's public statement of acceptance of any version is
|
164
|
+
permanent authorization for you to choose that version for the
|
165
|
+
Library.
|
data/Manifest
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
bin/svn_wc_tree
|
2
|
+
cgi/svn_wc_broker.cgi
|
3
|
+
ChangeLog
|
4
|
+
lib/svn_wc_broker.rb
|
5
|
+
lib/svn_wc_client.rb
|
6
|
+
LICENSE
|
7
|
+
Manifest
|
8
|
+
README.rdoc
|
9
|
+
svn_conf.yaml
|
10
|
+
svn_wc_tree/css/swt.css
|
11
|
+
svn_wc_tree/img/swt_spinner.gif
|
12
|
+
svn_wc_tree/index.html
|
13
|
+
svn_wc_tree/index.php
|
14
|
+
svn_wc_tree.conf
|
15
|
+
svn_wc_tree/js/swt.js
|
16
|
+
svn_wc_tree/js/jquery-1.3.2.js
|
17
|
+
svn_wc_tree/js/jquery.blockUI-2.31.js
|
18
|
+
svn_wc_tree/js/jquery.cookie.js
|
19
|
+
svn_wc_tree/js/jquery.tree.checkbox.js
|
20
|
+
svn_wc_tree/js/jquery.tree.js
|
21
|
+
svn_wc_tree/js/source/jquery.tree.js
|
22
|
+
svn_wc_tree/js/source/jquery.tree.min.js
|
23
|
+
svn_wc_tree/js/source/lib/jquery.cookie.js
|
24
|
+
svn_wc_tree/js/source/lib/jquery.hotkeys.js
|
25
|
+
svn_wc_tree/js/source/lib/jquery.js
|
26
|
+
svn_wc_tree/js/source/lib/jquery.metadata.js
|
27
|
+
svn_wc_tree/js/source/lib/sarissa.js
|
28
|
+
svn_wc_tree/js/source/plugins/_jquery.tree.rtl.js
|
29
|
+
svn_wc_tree/js/source/plugins/jquery.tree.checkbox.js
|
30
|
+
svn_wc_tree/js/source/plugins/jquery.tree.contextmenu.js
|
31
|
+
svn_wc_tree/js/source/plugins/jquery.tree.cookie.js
|
32
|
+
svn_wc_tree/js/source/plugins/jquery.tree.hotkeys.js
|
33
|
+
svn_wc_tree/js/source/plugins/jquery.tree.metadata.js
|
34
|
+
svn_wc_tree/js/source/plugins/jquery.tree.themeroller.js
|
35
|
+
svn_wc_tree/js/source/plugins/jquery.tree.xml_flat.js
|
36
|
+
svn_wc_tree/js/source/plugins/jquery.tree.xml_nested.js
|
37
|
+
svn_wc_tree/js/source/themes/apple/bg.jpg
|
38
|
+
svn_wc_tree/js/source/themes/apple/dot_for_ie.gif
|
39
|
+
svn_wc_tree/js/source/themes/apple/icons.png
|
40
|
+
svn_wc_tree/js/source/themes/apple/style.css
|
41
|
+
svn_wc_tree/js/source/themes/apple/throbber.gif
|
42
|
+
svn_wc_tree/js/source/themes/checkbox/dot_for_ie.gif
|
43
|
+
svn_wc_tree/js/source/themes/checkbox/icons.png
|
44
|
+
svn_wc_tree/js/source/themes/checkbox/style.css
|
45
|
+
svn_wc_tree/js/source/themes/checkbox/throbber.gif
|
46
|
+
svn_wc_tree/js/source/themes/classic/dot_for_ie.gif
|
47
|
+
svn_wc_tree/js/source/themes/classic/icons.png
|
48
|
+
svn_wc_tree/js/source/themes/classic/style.css
|
49
|
+
svn_wc_tree/js/source/themes/classic/throbber.gif
|
50
|
+
svn_wc_tree/js/source/themes/default/dot_for_ie.gif
|
51
|
+
svn_wc_tree/js/source/themes/default/icons.png
|
52
|
+
svn_wc_tree/js/source/themes/default/style.css
|
53
|
+
svn_wc_tree/js/source/themes/default/throbber.gif
|
54
|
+
svn_wc_tree/js/source/themes/themeroller/dot_for_ie.gif
|
55
|
+
svn_wc_tree/js/source/themes/themeroller/icons.png
|
56
|
+
svn_wc_tree/js/source/themes/themeroller/style.css
|
57
|
+
svn_wc_tree/js/source/themes/themeroller/throbber.gif
|
data/README.rdoc
ADDED
@@ -0,0 +1,333 @@
|
|
1
|
+
= svn_wc_tree
|
2
|
+
|
3
|
+
A Web application front end that operates on the working copy of an
|
4
|
+
Subversion (SVN) repository.
|
5
|
+
|
6
|
+
|
7
|
+
== VERSION:
|
8
|
+
|
9
|
+
Version 0.0.2
|
10
|
+
|
11
|
+
NOTE: THIS IS ALPHA QUALITY SOFTWARE, use at your own risk!
|
12
|
+
|
13
|
+
|
14
|
+
== SYNOPSIS:
|
15
|
+
|
16
|
+
Install easy option 1:
|
17
|
+
|
18
|
+
PHP INSTALL:
|
19
|
+
$ sudo svn_wc_tree --html /var/www --php true --conf_location /opt/svn_conf.yaml
|
20
|
+
|
21
|
+
Navigate browser (javascript required) to to html docs dir specified above:
|
22
|
+
(i.e. DocumentRoot /var/www)
|
23
|
+
http://localhost/svn_wc_tree/index.html
|
24
|
+
|
25
|
+
|
26
|
+
Install easy option 2:
|
27
|
+
|
28
|
+
CGI INSTALL:
|
29
|
+
$ sudo svn_wc_tree --html /var/www --cgi /usr/lib/cgi-bin \
|
30
|
+
--post_to_url 'http://localhost/cgi-bin/svn_wc_broker.cgi' \
|
31
|
+
--conf_location /opt/svn_conf.yaml
|
32
|
+
|
33
|
+
Navigate browser (javascript required) to to html docs dir specified above:
|
34
|
+
(i.e. DocumentRoot /var/www)
|
35
|
+
http://localhost/svn_wc_tree/index.html
|
36
|
+
|
37
|
+
|
38
|
+
== DESCRIPTION:
|
39
|
+
|
40
|
+
This CGI/AJAX Web Application is designed to operate on a working copy of
|
41
|
+
a remote Subversion repository.
|
42
|
+
|
43
|
+
Currently, it provides only very basic SVN functions (see FEATURES).
|
44
|
+
|
45
|
+
It does not do any sort of repository administration type operations, just
|
46
|
+
working directory repository management.
|
47
|
+
|
48
|
+
== FEATURES:
|
49
|
+
|
50
|
+
* Current supported operations
|
51
|
+
- open
|
52
|
+
- checkout/co
|
53
|
+
- list/ls
|
54
|
+
- update/up
|
55
|
+
- commit/ci
|
56
|
+
- status/stat
|
57
|
+
- diff
|
58
|
+
- info
|
59
|
+
- add
|
60
|
+
- revert
|
61
|
+
- delete
|
62
|
+
- svn+ssh is our primary connection use case, however can connect to and operate on file:/// URI as well
|
63
|
+
|
64
|
+
== REQUIREMENTS:
|
65
|
+
|
66
|
+
* Requires that the Subversion (SWIG) Ruby Bindings are installed.
|
67
|
+
* Requires that the svn_wc gem is installed. (i.e. sudo gem install svn_wc)
|
68
|
+
* Ruby (tested with 1.8.6, 1.8.7)
|
69
|
+
* CGI or PHP enabled
|
70
|
+
|
71
|
+
== INSTALL:
|
72
|
+
|
73
|
+
This library is intended to be installed as a Gem. (hosted on gemcutter.org)
|
74
|
+
|
75
|
+
$ gem install svn_wc_tree
|
76
|
+
|
77
|
+
|
78
|
+
== OVERVIEW:
|
79
|
+
|
80
|
+
This serverfault post describes what I was looking for and what I am trying to
|
81
|
+
satisfy with this web application:
|
82
|
+
|
83
|
+
"I want a web interface to manage a WORKING COPY of a repository (NOT the repository itself).
|
84
|
+
There are lots of already made tools to manage the repository, but I also have not found a
|
85
|
+
single one to manage a remote working copy. I need a user-friendly interface to perform stuff like:
|
86
|
+
"svn status", "svn info", "svn commit", "svn update", "svn revert",
|
87
|
+
"svn add", "svn delete" and "svn diff"... upon a WORKING COPY which resides
|
88
|
+
in a remote host. (I'm not interested in the repository, I'm interested in the WORKING COPY
|
89
|
+
management.)
|
90
|
+
I don't want to do SSH login and perform these commands. I want to enable
|
91
|
+
not-advanced users to do some stuff in the hosted working copy, using a
|
92
|
+
web interface,...
|
93
|
+
|
94
|
+
* {serverfault link}[http://serverfault.com/questions/52532/svn-web-interface/67788#67788]
|
95
|
+
|
96
|
+
== USAGE:
|
97
|
+
|
98
|
+
Javascript enabled web browser
|
99
|
+
|
100
|
+
== DIAGNOSTICS
|
101
|
+
|
102
|
+
* Errors:
|
103
|
+
An error such as: "Error: Error: can't convert nil into String" probably
|
104
|
+
means that you did not set CONF_FILE in the cgi file. (post install)
|
105
|
+
|
106
|
+
An error such as:
|
107
|
+
/build/buildd/subversion-1.6.5dfsg/subversion/libsvn_ra_svn/streams.c:75:
|
108
|
+
Svn::Error::RaSvnConnectionClosed:
|
109
|
+
|
110
|
+
probably means the app cannot make an ssh connection to the host.
|
111
|
+
solution: set up ssh keys for the user the app is trying to connect as
|
112
|
+
(note, this will probably the user your web server is running as)
|
113
|
+
|
114
|
+
"status check Failed:
|
115
|
+
/build/buildd/subversion-1.6.5dfsg/subversion/libsvn_wc/lock.c:572:
|
116
|
+
Svn::Error::WcNotDirectory: '/tmp/repo' is not a working copy
|
117
|
+
#<SvnWc::RepoAccess:0xb73a0874>"
|
118
|
+
|
119
|
+
I don't remember
|
120
|
+
|
121
|
+
|
122
|
+
An error such as:
|
123
|
+
Repository: undefined
|
124
|
+
User: undefined
|
125
|
+
Config File: undefined
|
126
|
+
|
127
|
+
Error: can't convert nil into String
|
128
|
+
|
129
|
+
Probably means you haven't specified a config file path.
|
130
|
+
|
131
|
+
* Exceptions:
|
132
|
+
|
133
|
+
== CONFIGURATION AND ENVIRONMENT:
|
134
|
+
|
135
|
+
* In order to make use of this module,...
|
136
|
+
|
137
|
+
configuration file: (is the the YAML format)
|
138
|
+
|
139
|
+
$ cat svnwc_conf.yaml
|
140
|
+
# svn connection info
|
141
|
+
#svn_repo_master : file:///tmp/svnrepo
|
142
|
+
svn_repo_master : svn+ssh://example.com/opt/svnrepo
|
143
|
+
svn_repo_working_copy : /usr/local/svn/repo_root
|
144
|
+
svn_user : svn_test_user
|
145
|
+
svn_pass : svn_test_pass
|
146
|
+
svn_repo_config_path : /opt/config
|
147
|
+
|
148
|
+
* possibly you want to integrate this seamlessly into your existing web
|
149
|
+
application, an iframe may work well for this. The iframe height parameter
|
150
|
+
does not work as expected, this work around hack helps.
|
151
|
+
(credit: http://guymal.com/mycode/100_percent_iframe/)
|
152
|
+
|
153
|
+
<script language="javascript">
|
154
|
+
<!--
|
155
|
+
function resize_iframe(id) {
|
156
|
+
var height=window.innerWidth; //Firefox
|
157
|
+
if (document.body.clientHeight) height=document.body.clientHeight; //IE
|
158
|
+
document.getElementById(id).style.height=parseInt(height-document.getElementById(id).offsetTop-8)+"px"; //resize the iframe according to the size of the window
|
159
|
+
//document.getElementById(id).height=document.body.offsetHeight-document.getElementById(id).offsetTop-26;
|
160
|
+
}
|
161
|
+
//-->
|
162
|
+
</script>
|
163
|
+
<table style="height:100%;width:100%">
|
164
|
+
<tbody>
|
165
|
+
<tr>
|
166
|
+
<td style="height:100%;width:100%">
|
167
|
+
<iframe id='svn_frame' src="/svn_wc_tree/index.html" width="100%"
|
168
|
+
height="100%" marginwidth="0" marginheight="0"
|
169
|
+
vspace="0" hspace="0" frameborder="1"
|
170
|
+
onload='resize_iframe("svn_frame")'
|
171
|
+
style="margin:0; padding:0; height:100%;width:100%;
|
172
|
+
display:block;border:none;">
|
173
|
+
<p>Your browser does not support iframes.</p>
|
174
|
+
</iframe>
|
175
|
+
</td>
|
176
|
+
</tr>
|
177
|
+
</tbody>
|
178
|
+
</table>
|
179
|
+
|
180
|
+
* If you want to integrate this into a rails web app. (and eliminate cgi).
|
181
|
+
Create a new controller such as:
|
182
|
+
|
183
|
+
begin; require 'rubygems'; rescue LoadError; end
|
184
|
+
require 'fileutils'
|
185
|
+
require 'svn_wc_broker'
|
186
|
+
|
187
|
+
class SvnController < ApplicationController
|
188
|
+
#before_filter :session_required
|
189
|
+
|
190
|
+
include SvnWcBroker
|
191
|
+
|
192
|
+
def index
|
193
|
+
@conf_file = '/var/www/config/svn_conf.yaml'
|
194
|
+
|
195
|
+
if request.get? then render :template => 'svn/index' and return false end
|
196
|
+
|
197
|
+
if request.post?
|
198
|
+
set_conf_file(@conf_file)
|
199
|
+
render :json => handle_responses(params) and return false
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
end
|
204
|
+
|
205
|
+
And Create a new view (svn/index.html.erb) with the iframe content from above.
|
206
|
+
|
207
|
+
|
208
|
+
* NOTE/WARNING: Keep in mind, that whatever approach you take.
|
209
|
+
"/svn_wc_tree/index.html" is accessible to the public,
|
210
|
+
which is very BAD. (see mod_rewrite rules below).
|
211
|
+
Please provide some protection to the web accessible
|
212
|
+
SVN tree page, "/svn_wc_tree/index.html", an .htaccess or
|
213
|
+
cookie scheme, still depending on your set up anyone with
|
214
|
+
access to your web app will have rw access to this svn page.
|
215
|
+
|
216
|
+
* Here are some mod_rewrite rules you could use at a mininum.
|
217
|
+
# add to httpd.conf (or last resort .htaccess)
|
218
|
+
|
219
|
+
# add rules for svn_wc_tree
|
220
|
+
# disallow direct access to svn_wc_tree/index.html
|
221
|
+
#RewriteCond %{HTTP_REFERER} ^$ [NC]
|
222
|
+
# only allow this referrer to access svn_wc_tree/index.html
|
223
|
+
RewriteCond %{HTTP_REFERER} !^http://(.*)/cgi-bin/svn_wc_broker.cgi [NC]
|
224
|
+
RewriteRule ^(/svn_wc_tree/index.html)$ - [F,L]
|
225
|
+
# allow other resources to pass for svn_wc_tree
|
226
|
+
RewriteRule ^(/svn_wc_tree/)(.*) $1$2 [PT,L]
|
227
|
+
|
228
|
+
|
229
|
+
* NOTE: The most efficient use of this web app is to run it as a controller in a ROR
|
230
|
+
application, the second most efficient way is as a CGI app, if you have no
|
231
|
+
choice run as a PHP app, which is the easiest (and slowest) method.
|
232
|
+
|
233
|
+
* This library should work anywhere that the 'subversion-rubybindings' are installed
|
234
|
+
|
235
|
+
== TESTS:
|
236
|
+
|
237
|
+
TODO: (cant figure out how to make this work on the JsTree ajax widget,
|
238
|
+
will look into selinium)
|
239
|
+
<strike>Tests, this webapp has functional tests written against the front end.
|
240
|
+
The tests are written in celerity, which is API compatible with Watir.
|
241
|
+
(more at {Celerity}[http://celerity.rubyforge.org/])
|
242
|
+
Celerity is written in jruby, so to run the tests, you'll need jruby
|
243
|
+
and celerity installed.</strike>
|
244
|
+
|
245
|
+
basic REST interface tests in progress,...
|
246
|
+
|
247
|
+
on Ubuntu.
|
248
|
+
$ sudo apt-get install jruby1.2
|
249
|
+
$ sudo jruby -S gem install celerity
|
250
|
+
Successfully installed celerity-0.7.9
|
251
|
+
$ jruby tests/front_end_functional.rb
|
252
|
+
|
253
|
+
|
254
|
+
== DEPENDENCIES:
|
255
|
+
|
256
|
+
require 'cgi'
|
257
|
+
require 'yaml'
|
258
|
+
require 'json'
|
259
|
+
require 'pathname'
|
260
|
+
require 'fileutils'
|
261
|
+
require 'find'
|
262
|
+
require 'svn_wc_broker' (provided with svn_wc_tree)
|
263
|
+
require 'svn_wc'
|
264
|
+
|
265
|
+
|
266
|
+
== INCOMPATIBILITIES:
|
267
|
+
|
268
|
+
javascript disabled and non javascript enabled browsers
|
269
|
+
|
270
|
+
|
271
|
+
== BUGS AND LIMITATIONS:
|
272
|
+
|
273
|
+
This library currently provides only very basic svn operations.
|
274
|
+
|
275
|
+
|
276
|
+
== SUPPORT:
|
277
|
+
|
278
|
+
ri SvnRepoClient
|
279
|
+
ri SvnWcBroker
|
280
|
+
ri SvnWc::RepoAccess
|
281
|
+
svn_wc_tree --html
|
282
|
+
|
283
|
+
* {svn_wc_tree general page}[http://www.dwright.us/misc/svn_wc_tree]
|
284
|
+
|
285
|
+
|
286
|
+
== CHANGELOG:
|
287
|
+
|
288
|
+
See the ChangeLog file for details.
|
289
|
+
|
290
|
+
|
291
|
+
== LICENSE AND COPYRIGHT:
|
292
|
+
|
293
|
+
Copyright 2010 David Wright (david_v_wright@yahoo.com), all rights reserved.
|
294
|
+
|
295
|
+
|
296
|
+
svn_wc_tree 0.0.2 is released under the LGPL license.
|
297
|
+
|
298
|
+
|
299
|
+
== AUTHOR:
|
300
|
+
|
301
|
+
Author:: {David Wright}[http://www.dwright.us/] <david_v_wright@yahoo.com>
|
302
|
+
|
303
|
+
|
304
|
+
=== KEYWORDS:
|
305
|
+
|
306
|
+
* Ruby (SWIG) SVN bindings, ruby+svn, ruby, subversion, svn, rubysvn, Subversion extensions in Ruby, Web Application, GUI
|
307
|
+
|
308
|
+
|
309
|
+
== ACKNOWLEDGEMENTS:
|
310
|
+
|
311
|
+
thanks to the poster on serverfault for identifying what I was also looking for
|
312
|
+
|
313
|
+
== ERRATA:
|
314
|
+
|
315
|
+
For testing it is also possible to set the $SVN_SSH variable specifying the
|
316
|
+
private key to use with -i so that you can try connecting as different users.
|
317
|
+
For example:
|
318
|
+
|
319
|
+
export SVN_SSH="ssh -i /home/dwright/.ssh/alt.key
|
320
|
+
|
321
|
+
|
322
|
+
* The --post_to_url is a required argument, which set's the Javascript file
|
323
|
+
to point to the correct url, you shouldn't ever have to but can hand edit
|
324
|
+
the file:
|
325
|
+
vim {DocumentRoot}/svn_wc_tree/js/swt.js
|
326
|
+
// change for your host if necessary
|
327
|
+
var POST_URL = 'http://localhost/cgi-bin/svn_wc_broker.cgi';
|
328
|
+
|
329
|
+
Edit:
|
330
|
+
$ sudo vim /usr/lib/cgi-bin/svn_wc_broker.cgi
|
331
|
+
# set conf file path to your svn repo info config file
|
332
|
+
CONF_FILE = 'abs_path/to/svn_conf_file.yaml'
|
333
|
+
|