Skip to content
This repository was archived by the owner on Sep 10, 2023. It is now read-only.

Commit 47e0d80

Browse files
author
crazy-max
committed
Init repo with WebSVN bundles from Neard
0 parents  commit 47e0d80

File tree

439 files changed

+82451
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

439 files changed

+82451
-0
lines changed

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Eclipse
2+
.settings
3+
.buildpath
4+
.project
5+
.jsdtscope
6+
*.launch
7+
8+
# Ant
9+
build.properties
10+
build.xml
11+
12+
# Neard
13+
.dev

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changelog
2+
3+
## r1 (2016/04/07)
4+
5+
This release works since **[Neard 1.0.0](https://github.com/crazy-max/neard/releases/tag/v1.0.0)**
6+
7+
* Init repo with WebSVN bundles from [Neard](https://github.com/crazy-max/neard)

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
This a sub-repo of [Neard project](https://github.com/crazy-max/neard) involving WebSVN app bundles.
2+
3+
## Installation
4+
5+
* Download and install [Neard](https://github.com/crazy-max/neard).
6+
* If you already have installed Neard, stop it.
7+
* Download [a WebSVN bundle](#download).
8+
* Extract archive in `neard\apps\websvn\`. Directory structure example :
9+
10+
```
11+
[-] neard
12+
| [-] apps
13+
| | [-] websvn
14+
| | | [-] websvn2.3.3
15+
| | | neard.conf
16+
```
17+
18+
* Edit the `neard.conf` file and replace the key `websvnVersion` with the correct version. (eg. `websvnVersion="2.3.3"`)
19+
* Edit the `alias/websvn.conf` file and replace the lines with the correct version. (Not necessary since Neard 1.0.18)
20+
* Start Neard.
21+
22+
## Download
23+
24+
![](https://raw.github.com/crazy-max/neard-app-websvn/master/img/star-20160403.png) : Default bundle on Neard.
25+
26+
| | WebSVN release date | Neard release | Download |
27+
| -----------------|:---------------------:|:-------------:|:--------:|
28+
| **WebSVN 2.3.3** ![](https://raw.github.com/crazy-max/neard-app-websvn/master/img/star-20160403.png) | 2011/06/27 | [r1](https://github.com/crazy-max/neard-app-websvn/releases/tag/r1) | [neard-websvn-2.3.3-r1.zip](https://github.com/crazy-max/neard-app-websvn/releases/download/r1/neard-websvn-2.3.3-r1.zip) |
29+
30+
## Sources
31+
32+
* http://www.websvn.info/
33+
34+
## Issues
35+
36+
Issues must be reported on [Neard repository](https://github.com/crazy-max/neard/issues).<br />
37+
Please read [Found a bug?](https://github.com/crazy-max/neard#found-a-bug) section before reporting an issue.

bin/websvn2.3.3/blame.php

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
<?php
2+
// WebSVN - Subversion repository viewing via the web using PHP
3+
// Copyright (C) 2004-2006 Tim Armes
4+
//
5+
// This program is free software; you can redistribute it and/or modify
6+
// it under the terms of the GNU General Public License as published by
7+
// the Free Software Foundation; either version 2 of the License, or
8+
// (at your option) any later version.
9+
//
10+
// This program is distributed in the hope that it will be useful,
11+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
// GNU General Public License for more details.
14+
//
15+
// You should have received a copy of the GNU General Public License
16+
// along with this program; if not, write to the Free Software
17+
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18+
//
19+
// --
20+
//
21+
// blame.php
22+
//
23+
// Show the blame information of a file.
24+
//
25+
26+
require_once 'include/setup.php';
27+
require_once 'include/svnlook.php';
28+
require_once 'include/utils.php';
29+
require_once 'include/template.php';
30+
31+
$vars['action'] = $lang['BLAME'];
32+
33+
// Make sure that we have a repository
34+
if ($rep) {
35+
$svnrep = new SVNRepository($rep);
36+
37+
// If there's no revision info, go to the lastest revision for this path
38+
$history = $svnrep->getLog($path, 'HEAD', 1, false, 2, ($path == '/') ? '' : $peg);
39+
if (!$history) {
40+
unset($vars['error']);
41+
$history = $svnrep->getLog($path, '', '', false, 2, ($path == '/') ? '' : $peg);
42+
if (!$history) {
43+
header('HTTP/1.x 404 Not Found', true, 404);
44+
$vars['error'] = $lang['NOPATH'];
45+
}
46+
}
47+
$youngest = ($history && isset($history->entries[0])) ? $history->entries[0]->rev : false;
48+
49+
if (empty($rev)) {
50+
$rev = $youngest;
51+
} else {
52+
$history = $svnrep->getLog($path, $rev, '', false, 2, $peg);
53+
if (!$history) {
54+
header('HTTP/1.x 404 Not Found', true, 404);
55+
$vars['error'] = $lang['NOPATH'];
56+
}
57+
}
58+
59+
if ($path{0} != '/') {
60+
$ppath = '/'.$path;
61+
} else {
62+
$ppath = $path;
63+
}
64+
65+
// Find the parent path (or the whole path if it's already a directory)
66+
$pos = strrpos($ppath, '/');
67+
$parent = substr($ppath, 0, $pos + 1);
68+
69+
$vars['rev'] = $rev;
70+
$vars['peg'] = $peg;
71+
$vars['path'] = escape($ppath);
72+
73+
if (isset($history->entries[0])) {
74+
$vars['log'] = xml_entities($history->entries[0]->msg);
75+
$vars['date'] = $history->entries[0]->date;
76+
$vars['age'] = datetimeFormatDuration(time() - strtotime($history->entries[0]->date));
77+
$vars['author'] = $history->entries[0]->author;
78+
}
79+
80+
createPathLinks($rep, $ppath, $passrev, $peg);
81+
$passRevString = createRevAndPegString($rev, $peg);
82+
83+
if ($rev != $youngest) {
84+
$vars['goyoungesturl'] = $config->getURL($rep, $path, 'blame').createRevAndPegString('', $peg);
85+
$vars['goyoungestlink'] = '<a href="'.$vars['goyoungesturl'].'"'.($youngest ? ' title="'.$lang['REV'].' '.$youngest.'"' : '').'>'.$lang['GOYOUNGEST'].'</a>';
86+
}
87+
88+
$revurl = $config->getURL($rep, $path, 'blame');
89+
if ($rev < $youngest) {
90+
$history2 = $svnrep->getLog($path, $rev, $youngest, false, 2, $peg);
91+
if (isset($history2->entries[1])) {
92+
$nextRev = $history2->entries[1]->rev;
93+
if ($nextRev != $youngest) {
94+
$vars['nextrev'] = $nextRev;
95+
$vars['nextrevurl'] = $revurl.createRevAndPegString($nextRev, $peg);
96+
}
97+
}
98+
unset($vars['error']);
99+
}
100+
101+
if (isset($history->entries[1])) {
102+
$prevRev = $history->entries[1]->rev;
103+
$prevPath = $history->entries[1]->path;
104+
$vars['prevrev'] = $prevRev;
105+
$vars['prevrevurl'] = $revurl.createRevAndPegString($prevRev, $peg);
106+
}
107+
108+
$vars['revurl'] = $config->getURL($rep, $path, 'revision').$passRevString;
109+
$vars['revlink'] = '<a href="'.$vars['revurl'].'">'.$lang['LASTMOD'].'</a>';
110+
111+
$vars['logurl'] = $config->getURL($rep, $path, 'log').$passRevString;
112+
$vars['loglink'] = '<a href="'.$vars['logurl'].'">'.$lang['VIEWLOG'].'</a>';
113+
114+
$vars['filedetailurl'] = $config->getURL($rep, $path, 'file').$passRevString;
115+
$vars['filedetaillink'] = '<a href="'.$vars['filedetailurl'].'">'.$lang['FILEDETAIL'].'</a>';
116+
117+
if ($history == null || count($history->entries) > 1) {
118+
$vars['diffurl'] = $config->getURL($rep, $path, 'diff').$passRevString;
119+
$vars['difflink'] = '<a href="'.$vars['diffurl'].'">'.$lang['DIFFPREV'].'</a>';
120+
}
121+
122+
if ($rep->isRssEnabled()) {
123+
$vars['rssurl'] = $config->getURL($rep, $path, 'rss').createRevAndPegString('', $peg);
124+
$vars['rsslink'] = '<a href="'.$vars['rssurl'].'">'.$lang['RSSFEED'].'</a>';
125+
}
126+
127+
// Check for binary file type before grabbing blame information.
128+
$svnMimeType = $svnrep->getProperty($path, 'svn:mime-type', $rev, $peg);
129+
130+
if (!$rep->getIgnoreSvnMimeTypes() && preg_match('~application/*~', $svnMimeType)) {
131+
$vars['warning'] = 'Cannot display blame info for binary file. (svn:mime-type = '.$svnMimeType.')';
132+
$vars['javascript'] = '';
133+
} else {
134+
// Get the contents of the file
135+
$tfname = tempnamWithCheck($config->getTempDir(), '');
136+
$highlighted = $svnrep->getFileContents($path, $tfname, $rev, $peg, '', 'line');
137+
138+
if ($file = fopen($tfname, 'r')) {
139+
// Get the blame info
140+
$tbname = tempnamWithCheck($config->getTempDir(), '');
141+
142+
$svnrep->getBlameDetails($path, $tbname, $rev, $peg);
143+
144+
if ($blame = fopen($tbname, 'r')) {
145+
// Create an array of version/author/line
146+
147+
$index = 0;
148+
$seen_rev = array();
149+
$last_rev = '';
150+
$row_class = '';
151+
152+
while (!feof($blame) && !feof($file)) {
153+
$blameline = fgets($blame);
154+
155+
if ($blameline != '') {
156+
list($revision, $author, $remainder) = sscanf($blameline, '%d %s %s');
157+
$empty = !$remainder;
158+
159+
$listing[$index]['lineno'] = $index + 1;
160+
161+
if ($last_rev != $revision) {
162+
$url = $config->getURL($rep, $path, 'blame');
163+
$listing[$index]['revision'] = '<a id="l'.$index.'-rev" class="blame-revision" href="'.$url.'rev='.$revision.'&amp;peg='.$rev.'">'.$revision.'</a>';
164+
$seen_rev[$revision] = 1;
165+
$row_class = ($row_class == 'light') ? 'dark' : 'light';
166+
$listing[$index]['author'] = $author;
167+
} else {
168+
$listing[$index]['revision'] = '';
169+
$listing[$index]['author'] = '';
170+
}
171+
172+
$listing[$index]['row_class'] = $row_class;
173+
$last_rev = $revision;
174+
175+
$line = rtrim(fgets($file));
176+
if (!$highlighted)
177+
$line = escape(toOutputEncoding($line));
178+
$listing[$index]['line'] = ($empty) ? '&nbsp;' : wrapInCodeTagIfNecessary($line);
179+
$index++;
180+
}
181+
}
182+
fclose($blame);
183+
}
184+
fclose($file);
185+
@unlink($tbname);
186+
}
187+
@unlink($tfname);
188+
189+
// Build the necessary JavaScript as an array of lines, then join them with \n
190+
$javascript = array();
191+
$javascript[] = '<script type="text/javascript" src="'.$locwebsvnhttp.'/javascript/blame-popup.js"></script>';
192+
$javascript[] = '<script type="text/javascript">';
193+
$javascript[] = '/* <![CDATA[ */';
194+
$javascript[] = 'var rev = new Array();';
195+
196+
ksort($seen_rev); // Sort revisions in descending order by key
197+
if (empty($peg))
198+
$peg = $rev;
199+
if (!isset($vars['warning'])) {
200+
foreach ($seen_rev as $key => $val) {
201+
$history = $svnrep->getLog($path, $key, $key, false, 1, $peg);
202+
if ($history) {
203+
$javascript[] = 'rev['.$key.'] = \'<div class="date">'.$history->curEntry->date.'</div><div class="msg">'.addslashes(preg_replace('/\n/', ' ', $history->curEntry->msg)).'</div>\';';
204+
}
205+
}
206+
}
207+
$javascript[] = '/* ]]> */';
208+
$javascript[] = '</script>';
209+
$vars['javascript'] = implode("\n", $javascript);
210+
}
211+
212+
if (!$rep->hasReadAccess($path, false)) {
213+
$vars['error'] = $lang['NOACCESS'];
214+
checkSendingAuthHeader($rep);
215+
}
216+
217+
} else {
218+
header('HTTP/1.x 404 Not Found', true, 404);
219+
}
220+
221+
renderTemplate('blame');

bin/websvn2.3.3/cache/tmp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This file is here so that the directory gets included in the ZIP files.

0 commit comments

Comments
 (0)