Compare commits
98 Commits
feature.is
...
feature.wi
Author | SHA1 | Date | |
---|---|---|---|
|
9a6a6c21f5 | ||
|
69d0384ec3 | ||
|
af956d01dd | ||
|
0002e9bd21 | ||
|
6c62fbd19f | ||
|
7abcc29e60 | ||
|
2e1369184b | ||
|
b39fe8595c | ||
|
5fefc26543 | ||
|
a37b222878 | ||
|
c9f2575469 | ||
|
5101ae5f35 | ||
|
bd94d5bf68 | ||
|
aa09862059 | ||
|
f9629f3f7b | ||
|
884f50155c | ||
|
cf684c1514 | ||
|
6c9b6b5309 | ||
|
a7f283256a | ||
|
4506e1d2b5 | ||
|
70f67e6bc6 | ||
|
05816cb75a | ||
|
91b189b75f | ||
|
623c562054 | ||
|
2a55024640 | ||
|
8a9f8c66e8 | ||
|
81f433085a | ||
|
6e59a0a526 | ||
|
8397d86313 | ||
|
b0ac05b608 | ||
|
48c3989ae3 | ||
|
b949b7e83a | ||
|
ad7fad9fbe | ||
|
d2db3b16d2 | ||
|
ae11b1de4a | ||
|
6f620e3f54 | ||
|
810b753edf | ||
|
958fb1b9ad | ||
|
48992adefa | ||
|
d95e1e13e5 | ||
|
381dc5b8f7 | ||
|
464c1a8ef5 | ||
|
e5b10a8494 | ||
|
ffc49b9ea6 | ||
|
0efc14dd6f | ||
|
4fb15ccb7d | ||
|
234b70845c | ||
|
6abd0b6faa | ||
|
fef2bd15bf | ||
|
74d07d8fb8 | ||
|
473e9153ed | ||
|
efa10c9afd | ||
|
7438a2bf19 | ||
|
2e0995abac | ||
|
c84afd0f78 | ||
|
b1276dff6c | ||
|
b413b7ee89 | ||
|
f19f07ec59 | ||
|
83761c66c5 | ||
|
d0e2977746 | ||
|
1be91e5a2a | ||
|
15d4d1aa7d | ||
|
708b90fccd | ||
|
ac7a4c4aa5 | ||
|
b90246a239 | ||
|
a9d327d54f | ||
|
eb8fd0aa55 | ||
|
813184f06c | ||
|
ef2d3a9af9 | ||
|
9a8bd464a3 | ||
|
9e2ea7404b | ||
|
160d11b89b | ||
|
d860f299fd | ||
|
33882d4fa7 | ||
|
85978a4d18 | ||
|
e1e7696d53 | ||
|
695428075b | ||
|
e7c2e721b4 | ||
|
13fad756ab | ||
|
1f0791df0e | ||
|
a2c832a130 | ||
|
b17de014ec | ||
|
b1b72190e1 | ||
|
2ff2f888bc | ||
|
57c2389aae | ||
|
d54c86f813 | ||
|
05a9697007 | ||
|
945429abf0 | ||
|
a016bcb51b | ||
|
f2b1ce795c | ||
|
3a8c56acc4 | ||
|
7b2552f940 | ||
|
324b202215 | ||
|
2c2da6082a | ||
|
dd3fbbd7e4 | ||
|
9bbcd571ec | ||
|
d1bcdcda20 | ||
|
4879d64989 |
19
.gitignore
vendored
19
.gitignore
vendored
@@ -1,14 +1,19 @@
|
||||
*~
|
||||
tmp
|
||||
.buildpath
|
||||
.externalToolBuilders
|
||||
.project
|
||||
.settings
|
||||
.tx/config
|
||||
attachments
|
||||
indefero-*.zip
|
||||
src/IDF/conf/idf.php
|
||||
src/IDF/conf/idf.test.php
|
||||
www/test.php
|
||||
www/media/upload
|
||||
src/IDF/gettexttemplates
|
||||
indefero-*.zip
|
||||
src/IDF/conf/path.php
|
||||
.tx/config
|
||||
src/IDF/gettexttemplates
|
||||
src/IDF/locale/idf.pot.bak
|
||||
test/config.php
|
||||
test/test.db
|
||||
test/tmp
|
||||
test/config.php
|
||||
tmp
|
||||
www/media/upload
|
||||
www/test.php
|
||||
|
5
AUTHORS
5
AUTHORS
@@ -17,22 +17,27 @@ Much appreciated contributors (in alphabetical order):
|
||||
Denis Kot <denis.kot@gmail.com> - Russian translation
|
||||
Dmitry Dulepov <dmitryd>
|
||||
Fernando Sayago Gil <mikados.mikados@gmail.com> - Spanish translation
|
||||
Gert van Valkenhoef <gertvv>
|
||||
Jakub Viták <mainiak@gmail.com> - Czech translation
|
||||
Janez Troha <http://www.dz0ny.info> - Slovenian translation
|
||||
Jean-Philippe Fleury <jpfleury>
|
||||
Jerry <lxb429@gmail.com> - Chinese translation
|
||||
Julien Issler <julien@issler.net>
|
||||
Litew <litew9@gmail.com> - Russian translation
|
||||
Ludovic Bellière <xrogaan>
|
||||
Manuel Eidenberger <eidenberger@gmail.com>
|
||||
Matthew Dawson <mjd>
|
||||
Matías Halles <matias@halles.cl>
|
||||
Mehdi Kabab <http://pioupioum.fr/>
|
||||
Nicolas Lassalle <nicolas@beroot.org> - Subversion support
|
||||
Ozan <uobasar@gmail.com> - Turkish translation
|
||||
Patrick Georgi <patrick.georgi@coresystems.de>
|
||||
Pedro Kiefer <pedro@kiefer.com.br> - Brazilian Portuguese translation
|
||||
Raphaël Emourgeon <raphael>
|
||||
Samuel Suther <info@suther.de> - German translation
|
||||
Sindre R. Myren <sindrero@stud.ntnu.no>
|
||||
Stewart Platt <stew@futurete.ch>
|
||||
Stéphane Baron <sbaron>
|
||||
Thomas Keller <me@thomaskeller.biz> - Monotone support
|
||||
Vladimir Solomatin <slash>
|
||||
William Martin <william.martin@lcpc.fr>
|
||||
|
10
Makefile
10
Makefile
@@ -62,11 +62,11 @@ pot-update: pluf_path
|
||||
fi
|
||||
touch src/IDF/locale/idf.pot;
|
||||
# Extract string
|
||||
@cd src; php $(PLUF_PATH)/extracttemplates.php IDF/conf/idf.php IDF/gettexttemplates
|
||||
@cd src; php "$(PLUF_PATH)/extracttemplates.php" IDF/conf/idf.php IDF/gettexttemplates
|
||||
@cd src; for phpfile in `find . -iname "*.php"`; do \
|
||||
printf "Parsing file : "$$phpfile"\n"; \
|
||||
xgettext -o idf.pot -p ./IDF/locale/ --from-code=UTF-8 -j \
|
||||
--keyword --keyword=__ --keyword=_n:1,2 -L PHP $$phpfile ; \
|
||||
--keyword --keyword=__ --keyword=_n:1,2 -L PHP "$$phpfile" ; \
|
||||
done
|
||||
# Remove tmp folder
|
||||
rm -Rf src/IDF/gettexttemplates
|
||||
@@ -76,7 +76,7 @@ pot-update: pluf_path
|
||||
po-update: pluf_path
|
||||
@for pofile in `ls src/IDF/locale/*/idf.po`; do \
|
||||
printf "Updating file : "$$pofile"\n"; \
|
||||
msgmerge -v -U $$pofile src/IDF/locale/idf.pot; \
|
||||
msgmerge -v -U "$$pofile" src/IDF/locale/idf.pot; \
|
||||
printf "\n"; \
|
||||
done
|
||||
|
||||
@@ -144,7 +144,7 @@ po-stats:
|
||||
--pretty=format:%h`.zip
|
||||
|
||||
db-install:
|
||||
@cd src && php $(PLUF_PATH)/migrate.php --conf=IDF/conf/idf.php -a -d -i
|
||||
@cd src && php "$(PLUF_PATH)/migrate.php" --conf=IDF/conf/idf.php -a -d -i
|
||||
|
||||
db-update:
|
||||
@cd src && php $(PLUF_PATH)/migrate.php --conf=IDF/conf/idf.php -a -d
|
||||
@cd src && php "$(PLUF_PATH)/migrate.php" --conf=IDF/conf/idf.php -a -d
|
||||
|
86
NEWS.mdtext
86
NEWS.mdtext
@@ -1,38 +1,83 @@
|
||||
# InDefero 1.2 - xxx xxx xx xx:xx 2011 UTC
|
||||
# InDefero 1.3 - xxx xxx xx xx:xx:xx UTC 201X
|
||||
|
||||
ATTENTION: You need Pluf [324ae60b](http://projects.ceondo.com/p/pluf/source/commit/324ae60b)
|
||||
## New Features
|
||||
|
||||
## Bugfixes
|
||||
|
||||
## Documentation
|
||||
|
||||
## Translations
|
||||
|
||||
# InDefero 1.2 - Sun Nov 6 23:04:00 UTC 2011
|
||||
|
||||
ATTENTION: You need Pluf [46b7f251](http://projects.ceondo.com/p/pluf/source/commit/46b7f251)
|
||||
or newer to properly run this version of Indefero!
|
||||
|
||||
## New Features
|
||||
|
||||
- Indefero's issue tracker can now bi-directionally link issues with variable, configurable
|
||||
terms, such as "is related to", "is blocked by" or "is duplicated by" (issue 638)
|
||||
- Mercurial source views now show parent revisions (if any) and detailed change information
|
||||
- Indefero's issue tracker can now bi-directionally link issues with variable,
|
||||
configurable terms, such as "is related to", "is blocked by" or
|
||||
"is duplicated by" (issue 638)
|
||||
- When you search for issues, the results can further be refined by issue state
|
||||
(open or closed) and label (partially implements issue 548)
|
||||
- Source and diff views now make characters like line endings, tabs and other
|
||||
"invisible" control characters visible on hover and cope with long lines much
|
||||
better (issue 636)
|
||||
- Mercurial source views now show parent revisions (if any) and detailed change
|
||||
information
|
||||
- Subversion source views now show detailed change information (issue 622)
|
||||
- File download URLs now contain the file name rather than the upload id; old links still work though (issues 559 and 686)
|
||||
- Display monotone file and directory attributes in the tree and file view
|
||||
- File download URLs now contain the file name rather than the upload id;
|
||||
old links still work though (issues 559 and 686)
|
||||
- monotone file and directory attributes are displayed in the tree and file view
|
||||
(needs a monotone with an interface version of 13.1 or newer)
|
||||
- The context area is now kept in view when a page scrolls down several pages
|
||||
- A summary section has been added to the issue tracker with statistics about
|
||||
open / closed issues, unresolved issues grouped by tags and owners
|
||||
- The project list and title has gathered a customizable icon for each project
|
||||
- The download section now provides MD5 checksums for uploaded files
|
||||
- Wiki pages now come with a designated stylesheet for printer output (issue 713)
|
||||
|
||||
## Bugfixes
|
||||
|
||||
- The SVN interface acts more robust if an underlying repository has been restructured (issue 364)
|
||||
- Git's cron job doesn't erase manually added keys anymore (issue 247)
|
||||
- The SVN interface acts more robust if an underlying repository has been
|
||||
restructured (issues 364 and 721)
|
||||
- monotone zip archive entries now all carry the revision date as mtime (issue 645)
|
||||
- Timeline only displays filter options for items a user has actually access to (issue 655)
|
||||
- The timeline only now only displays filter options for items a user has
|
||||
actually access to (issue 655)
|
||||
- The log, tags and branches parsers for Mercurial are more robust now (issue 663)
|
||||
- Fix SSH public key parsing issues and improve the check for existing, uploaded keys (issue 679)
|
||||
- Several SSH public key parsing issues have been fixed and the check for existing,
|
||||
uploaded keys has been improved (issue 679)
|
||||
- Diff views now show empty context lines for git and hg again (issue 688)
|
||||
- Let the SVN command line client not store the login credentials we give him as arguments
|
||||
- The SVN command line client no longer accidential tries to store the login
|
||||
credentials we give him as arguments for the user executing the SVN command
|
||||
- The usher section in the forge administration no longer displays a bogus
|
||||
server enty in case no monotone server is configured in the connected
|
||||
usher instance
|
||||
- Prevent a timeout from popping up when Usher is restarted (issue 695)
|
||||
- The SyncMonotone plugin now cleans up partial artifacts it created during the addition of
|
||||
a new project or monotone key, in case an error popped up in the middle (issue 697)
|
||||
- Better error detection and reporting in the SyncMonotone plugin
|
||||
ATTENTION: This needs Pluf 46b7f251 or newer!
|
||||
- Fix the branch links users of the Subversion frontend get when they enter a wrong revision
|
||||
and only display this list if there are any branches available for all SCMs
|
||||
- A timeout that popped up when Usher is restarted has been fixed (issue 695)
|
||||
- The SyncMonotone plugin now cleans up partial artifacts it created during the
|
||||
addition of a new project or monotone key, in case an error popped up in the
|
||||
middle (issue 697)
|
||||
- Indefero now sends the MD5 checksum as HTTP header when downloading a file from the
|
||||
download area; additionally, a unneeded redirect has been removed (issue 716)
|
||||
- Source links without a specific revision did not work due to a wrong regex
|
||||
(issue 730)
|
||||
- Avatar URL generation use correctly the configuration (issue 732)
|
||||
- The SyncGit plugin no longer fails to remove a non-existing post-update hook
|
||||
on repository creation (issue 752)
|
||||
- When uploading a project logo, an existing uploaded file with the same name
|
||||
no longer leads to an error, but is simple overwritten (fixes issue 740)
|
||||
- The error detection and reporting in the SyncMonotone plugin has been improved
|
||||
- The branch links users of the Subversion frontend get when they enter a wrong
|
||||
revision are fixed; this list is now also only displayed (for any SCM) if
|
||||
there are actually branches available in the repository
|
||||
- If git's author name is not encoded in an UTF-8 compatible encoding, skip the
|
||||
author lookup, as we have no information what the author string is actually
|
||||
encoded in
|
||||
- Indefero no longer displays an empty parents paragraph in the commit view for
|
||||
root revisions of a git repository
|
||||
- Indefero now only shows the tags of the closed and not the open issues in the
|
||||
closed issues list
|
||||
|
||||
## Documentation
|
||||
|
||||
@@ -40,6 +85,11 @@ or newer to properly run this version of Indefero!
|
||||
|
||||
## Translations
|
||||
|
||||
- The Russian translation has been enabled by default (thanks for all the great
|
||||
work, Denis Kot and Litew!)
|
||||
- Brazilian Portuguese translation started (thanks to Pedro Kiefer!)
|
||||
- Turkish translation started (thanks to Ozan!)
|
||||
|
||||
# InDefero 1.1.2 - Thu May 26 07:42:25 2011 UTC
|
||||
|
||||
## Bugfixes
|
||||
|
235
src/IDF/Diff.php
235
src/IDF/Diff.php
@@ -35,9 +35,7 @@ class IDF_Diff
|
||||
public function __construct($diff, $path_strip_level = 0)
|
||||
{
|
||||
$this->path_strip_level = $path_strip_level;
|
||||
// this works because in unified diff format even empty lines are
|
||||
// either prefixed with a '+', '-' or ' '
|
||||
$this->lines = preg_split("/\015\012|\015|\012/", $diff, -1, PREG_SPLIT_NO_EMPTY);
|
||||
$this->lines = IDF_FileUtil::splitIntoLines($diff, true);
|
||||
}
|
||||
|
||||
public function parse()
|
||||
@@ -66,12 +64,12 @@ class IDF_Diff
|
||||
}
|
||||
|
||||
// use new file name by default
|
||||
preg_match("/^\+\+\+ ([^\t]+)/", $newfileline, $m);
|
||||
preg_match("/^\+\+\+ ([^\t\n\r]+)/", $newfileline, $m);
|
||||
$current_file = $m[1];
|
||||
if ($current_file === '/dev/null') {
|
||||
// except if it's /dev/null, use the old one instead
|
||||
// eg. mtn 0.48 and newer
|
||||
preg_match("/^--- ([^\t]+)/", $oldfileline, $m);
|
||||
preg_match("/^--- ([^\t\r\n]+)/", $oldfileline, $m);
|
||||
$current_file = $m[1];
|
||||
}
|
||||
if ($this->path_strip_level > 0) {
|
||||
@@ -102,10 +100,11 @@ class IDF_Diff
|
||||
|
||||
while ($i < $diffsize && ($addlines >= 0 || $dellines >= 0)) {
|
||||
$linetype = $this->lines[$i] != '' ? $this->lines[$i][0] : false;
|
||||
$content = substr($this->lines[$i], 1);
|
||||
switch ($linetype) {
|
||||
case ' ':
|
||||
$files[$current_file]['chunks'][$current_chunk][] =
|
||||
array($delstart, $addstart, substr($this->lines[$i++], 1));
|
||||
array($delstart, $addstart, $content);
|
||||
$dellines--;
|
||||
$addlines--;
|
||||
$delstart++;
|
||||
@@ -113,23 +112,26 @@ class IDF_Diff
|
||||
break;
|
||||
case '+':
|
||||
$files[$current_file]['chunks'][$current_chunk][] =
|
||||
array('', $addstart, substr($this->lines[$i++], 1));
|
||||
array('', $addstart, $content);
|
||||
$addlines--;
|
||||
$addstart++;
|
||||
break;
|
||||
case '-':
|
||||
$files[$current_file]['chunks'][$current_chunk][] =
|
||||
array($delstart, '', substr($this->lines[$i++], 1));
|
||||
array($delstart, '', $content);
|
||||
$dellines--;
|
||||
$delstart++;
|
||||
break;
|
||||
case '\\':
|
||||
// ignore newline handling for now, see issue 636
|
||||
$i++;
|
||||
// no new line at the end of this file; remove pseudo new line from last line
|
||||
$cur = count($files[$current_file]['chunks'][$current_chunk]) - 1;
|
||||
$files[$current_file]['chunks'][$current_chunk][$cur][2] =
|
||||
rtrim($files[$current_file]['chunks'][$current_chunk][$cur][2], "\r\n");
|
||||
continue;
|
||||
default:
|
||||
break 2;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$current_chunk++;
|
||||
}
|
||||
@@ -144,46 +146,92 @@ class IDF_Diff
|
||||
public function as_html()
|
||||
{
|
||||
$out = '';
|
||||
foreach ($this->files as $filename=>$file) {
|
||||
foreach ($this->files as $filename => $file) {
|
||||
$pretty = '';
|
||||
$fileinfo = IDF_FileUtil::getMimeType($filename);
|
||||
if (IDF_FileUtil::isSupportedExtension($fileinfo[2])) {
|
||||
$pretty = ' prettyprint';
|
||||
}
|
||||
$out .= "\n".'<table class="diff" summary="">'."\n";
|
||||
$out .= '<tr id="diff-'.md5($filename).'"><th colspan="3">'.Pluf_esc($filename).'</th></tr>'."\n";
|
||||
|
||||
$cc = 1;
|
||||
$offsets = array();
|
||||
$contents = array();
|
||||
|
||||
foreach ($file['chunks'] as $chunk) {
|
||||
foreach ($chunk as $line) {
|
||||
if ($line[0] and $line[1]) {
|
||||
$class = 'diff-c';
|
||||
} elseif ($line[0]) {
|
||||
$class = 'diff-r';
|
||||
list($left, $right, $content) = $line;
|
||||
if ($left and $right) {
|
||||
$class = 'context';
|
||||
} elseif ($left) {
|
||||
$class = 'removed';
|
||||
} else {
|
||||
$class = 'diff-a';
|
||||
}
|
||||
$line_content = self::padLine(Pluf_esc($line[2]));
|
||||
$out .= sprintf('<tr class="diff-line"><td class="diff-lc">%s</td><td class="diff-lc">%s</td><td class="%s%s mono">%s</td></tr>'."\n", $line[0], $line[1], $class, $pretty, $line_content);
|
||||
}
|
||||
if (count($file['chunks']) > $cc)
|
||||
$out .= '<tr class="diff-next"><td>...</td><td>...</td><td> </td></tr>'."\n";
|
||||
$cc++;
|
||||
}
|
||||
$out .= '</table>';
|
||||
}
|
||||
return Pluf_Template::markSafe($out);
|
||||
$class = 'added';
|
||||
}
|
||||
|
||||
public static function padLine($line)
|
||||
{
|
||||
$line = str_replace("\t", ' ', $line);
|
||||
$n = strlen($line);
|
||||
for ($i=0;$i<$n;$i++) {
|
||||
if (substr($line, $i, 1) != ' ') {
|
||||
break;
|
||||
$offsets[] = sprintf('<td>%s</td><td>%s</td>', $left, $right);
|
||||
$content = IDF_FileUtil::emphasizeControlCharacters(Pluf_esc($content));
|
||||
$contents[] = sprintf('<td class="%s%s mono">%s</td>', $class, $pretty, $content);
|
||||
}
|
||||
if (count($file['chunks']) > $cc) {
|
||||
$offsets[] = '<td class="next">...</td><td class="next">...</td>';
|
||||
$contents[] = '<td class="next"></td>';
|
||||
}
|
||||
return str_repeat(' ', $i).substr($line, $i);
|
||||
$cc++;
|
||||
}
|
||||
|
||||
list($added, $removed) = end($file['chunks_def']);
|
||||
|
||||
$added = $added[0] + $added[1];
|
||||
$leftwidth = 0;
|
||||
if ($added > 0)
|
||||
$leftwidth = ((ceil(log10($added)) + 1) * 8) + 12;
|
||||
|
||||
$removed = $removed[0] + $removed[1];
|
||||
$rightwidth = 0;
|
||||
if ($removed > 0)
|
||||
$rightwidth = ((ceil(log10($removed)) + 1) * 8) + 12;
|
||||
|
||||
// we need to correct the width of a single column a little
|
||||
// to take less space and to hide the empty one
|
||||
$class = '';
|
||||
if ($leftwidth == 0) {
|
||||
$class = 'left-hidden';
|
||||
$rightwidth -= floor(log10($removed));
|
||||
}
|
||||
else if ($rightwidth == 0) {
|
||||
$class = 'right-hidden';
|
||||
$leftwidth -= floor(log10($added));
|
||||
}
|
||||
|
||||
$inner_linecounts =
|
||||
'<table class="diff-linecounts '.$class.'">' ."\n".
|
||||
'<colgroup><col width="'.$leftwidth.'" /><col width="'. $rightwidth.'" /></colgroup>' ."\n".
|
||||
'<tr class="line">' .
|
||||
implode('</tr>'."\n".'<tr class="line">', $offsets).
|
||||
'</tr>' ."\n".
|
||||
'</table>' ."\n";
|
||||
|
||||
|
||||
$inner_contents =
|
||||
'<table class="diff-contents">' ."\n".
|
||||
'<tr class="line">' .
|
||||
implode('</tr>'."\n".'<tr class="line">', $contents) .
|
||||
'</tr>' ."\n".
|
||||
'</table>' ."\n";
|
||||
|
||||
$out .= '<table class="diff unified">' ."\n".
|
||||
'<colgroup><col width="'.($leftwidth + $rightwidth + 1).'" /><col width="*" /></colgroup>' ."\n".
|
||||
'<tr id="diff-'.md5($filename).'">'.
|
||||
'<th colspan="2">'.Pluf_esc($filename).'</th>'.
|
||||
'</tr>' ."\n".
|
||||
'<tr>' .
|
||||
'<td>'. $inner_linecounts .'</td>'. "\n".
|
||||
'<td><div class="scroll">'. $inner_contents .'</div></td>'.
|
||||
'</tr>' ."\n".
|
||||
'</table>' ."\n";
|
||||
}
|
||||
|
||||
return Pluf_Template::markSafe($out);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -208,12 +256,12 @@ class IDF_Diff
|
||||
*/
|
||||
public function fileCompare($orig, $chunks, $filename, $context=10)
|
||||
{
|
||||
$orig_lines = preg_split("/\015\012|\015|\012/", $orig);
|
||||
$orig_lines = IDF_FileUtil::splitIntoLines($orig);
|
||||
$new_chunks = $this->mergeChunks($orig_lines, $chunks, $context);
|
||||
return $this->renderCompared($new_chunks, $filename);
|
||||
}
|
||||
|
||||
public function mergeChunks($orig_lines, $chunks, $context=10)
|
||||
private function mergeChunks($orig_lines, $chunks, $context=10)
|
||||
{
|
||||
$spans = array();
|
||||
$new_chunks = array();
|
||||
@@ -310,38 +358,115 @@ class IDF_Diff
|
||||
return $nnew_chunks;
|
||||
}
|
||||
|
||||
public function renderCompared($chunks, $filename)
|
||||
private function renderCompared($chunks, $filename)
|
||||
{
|
||||
$fileinfo = IDF_FileUtil::getMimeType($filename);
|
||||
$pretty = '';
|
||||
if (IDF_FileUtil::isSupportedExtension($fileinfo[2])) {
|
||||
$pretty = ' prettyprint';
|
||||
}
|
||||
$out = '';
|
||||
|
||||
$cc = 1;
|
||||
$i = 0;
|
||||
$left_offsets = array();
|
||||
$left_contents = array();
|
||||
$right_offsets = array();
|
||||
$right_contents = array();
|
||||
|
||||
$max_lineno_left = $max_lineno_right = 0;
|
||||
|
||||
foreach ($chunks as $chunk) {
|
||||
foreach ($chunk as $line) {
|
||||
$line1 = ' ';
|
||||
$line2 = ' ';
|
||||
$line[2] = (strlen($line[2])) ? self::padLine(Pluf_esc($line[2])) : ' ';
|
||||
$left = '';
|
||||
$right = '';
|
||||
$content = IDF_FileUtil::emphasizeControlCharacters(Pluf_esc($line[2]));
|
||||
|
||||
if ($line[0] and $line[1]) {
|
||||
$class = 'diff-c';
|
||||
$line1 = $line2 = $line[2];
|
||||
$class = 'context';
|
||||
$left = $right = $content;
|
||||
} elseif ($line[0]) {
|
||||
$class = 'diff-r';
|
||||
$line1 = $line[2];
|
||||
$class = 'removed';
|
||||
$left = $content;
|
||||
} else {
|
||||
$class = 'diff-a';
|
||||
$line2 = $line[2];
|
||||
$class = 'added';
|
||||
$right = $content;
|
||||
}
|
||||
$out .= sprintf('<tr class="diff-line"><td class="diff-lc">%s</td><td class="%s mono%s"><code>%s</code></td><td class="diff-lc">%s</td><td class="%s mono%s"><code>%s</code></td></tr>'."\n", $line[0], $class, $pretty, $line1, $line[1], $class, $pretty, $line2);
|
||||
|
||||
$left_offsets[] = sprintf('<td>%s</td>', $line[0]);
|
||||
$right_offsets[] = sprintf('<td>%s</td>', $line[1]);
|
||||
$left_contents[] = sprintf('<td class="%s%s mono">%s</td>', $class, $pretty, $left);
|
||||
$right_contents[] = sprintf('<td class="%s%s mono">%s</td>', $class, $pretty, $right);
|
||||
|
||||
$max_lineno_left = max($max_lineno_left, $line[0]);
|
||||
$max_lineno_right = max($max_lineno_right, $line[1]);
|
||||
}
|
||||
|
||||
if (count($chunks) > $cc) {
|
||||
$left_offsets[] = '<td class="next">...</td>';
|
||||
$right_offsets[] = '<td class="next">...</td>';
|
||||
$left_contents[] = '<td></td>';
|
||||
$right_contents[] = '<td></td>';
|
||||
}
|
||||
if (count($chunks) > $cc)
|
||||
$out .= '<tr class="diff-next"><td>...</td><td> </td><td>...</td><td> </td></tr>'."\n";
|
||||
$cc++;
|
||||
$i++;
|
||||
}
|
||||
|
||||
$leftwidth = 1;
|
||||
if ($max_lineno_left > 0)
|
||||
$leftwidth = ((ceil(log10($max_lineno_left)) + 1) * 8) + 12;
|
||||
|
||||
$rightwidth = 1;
|
||||
if ($max_lineno_right > 0)
|
||||
$rightwidth = ((ceil(log10($max_lineno_right)) + 1) * 8) + 12;
|
||||
|
||||
$inner_linecounts_left =
|
||||
'<table class="diff-linecounts">' ."\n".
|
||||
'<colgroup><col width="'.$leftwidth.'" /></colgroup>' ."\n".
|
||||
'<tr class="line">' .
|
||||
implode('</tr>'."\n".'<tr class="line">', $left_offsets).
|
||||
'</tr>' ."\n".
|
||||
'</table>' ."\n";
|
||||
|
||||
$inner_linecounts_right =
|
||||
'<table class="diff-linecounts">' ."\n".
|
||||
'<colgroup><col width="'.$rightwidth.'" /></colgroup>' ."\n".
|
||||
'<tr class="line">' .
|
||||
implode('</tr>'."\n".'<tr class="line">', $right_offsets).
|
||||
'</tr>' ."\n".
|
||||
'</table>' ."\n";
|
||||
|
||||
$inner_contents_left =
|
||||
'<table class="diff-contents">' ."\n".
|
||||
'<tr class="line">' .
|
||||
implode('</tr>'."\n".'<tr class="line">', $left_contents) .
|
||||
'</tr>' ."\n".
|
||||
'</table>' ."\n";
|
||||
|
||||
$inner_contents_right =
|
||||
'<table class="diff-contents">' ."\n".
|
||||
'<tr class="line">' .
|
||||
implode('</tr>'."\n".'<tr class="line">', $right_contents) .
|
||||
'</tr>' ."\n".
|
||||
'</table>' ."\n";
|
||||
|
||||
$out =
|
||||
'<table class="diff context">' ."\n".
|
||||
'<colgroup>' .
|
||||
'<col width="'.($leftwidth + 1).'" /><col width="*" />' .
|
||||
'<col width="'.($rightwidth + 1).'" /><col width="*" />' .
|
||||
'</colgroup>' ."\n".
|
||||
'<tr id="diff-'.md5($filename).'">'.
|
||||
'<th colspan="4">'.Pluf_esc($filename).'</th>'.
|
||||
'</tr>' ."\n".
|
||||
'<tr>' .
|
||||
'<th colspan="2">'.__('Old').'</th><th colspan="2">'.__('New').'</th>' .
|
||||
'</tr>'.
|
||||
'<tr>' .
|
||||
'<td>'. $inner_linecounts_left .'</td>'. "\n".
|
||||
'<td><div class="scroll">'. $inner_contents_left .'</div></td>'. "\n".
|
||||
'<td>'. $inner_linecounts_right .'</td>'. "\n".
|
||||
'<td><div class="scroll">'. $inner_contents_right .'</div></td>'. "\n".
|
||||
'</tr>' ."\n".
|
||||
'</table>' ."\n";
|
||||
|
||||
return Pluf_Template::markSafe($out);
|
||||
}
|
||||
}
|
||||
|
@@ -65,9 +65,9 @@ class IDF_FileUtil
|
||||
}
|
||||
$table = array();
|
||||
$i = 1;
|
||||
foreach (preg_split("/\015\012|\015|\012/", $content) as $line) {
|
||||
foreach (self::splitIntoLines($content) as $line) {
|
||||
$table[] = '<tr class="c-line"><td class="code-lc" id="L'.$i.'"><a href="#L'.$i.'">'.$i.'</a></td>'
|
||||
.'<td class="code mono'.$pretty.'">'.IDF_Diff::padLine(Pluf_esc($line)).'</td></tr>';
|
||||
.'<td class="code mono'.$pretty.'">'.self::emphasizeControlCharacters(Pluf_esc($line)).'</td></tr>';
|
||||
$i++;
|
||||
}
|
||||
return Pluf_Template::markSafe(implode("\n", $table));
|
||||
@@ -143,6 +143,56 @@ class IDF_FileUtil
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Splits a string into separate lines while retaining the individual
|
||||
* line ending character for every line.
|
||||
*
|
||||
* OS9 line endings are not supported.
|
||||
*
|
||||
* @param string content
|
||||
* @param boolean if true, skip completely empty lines
|
||||
* @return string
|
||||
*/
|
||||
public static function splitIntoLines($content, $skipEmpty = false)
|
||||
{
|
||||
$flags = PREG_SPLIT_OFFSET_CAPTURE;
|
||||
if ($skipEmpty) $flags |= PREG_SPLIT_NO_EMPTY;
|
||||
$splitted = preg_split("/\r\n|\n/", $content, -1, $flags);
|
||||
|
||||
$last_off = -1;
|
||||
$lines = array();
|
||||
while (($split = array_shift($splitted)) !== null) {
|
||||
if ($last_off != -1) {
|
||||
$lines[] .= substr($content, $last_off, $split[1] - $last_off);
|
||||
}
|
||||
$last_off = $split[1];
|
||||
}
|
||||
$lines[] = substr($content, $last_off);
|
||||
return $lines;
|
||||
}
|
||||
|
||||
/**
|
||||
* This translates most of the C0 ASCII control characters into
|
||||
* their visual counterparts in the 0x24## unicode plane
|
||||
* (http://en.wikipedia.org/wiki/C0_and_C1_control_codes).
|
||||
*
|
||||
* We could add DEL (0x7F) to this set, but unfortunately this
|
||||
* is not nicely mapped to 0x247F in the control plane, but 0x2421
|
||||
* and adding an if expression below just for this is a little bit
|
||||
* of a hassle. And of course, the more esoteric ones from C1 are
|
||||
* missing as well...
|
||||
*
|
||||
* @param string $content
|
||||
* @return string
|
||||
*/
|
||||
public static function emphasizeControlCharacters($content)
|
||||
{
|
||||
return preg_replace(
|
||||
'/([\x00-\x1F])/ue',
|
||||
'"<span class=\"ctrl-char\" title=\"0x".bin2hex("\\1")."\">$".bin2hex("\\1")."</span>"',
|
||||
$content);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find if a given mime type is a text file.
|
||||
* This uses the output of the self::getMimeType function.
|
||||
|
@@ -31,8 +31,11 @@
|
||||
*/
|
||||
class IDF_Form_Admin_ProjectCreate extends Pluf_Form
|
||||
{
|
||||
public $user = null;
|
||||
|
||||
public function initFields($extra=array())
|
||||
{
|
||||
$this->user = $extra['user'];
|
||||
$choices = array();
|
||||
$options = array(
|
||||
'git' => __('git'),
|
||||
@@ -336,7 +339,6 @@ class IDF_Form_Admin_ProjectCreate extends Pluf_Form
|
||||
$conf->setVal($prop, $tmplconf->getVal($prop, $def));
|
||||
}
|
||||
}
|
||||
$project->created();
|
||||
|
||||
if ($this->cleaned_data['template'] == '--') {
|
||||
IDF_Form_MembersConf::updateMemberships($project,
|
||||
@@ -347,6 +349,8 @@ class IDF_Form_Admin_ProjectCreate extends Pluf_Form
|
||||
$tmpl->getMembershipData('string'));
|
||||
}
|
||||
$project->membershipsUpdated();
|
||||
$project->created();
|
||||
|
||||
return $project;
|
||||
}
|
||||
|
||||
|
@@ -130,7 +130,7 @@ duplicates, is duplicated by';
|
||||
|
||||
$this->fields['labels_issue_one_max'] = new Pluf_Form_Field_Varchar(
|
||||
array('required' => false,
|
||||
'label' => __('Each issue may have at most one label with each of these classes'),
|
||||
'label' => __('Each issue may have at most one label with each of these classes.'),
|
||||
'initial' => self::init_one_max,
|
||||
'widget_attrs' => array('size' => 60),
|
||||
));
|
||||
@@ -139,7 +139,7 @@ duplicates, is duplicated by';
|
||||
array('required' => true,
|
||||
'label' => __('Issue relations'),
|
||||
'initial' => self::init_relations,
|
||||
'help_text' => __('You can define bidirectional relations like "is related to" or "blocks, is blocked by".'),
|
||||
'help_text' => __('You can define bidirectional relations like "is related to" or "blocks, is blocked by". For standard relations pre-configured translations exist, new relations should however be defined in a language that is understood by all project members.'),
|
||||
'widget_attrs' => array('rows' => 7,
|
||||
'cols' => 75),
|
||||
'widget' => 'Pluf_Form_Widget_TextareaInput',
|
||||
|
@@ -67,6 +67,7 @@ class IDF_Form_ProjectConf extends Pluf_Form
|
||||
'move_function_params' =>
|
||||
array('upload_path' => $upload_path,
|
||||
'upload_path_create' => true,
|
||||
'upload_overwrite' => true,
|
||||
'file_name' => $filename,
|
||||
)
|
||||
));
|
||||
|
@@ -41,6 +41,7 @@ Phase:Support = Plans for user support and advocacy
|
||||
Deprecated = Most users should NOT reference this';
|
||||
|
||||
const init_one_max = '';
|
||||
const wiki_default_page = '';
|
||||
|
||||
public function initFields($extra=array())
|
||||
{
|
||||
@@ -60,6 +61,28 @@ Deprecated = Most users should NOT reference this';
|
||||
'widget_attrs' => array('size' => 60),
|
||||
));
|
||||
|
||||
$this->fields['wiki_default_page'] = new Pluf_Form_Field_Varchar(
|
||||
array('required' => false,
|
||||
'label' => __('Set a default wiki page instead of the page listing'),
|
||||
'initial' => self::wiki_default_page,
|
||||
'widget_attrs' => array('size' => 60),
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
public function clean_wiki_default_page()
|
||||
{
|
||||
$pageName = trim($this->cleaned_data['wiki_default_page']);
|
||||
if (empty($pageName)) {
|
||||
return '';
|
||||
}
|
||||
$sql = new Pluf_SQL('project=%s AND title=%s', array($this->data['projectId'], $pageName));
|
||||
$pages = Pluf::factory('IDF_WikiPage')->getList(array('filter'=>$sql->gen()));
|
||||
|
||||
if ($pages->count() != 1) {
|
||||
return '';
|
||||
}
|
||||
return $pageName;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -88,6 +88,7 @@ class IDF_Middleware
|
||||
'showuser' => 'IDF_Template_ShowUser',
|
||||
'ashowuser' => 'IDF_Template_AssignShowUser',
|
||||
'appversion' => 'IDF_Template_AppVersion',
|
||||
'upload' => 'IDF_Template_Tag_UploadUrl',
|
||||
));
|
||||
$params['modifiers'] = array_merge($params['modifiers'],
|
||||
array(
|
||||
|
@@ -59,6 +59,16 @@ class IDF_Plugin_SyncGit_Cron
|
||||
$out .= sprintf($template, $cmd, $key->login, $content)."\n";
|
||||
}
|
||||
}
|
||||
$out = "# indefero start" . PHP_EOL . $out . "# indefero end" . PHP_EOL;
|
||||
|
||||
// We update only the part of the file between IDF_START / IDF_END comment
|
||||
$original_keys = file_get_contents($authorized_keys);
|
||||
if (strstr($original_keys, "# indefero start") && strstr($original_keys, "# indefero end")) {
|
||||
$out = preg_replace('/(#\sindefero\sstart).+(#\sindefero\send\s\s?)/isU',
|
||||
$out, $original_keys);
|
||||
} else {
|
||||
$out .= $original_keys;
|
||||
}
|
||||
file_put_contents($authorized_keys, $out, LOCK_EX);
|
||||
}
|
||||
|
||||
|
@@ -210,22 +210,23 @@ class IDF_Plugin_SyncGit_Serve
|
||||
// Indefero's one.
|
||||
$p = realpath(dirname(__FILE__).'/../../../../scripts/git-post-update');
|
||||
$p = Pluf::f('idf_plugin_syncgit_post_update', $p);
|
||||
if (!@unlink($fullpath.'/hooks/post-update')) {
|
||||
$post_update_hook = $fullpath.'/hooks/post-update';
|
||||
if (file_exists($post_update_hook) && !@unlink($post_update_hook)) {
|
||||
Pluf_Log::warn(array('IDF_Plugin_Git_Serve::initRepository',
|
||||
'post-update hook removal error.',
|
||||
$fullpath.'/hooks/post-update'));
|
||||
$post_update_hook));
|
||||
return;
|
||||
}
|
||||
$out = array();
|
||||
$res = 0;
|
||||
exec(sprintf(Pluf::f('idf_exec_cmd_prefix', '').'ln -s %s %s',
|
||||
escapeshellarg($p),
|
||||
escapeshellarg($fullpath.'/hooks/post-update')),
|
||||
escapeshellarg($post_update_hook)),
|
||||
$out, $res);
|
||||
if ($res != 0) {
|
||||
Pluf_Log::warn(array('IDF_Plugin_Git_Serve::initRepository',
|
||||
'post-update hook creation error.',
|
||||
$fullpath.'/hooks/post-update'));
|
||||
$post_update_hook));
|
||||
return;
|
||||
}
|
||||
Pluf_Log::debug(array('IDF_Plugin_Git_Serve::initRepository',
|
||||
|
@@ -152,15 +152,14 @@ class IDF_Project extends Pluf_Model
|
||||
break;
|
||||
}
|
||||
$sqlIssueTable = Pluf::factory('IDF_Issue')->getSqlTable();
|
||||
$query = <<<"QUERY"
|
||||
SELECT uid AS id,COUNT(uid) AS nb
|
||||
$query = "SELECT uid AS id,COUNT(uid) AS nb
|
||||
FROM (
|
||||
SELECT COALESCE(owner, -1) AS uid
|
||||
FROM $sqlIssueTable
|
||||
WHERE status IN ($tags)
|
||||
) AS ff
|
||||
GROUP BY uid
|
||||
QUERY;
|
||||
GROUP BY uid";
|
||||
|
||||
$db = Pluf::db();
|
||||
$dbData = $db->select($query);
|
||||
$ownerStatistics = array();
|
||||
@@ -179,9 +178,10 @@ QUERY;
|
||||
*
|
||||
* @param string Status ('open'), 'closed'
|
||||
* @param IDF_Tag Subfilter with a label (null)
|
||||
* @param array Restrict further to a list of ids
|
||||
* @return int Count
|
||||
*/
|
||||
public function getIssueCountByStatus($status='open', $label=null)
|
||||
public function getIssueCountByStatus($status='open', $label=null, $ids=array())
|
||||
{
|
||||
switch ($status) {
|
||||
case 'open':
|
||||
@@ -204,12 +204,48 @@ QUERY;
|
||||
$sql2 = new Pluf_SQL('idf_tag_id=%s', array($label->id));
|
||||
$sql->SAnd($sql2);
|
||||
}
|
||||
if (count($ids) > 0) {
|
||||
$sql2 = new Pluf_SQL(sprintf('id IN (%s)', implode(', ', $ids)));
|
||||
$sql->SAnd($sql2);
|
||||
}
|
||||
$params = array('filter' => $sql->gen());
|
||||
if (!is_null($label)) { $params['view'] = 'join_tags'; }
|
||||
$gissue = new IDF_Issue();
|
||||
return $gissue->getCount($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tags for a specific list of issues.
|
||||
*
|
||||
* @param string Status ('open') or 'closed'
|
||||
* @param array A list of issue ids
|
||||
* @return array An array of tag objects
|
||||
*/
|
||||
public function getTagsByIssues($issue_ids=array())
|
||||
{
|
||||
// make the below query always a valid one
|
||||
if (count($issue_ids) == 0) $issue_ids[] = 0;
|
||||
|
||||
$assocTable = $this->_con->pfx.'idf_issue_idf_tag_assoc';
|
||||
$query = sprintf(
|
||||
'SELECT DISTINCT idf_tag_id FROM %s '.
|
||||
'WHERE idf_issue_id IN (%s) '.
|
||||
'GROUP BY idf_tag_id',
|
||||
$assocTable, implode(',', $issue_ids)
|
||||
);
|
||||
|
||||
$db = Pluf::db();
|
||||
$dbData = $db->select($query);
|
||||
$ids = array(0);
|
||||
foreach ($dbData as $data) {
|
||||
$ids[] = $data['idf_tag_id'];
|
||||
}
|
||||
|
||||
$sql = new Pluf_SQL(sprintf('id IN (%s)', implode(', ', $ids)));
|
||||
$model = new IDF_Tag();
|
||||
return $model->getList(array('filter' => $sql->gen()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the open/closed tag ids as they are often used when doing
|
||||
* listings.
|
||||
@@ -416,7 +452,11 @@ QUERY;
|
||||
foreach ($this->_con->select($sql) as $idc) {
|
||||
$tag = new IDF_Tag($idc['id']);
|
||||
$tag->nb_use = $idc['nb_use'];
|
||||
$tags[] = $tag;
|
||||
// group by class
|
||||
if (!array_key_exists($tag->class, $tags)) {
|
||||
$tags[$tag->class] = array();
|
||||
}
|
||||
$tags[$tag->class][] = $tag;
|
||||
}
|
||||
return new Pluf_Template_ContextVars($tags);
|
||||
}
|
||||
|
@@ -87,7 +87,7 @@ class IDF_Scm_Git extends IDF_Scm
|
||||
$filename = trim(substr($line, 1));
|
||||
$return->patches[] = $filename;
|
||||
} else if ($action == 'R') {
|
||||
$matches = split ("\t", $line);
|
||||
$matches = preg_split("/\t/", $line);
|
||||
$return->renames[$matches[1]] = $matches[2];
|
||||
}
|
||||
}
|
||||
@@ -346,6 +346,14 @@ class IDF_Scm_Git extends IDF_Scm
|
||||
if (!preg_match('/<(.*)>/', $author, $match)) {
|
||||
return null;
|
||||
}
|
||||
// FIXME: newer git versions know a i18n.commitencoding setting which
|
||||
// leads to another header, "encoding", with which we _could_ try to
|
||||
// decode the string into utf8. Unfortunately this does not always
|
||||
// work, especially not in older repos, so we would then still have
|
||||
// to supply some fallback.
|
||||
if (!mb_check_encoding($match[1], 'UTF-8')) {
|
||||
return null;
|
||||
}
|
||||
$sql = new Pluf_SQL('login=%s', array($match[1]));
|
||||
$users = Pluf::factory('Pluf_User')->getList(array('filter'=>$sql->gen()));
|
||||
if ($users->count() > 0) {
|
||||
@@ -499,33 +507,27 @@ class IDF_Scm_Git extends IDF_Scm
|
||||
"'".$this->mediumtree_fmt."'",
|
||||
escapeshellarg($commit));
|
||||
}
|
||||
$out = array();
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
self::exec('IDF_Scm_Git::getCommit', $cmd, $out, $ret);
|
||||
if ($ret != 0 or count($out) == 0) {
|
||||
$out = self::shell_exec('IDF_Scm_Git::getCommit', $cmd);
|
||||
if (strlen($out) == 0) {
|
||||
return false;
|
||||
}
|
||||
if ($getdiff) {
|
||||
$log = array();
|
||||
$change = array();
|
||||
$inchange = false;
|
||||
foreach ($out as $line) {
|
||||
if (!$inchange and 0 === strpos($line, 'diff --git a')) {
|
||||
$inchange = true;
|
||||
}
|
||||
if ($inchange) {
|
||||
$change[] = $line;
|
||||
} else {
|
||||
$log[] = $line;
|
||||
}
|
||||
}
|
||||
$out = self::parseLog($log);
|
||||
$out[0]->diff = implode("\n", $change);
|
||||
} else {
|
||||
$out = self::parseLog($out);
|
||||
$out[0]->diff = '';
|
||||
|
||||
$diffStart = false;
|
||||
if (preg_match('/^diff (?:--git a|--cc)/m', $out, $m, PREG_OFFSET_CAPTURE)) {
|
||||
$diffStart = $m[0][1];
|
||||
}
|
||||
|
||||
$diff = '';
|
||||
if ($diffStart !== false) {
|
||||
$log = substr($out, 0, $diffStart);
|
||||
$diff = substr($out, $diffStart);
|
||||
} else {
|
||||
$log = $out;
|
||||
}
|
||||
|
||||
$out = self::parseLog(preg_split('/\r\n|\n/', $log));
|
||||
$out[0]->diff = $diff;
|
||||
$out[0]->branch = implode(', ', $this->inBranches($out[0]->commit, null));
|
||||
return $out[0];
|
||||
}
|
||||
@@ -638,7 +640,11 @@ class IDF_Scm_Git extends IDF_Scm
|
||||
$c['full_message'] = IDF_Commit::toUTF8($c['full_message']);
|
||||
$c['title'] = IDF_Commit::toUTF8($c['title']);
|
||||
if (isset($c['parents'])) {
|
||||
$c['parents'] = explode(' ', trim($c['parents']));
|
||||
$c['parents'] = preg_split('/ /', trim($c['parents']), -1, PREG_SPLIT_NO_EMPTY);
|
||||
} else {
|
||||
// this is actually an error state because we should _always_
|
||||
// be able to parse the parents line with every git version
|
||||
$c['parents'] = null;
|
||||
}
|
||||
$res[] = (object) $c;
|
||||
return $res;
|
||||
|
@@ -408,24 +408,23 @@ class IDF_Scm_Mercurial extends IDF_Scm
|
||||
escapeshellarg($commit),
|
||||
escapeshellarg($this->repo),
|
||||
escapeshellarg($logStyle->get()));
|
||||
$out = array();
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
self::exec('IDF_Scm_Mercurial::getCommit', $cmd, $out);
|
||||
$log = array();
|
||||
$change = array();
|
||||
$inchange = false;
|
||||
foreach ($out as $line) {
|
||||
if (!$inchange and 0 === strpos($line, 'diff -r')) {
|
||||
$inchange = true;
|
||||
$out = self::shell_exec('IDF_Scm_Mercurial::getCommit', $cmd);
|
||||
if (strlen($out) == 0) {
|
||||
return false;
|
||||
}
|
||||
if ($inchange) {
|
||||
$change[] = $line;
|
||||
|
||||
$diffStart = strpos($out, 'diff -r');
|
||||
$diff = '';
|
||||
if ($diffStart !== false) {
|
||||
$log = substr($out, 0, $diffStart);
|
||||
$diff = substr($out, $diffStart);
|
||||
} else {
|
||||
$log[] = $line;
|
||||
$log = $out;
|
||||
}
|
||||
}
|
||||
$out = self::parseLog($log);
|
||||
$out[0]->diff = implode("\n", $change);
|
||||
|
||||
$out = self::parseLog(preg_split('/\r\n|\n/', $log));
|
||||
$out[0]->diff = $diff;
|
||||
return $out[0];
|
||||
}
|
||||
|
||||
|
@@ -33,7 +33,6 @@
|
||||
*/
|
||||
class IDF_Scm_Svn extends IDF_Scm
|
||||
{
|
||||
|
||||
public $username = '';
|
||||
public $password = '';
|
||||
private $assoc = array('dir' => 'tree',
|
||||
@@ -48,11 +47,7 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
|
||||
public function isAvailable()
|
||||
{
|
||||
$cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --xml --username=%s --password=%s %s',
|
||||
escapeshellarg($this->username),
|
||||
escapeshellarg($this->password),
|
||||
escapeshellarg($this->repo));
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
$cmd = $this->svnCmd(array('info', '--xml'), $this->repo);
|
||||
$xmlInfo = self::shell_exec('IDF_Scm_Svn::isAvailable', $cmd);
|
||||
|
||||
try {
|
||||
@@ -163,12 +158,7 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
return IDF_Scm::REVISION_VALID;
|
||||
}
|
||||
|
||||
$cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --username=%s --password=%s --revision=%s %s',
|
||||
escapeshellarg($this->username),
|
||||
escapeshellarg($this->password),
|
||||
escapeshellarg($rev),
|
||||
escapeshellarg($this->repo));
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
$cmd = $this->svnCmd(array('info'), $this->repo, $rev);
|
||||
self::exec('IDF_Scm_Svn::validateRevision', $cmd, $out, $ret);
|
||||
|
||||
if ($ret == 0)
|
||||
@@ -190,12 +180,9 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
}
|
||||
|
||||
// Else, test the path on revision
|
||||
$cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --xml --username=%s --password=%s --revision=%s %s',
|
||||
escapeshellarg($this->username),
|
||||
escapeshellarg($this->password),
|
||||
escapeshellarg($rev),
|
||||
escapeshellarg($this->repo.'/'.self::smartEncode($path)));
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
$cmd = $this->svnCmd(array('info', '--xml'),
|
||||
$this->repo.'/'.self::smartEncode($path),
|
||||
$rev);
|
||||
$xmlInfo = self::shell_exec('IDF_Scm_Svn::testHash', $cmd);
|
||||
|
||||
// If exception is thrown, return false
|
||||
@@ -217,12 +204,9 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
|
||||
public function getTree($commit, $folder='/', $branch=null)
|
||||
{
|
||||
$cmd = sprintf(Pluf::f('svn_path', 'svn').' ls --no-auth-cache --xml --username=%s --password=%s --revision=%s %s',
|
||||
escapeshellarg($this->username),
|
||||
escapeshellarg($this->password),
|
||||
escapeshellarg($commit),
|
||||
escapeshellarg($this->repo.'/'.self::smartEncode($folder)));
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
$cmd = $this->svnCmd(array('ls', '--xml'),
|
||||
$this->repo.'/'.self::smartEncode($folder),
|
||||
$commit);
|
||||
$xml = simplexml_load_string(self::shell_exec('IDF_Scm_Svn::getTree', $cmd));
|
||||
$res = array();
|
||||
$folder = (strlen($folder) and ($folder != '/')) ? $folder.'/' : '';
|
||||
@@ -258,12 +242,7 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
if (isset($this->cache['commitmess'][$rev])) {
|
||||
return $this->cache['commitmess'][$rev];
|
||||
}
|
||||
$cmd = sprintf(Pluf::f('svn_path', 'svn').' log --no-auth-cache --xml --limit 1 --username=%s --password=%s --revision=%s %s',
|
||||
escapeshellarg($this->username),
|
||||
escapeshellarg($this->password),
|
||||
escapeshellarg($rev),
|
||||
escapeshellarg($this->repo));
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
$cmd = $this->svnCmd(array('log', '--xml', '--limit', '1'), $this->repo, $rev);
|
||||
try {
|
||||
$xml = simplexml_load_string(self::shell_exec('IDF_Scm_Svn::getCommitMessage', $cmd));
|
||||
$this->cache['commitmess'][$rev] = (string) $xml->logentry->msg;
|
||||
@@ -279,12 +258,8 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
if ($rev == null) {
|
||||
$rev = 'HEAD';
|
||||
}
|
||||
$cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --xml --username=%s --password=%s --revision=%s %s',
|
||||
escapeshellarg($this->username),
|
||||
escapeshellarg($this->password),
|
||||
escapeshellarg($rev),
|
||||
escapeshellarg($this->repo.'/'.self::smartEncode($filename)));
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
$cmd = $this->svnCmd(array('info', '--xml'),
|
||||
$this->repo.'/'.self::smartEncode($filename), $rev);
|
||||
$xml = simplexml_load_string(self::shell_exec('IDF_Scm_Svn::getPathInfo', $cmd));
|
||||
if (!isset($xml->entry)) {
|
||||
return false;
|
||||
@@ -306,12 +281,9 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
|
||||
public function getFile($def, $cmd_only=false)
|
||||
{
|
||||
$cmd = sprintf(Pluf::f('svn_path', 'svn').' cat --no-auth-cache --username=%s --password=%s --revision=%s %s',
|
||||
escapeshellarg($this->username),
|
||||
escapeshellarg($this->password),
|
||||
escapeshellarg($def->rev),
|
||||
escapeshellarg($this->repo.'/'.self::smartEncode($def->fullpath)));
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
$cmd = $this->svnCmd(array('cat'),
|
||||
$this->repo.'/'.self::smartEncode($def->fullpath),
|
||||
$def->rev);
|
||||
return ($cmd_only) ?
|
||||
$cmd : self::shell_exec('IDF_Scm_Svn::getFile', $cmd);
|
||||
}
|
||||
@@ -327,11 +299,7 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
return $this->cache['branches'];
|
||||
}
|
||||
$res = array();
|
||||
$cmd = sprintf(Pluf::f('svn_path', 'svn').' ls --no-auth-cache --username=%s --password=%s --revision=HEAD %s',
|
||||
escapeshellarg($this->username),
|
||||
escapeshellarg($this->password),
|
||||
escapeshellarg($this->repo.'/branches'));
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
$cmd = $this->svnCmd(array('ls'), $this->repo.'/branches', 'HEAD');
|
||||
self::exec('IDF_Scm_Svn::getBranches', $cmd, $out, $ret);
|
||||
if ($ret == 0) {
|
||||
foreach ($out as $entry) {
|
||||
@@ -342,11 +310,8 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
}
|
||||
}
|
||||
ksort($res);
|
||||
$cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --username=%s --password=%s --revision=HEAD %s',
|
||||
escapeshellarg($this->username),
|
||||
escapeshellarg($this->password),
|
||||
escapeshellarg($this->repo.'/trunk'));
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
|
||||
$cmd = $this->svnCmd(array('info'), $this->repo.'/trunk', 'HEAD');
|
||||
self::exec('IDF_Scm_Svn::getBranches', $cmd, $out, $ret);
|
||||
if ($ret == 0) {
|
||||
$res = array('trunk' => 'trunk') + $res;
|
||||
@@ -366,11 +331,7 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
return $this->cache['tags'];
|
||||
}
|
||||
$res = array();
|
||||
$cmd = sprintf(Pluf::f('svn_path', 'svn').' ls --no-auth-cache --username=%s --password=%s --revision=HEAD %s',
|
||||
escapeshellarg($this->username),
|
||||
escapeshellarg($this->password),
|
||||
escapeshellarg($this->repo.'/tags'));
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
$cmd = $this->svnCmd(array('ls'), $this->repo.'/tags', 'HEAD');
|
||||
self::exec('IDF_Scm_Svn::getTags', $cmd, $out, $ret);
|
||||
if ($ret == 0) {
|
||||
foreach ($out as $entry) {
|
||||
@@ -423,12 +384,8 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
return false;
|
||||
}
|
||||
$res = array();
|
||||
$cmd = sprintf(Pluf::f('svn_path', 'svn').' log --no-auth-cache --xml --limit 1 -v --username=%s --password=%s --revision=%s %s',
|
||||
escapeshellarg($this->username),
|
||||
escapeshellarg($this->password),
|
||||
escapeshellarg($commit),
|
||||
escapeshellarg($this->repo));
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
$cmd = $this->svnCmd(array('log', '--xml', '--limit', '1', '-v'),
|
||||
$this->repo, $commit);
|
||||
$xmlRes = self::shell_exec('IDF_Scm_Svn::getCommit', $cmd);
|
||||
$xml = simplexml_load_string($xmlRes);
|
||||
$res['author'] = (string) $xml->logentry->author;
|
||||
@@ -470,12 +427,7 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
private function getDiff($rev='HEAD')
|
||||
{
|
||||
$res = array();
|
||||
$cmd = sprintf(Pluf::f('svn_path', 'svn').' diff --no-auth-cache -c %s --username=%s --password=%s %s',
|
||||
escapeshellarg($rev),
|
||||
escapeshellarg($this->username),
|
||||
escapeshellarg($this->password),
|
||||
escapeshellarg($this->repo));
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
$cmd = $this->svnCmd(array('diff', '-c', $rev), $this->repo);
|
||||
return self::shell_exec('IDF_Scm_Svn::getDiff', $cmd);
|
||||
}
|
||||
|
||||
@@ -487,13 +439,8 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
if ($this->validateRevision($commit) != IDF_Scm::REVISION_VALID) {
|
||||
return null;
|
||||
}
|
||||
$cmd = sprintf(Pluf::f('svn_path', 'svn').' log --xml -v --no-auth-cache -r %s --username=%s --password=%s %s',
|
||||
escapeshellarg($commit),
|
||||
escapeshellarg($this->username),
|
||||
escapeshellarg($this->password),
|
||||
escapeshellarg($this->repo));
|
||||
$cmd = $this->svnCmd(array('log', '--xml', '-v'), $this->repo, $commit);
|
||||
$out = array();
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
$out = self::shell_exec('IDF_Scm_Svn::getChanges', $cmd);
|
||||
$xml = simplexml_load_string($out);
|
||||
if (count($xml) == 0) {
|
||||
@@ -570,20 +517,15 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
*
|
||||
* @return array Changes.
|
||||
*/
|
||||
public function getChangeLog($branch=null, $n=10)
|
||||
public function getChangeLog($rev=null, $n=10)
|
||||
{
|
||||
if ($branch != 'HEAD' and !preg_match('/^\d+$/', $branch)) {
|
||||
if ($rev != 'HEAD' and !preg_match('/^\d+$/', $rev)) {
|
||||
// we accept only revisions or HEAD
|
||||
$branch = 'HEAD';
|
||||
$rev = 'HEAD';
|
||||
}
|
||||
$res = array();
|
||||
$cmd = sprintf(Pluf::f('svn_path', 'svn').' log --no-auth-cache --xml -v --limit %s --username=%s --password=%s --revision=%s %s',
|
||||
escapeshellarg($n),
|
||||
escapeshellarg($this->username),
|
||||
escapeshellarg($this->password),
|
||||
escapeshellarg($branch),
|
||||
escapeshellarg($this->repo));
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
$cmd = $this->svnCmd(array('log', '--xml', '-v', '--limit', $n),
|
||||
$this->repo.'@'.$rev);
|
||||
$xmlRes = self::shell_exec('IDF_Scm_Svn::getChangeLog', $cmd);
|
||||
$xml = simplexml_load_string($xmlRes);
|
||||
foreach ($xml->logentry as $entry) {
|
||||
@@ -609,12 +551,8 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
public function getProperties($rev, $path='')
|
||||
{
|
||||
$res = array();
|
||||
$cmd = sprintf(Pluf::f('svn_path', 'svn').' proplist --no-auth-cache --xml --username=%s --password=%s --revision=%s %s',
|
||||
escapeshellarg($this->username),
|
||||
escapeshellarg($this->password),
|
||||
escapeshellarg($rev),
|
||||
escapeshellarg($this->repo.'/'.self::smartEncode($path)));
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
$cmd = $this->svnCmd(array('proplist', '--xml'),
|
||||
$this->repo.'/'.self::smartEncode($path), $rev);
|
||||
$xmlProps = self::shell_exec('IDF_Scm_Svn::getProperties', $cmd);
|
||||
$props = simplexml_load_string($xmlProps);
|
||||
|
||||
@@ -643,13 +581,8 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
private function getProperty($property, $rev, $path='')
|
||||
{
|
||||
$res = array();
|
||||
$cmd = sprintf(Pluf::f('svn_path', 'svn').' propget --no-auth-cache --xml %s --username=%s --password=%s --revision=%s %s',
|
||||
escapeshellarg($property),
|
||||
escapeshellarg($this->username),
|
||||
escapeshellarg($this->password),
|
||||
escapeshellarg($rev),
|
||||
escapeshellarg($this->repo.'/'.self::smartEncode($path)));
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
$cmd = $this->svnCmd(array('propget', $property, '--xml'),
|
||||
$this->repo.'/'.self::smartEncode($path), $rev);
|
||||
$xmlProp = self::shell_exec('IDF_Scm_Svn::getProperty', $cmd);
|
||||
$prop = simplexml_load_string($xmlProp);
|
||||
|
||||
@@ -666,16 +599,38 @@ class IDF_Scm_Svn extends IDF_Scm
|
||||
public function getLastCommit($rev='HEAD')
|
||||
{
|
||||
$xmlInfo = '';
|
||||
$cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --xml --username=%s --password=%s --revision=%s %s',
|
||||
escapeshellarg($this->username),
|
||||
escapeshellarg($this->password),
|
||||
escapeshellarg($rev),
|
||||
escapeshellarg($this->repo));
|
||||
$cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd;
|
||||
$cmd = $this->svnCmd(array('info', '--xml'), $this->repo, $rev);
|
||||
$xmlInfo = self::shell_exec('IDF_Scm_Svn::getLastCommit', $cmd);
|
||||
|
||||
$xml = simplexml_load_string($xmlInfo);
|
||||
return (string) $xml->entry->commit['revision'];
|
||||
}
|
||||
|
||||
private function svnCmd($args = array(), $repoarg = null, $revarg = null)
|
||||
{
|
||||
$cmdline = array();
|
||||
$cmdline[] = Pluf::f('idf_exec_cmd_prefix', '');
|
||||
$cmdline[] = Pluf::f('svn_path', 'svn');
|
||||
$cmdline[] = '--no-auth-cache';
|
||||
$cmdline[] = '--username='.escapeshellarg($this->username);
|
||||
$cmdline[] = '--password='.escapeshellarg($this->password);
|
||||
|
||||
foreach ($args as $arg) {
|
||||
$cmdline[] = escapeshellarg($arg);
|
||||
}
|
||||
|
||||
if ($repoarg != null) {
|
||||
if ($revarg != null) {
|
||||
$repoarg .= '@'.$revarg;
|
||||
}
|
||||
$cmdline[] = escapeshellarg($repoarg);
|
||||
}
|
||||
|
||||
if ($revarg != null) {
|
||||
$cmdline[] = '--revision='.escapeshellarg($revarg);
|
||||
}
|
||||
|
||||
return implode(' ', $cmdline);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -58,7 +58,7 @@ class IDF_Template_IssueComment extends Pluf_Template_Tag
|
||||
implode('|', $nouns);
|
||||
$text = IDF_Template_safePregReplace('#((?:'.$prefix.')(?:\s+r?))([0-9a-f]{1,40}((?:\s+and|\s+or|,)\s+r?[0-9a-f]{1,40})*)\b#i',
|
||||
array($this, 'callbackCommits'), $text);
|
||||
$text = IDF_Template_safePregReplace('=(src:)([^\s@#,\(\)\\\\]+(?:(\\\\)[\s@#][^\s@#,\(\)\\\\]+){0,})+(?:\@([^\s#,]+))(?:#(\d+))?=im',
|
||||
$text = IDF_Template_safePregReplace('=(src:)([^\s@#,\(\)\\\\]+(?:(\\\\)[\s@#][^\s@#,\(\)\\\\]+){0,})+(?:\@([^\s#,]+))?(?:#(\d+))?=im',
|
||||
array($this, 'callbackSource'), $text);
|
||||
}
|
||||
if ($wordwrap) $text = Pluf_Text::wrapHtml($text, 69, "\n");
|
||||
|
35
src/IDF/Template/Tag/UploadUrl.php
Normal file
35
src/IDF/Template/Tag/UploadUrl.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# This file is part of InDefero, an open source project management application.
|
||||
# Copyright (C) 2011 Céondo Ltd and contributors.
|
||||
#
|
||||
# InDefero is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# InDefero is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
# ***** END LICENSE BLOCK ***** */
|
||||
|
||||
class IDF_Template_Tag_UploadUrl extends Pluf_Template_Tag
|
||||
{
|
||||
function start($file='')
|
||||
{
|
||||
echo IDF_Template_Tag_UploadUrl::url($file);
|
||||
}
|
||||
|
||||
public static function url($file='')
|
||||
{
|
||||
return Pluf::f('url_upload', Pluf_Template_Tag_MediaUrl::url() . '/upload') . $file;
|
||||
}
|
||||
}
|
@@ -32,21 +32,24 @@ class IDF_Tests_TestDiff extends UnitTestCase
|
||||
parent::__construct('Test the diff parser.');
|
||||
}
|
||||
|
||||
public function testBinaryDiff()
|
||||
{
|
||||
$diff_content = file_get_contents(dirname(__FILE__).'/test-diff.diff');
|
||||
$orig = file_get_contents(dirname(__FILE__).'/test-diff-view.html');
|
||||
$diff = new IDF_Diff($diff_content);
|
||||
$diff->parse();
|
||||
$def = $diff->files['src/IDF/templates/idf/issues/view.html'];
|
||||
|
||||
$orig_lines = preg_split("/\015\012|\015|\012/", $orig);
|
||||
$merged = $diff->mergeChunks($orig_lines, $def, 10);
|
||||
$lchunk = end($merged);
|
||||
$lline = end($lchunk);
|
||||
$this->assertEqual(array('', '166', '{/if}{/block}'),
|
||||
$lline);
|
||||
}
|
||||
//
|
||||
// IDF_Diff::mergeChunks() is now private, so this test needs to be rewritten
|
||||
//
|
||||
//public function testBinaryDiff()
|
||||
//{
|
||||
// $diff_content = file_get_contents(dirname(__FILE__).'/test-diff.diff');
|
||||
// $orig = file_get_contents(dirname(__FILE__).'/test-diff-view.html');
|
||||
// $diff = new IDF_Diff($diff_content);
|
||||
// $diff->parse();
|
||||
// $def = $diff->files['src/IDF/templates/idf/issues/view.html'];
|
||||
//
|
||||
// $orig_lines = preg_split("/\015\012|\015|\012/", $orig);
|
||||
// $merged = $diff->mergeChunks($orig_lines, $def, 10);
|
||||
// $lchunk = end($merged);
|
||||
// $lline = end($lchunk);
|
||||
// $this->assertEqual(array('', '166', '{/if}{/block}'),
|
||||
// $lline);
|
||||
//}
|
||||
|
||||
public function testDiffWithHeaders()
|
||||
{
|
||||
|
@@ -150,7 +150,7 @@ class IDF_Upload extends Pluf_Model
|
||||
if ($this->id == '') {
|
||||
$this->creation_dtime = gmdate('Y-m-d H:i:s');
|
||||
$this->modif_dtime = gmdate('Y-m-d H:i:s');
|
||||
$this->md5 = md5_file (Pluf::f('upload_path') . '/' . $this->get_project()->shortname . '/files/' . $this->file);
|
||||
$this->md5 = md5_file ($this->getFullPath());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,6 +167,11 @@ class IDF_Upload extends Pluf_Model
|
||||
return Pluf::f('url_upload').'/'.$project->shortname.'/files/'.$this->file;
|
||||
}
|
||||
|
||||
function getFullPath()
|
||||
{
|
||||
return(Pluf::f('upload_path').'/'.$this->get_project()->shortname.'/files/'.$this->file);
|
||||
}
|
||||
|
||||
/**
|
||||
* We drop the information from the timeline.
|
||||
*/
|
||||
|
@@ -202,7 +202,11 @@ class IDF_Views_Download
|
||||
$prj->inOr404($upload);
|
||||
$upload->downloads += 1;
|
||||
$upload->update();
|
||||
return new Pluf_HTTP_Response_Redirect($upload->getAbsoluteUrl($prj));
|
||||
$path = $upload->getFullPath();
|
||||
$mime = IDF_FileUtil::getMimeType($path);
|
||||
$render = new Pluf_HTTP_Response_File($path, $mime[0]);
|
||||
$render->headers["Content-MD5"] = $upload->md5;
|
||||
return $render;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -315,13 +319,11 @@ class IDF_Views_Download
|
||||
$pag->no_results_text = __('No downloads were found.');
|
||||
$pag->sort_order = array('creation_dtime', 'DESC');
|
||||
$pag->setFromRequest($request);
|
||||
$tags = $prj->getTagCloud('downloads');
|
||||
return Pluf_Shortcuts_RenderToResponse('idf/downloads/index.html',
|
||||
array(
|
||||
'page_title' => $title,
|
||||
'label' => $tag,
|
||||
'downloads' => $pag,
|
||||
'tags' => $tags,
|
||||
'dlabel' => $dtag,
|
||||
),
|
||||
$request);
|
||||
|
@@ -71,7 +71,9 @@ class IDF_Views_Issue
|
||||
'page_title' => $title,
|
||||
'open' => $open,
|
||||
'closed' => $closed,
|
||||
'issues' => $pag);
|
||||
'issues' => $pag,
|
||||
'cloud' => 'issues',
|
||||
);
|
||||
if ($api) return $params;
|
||||
return Pluf_Shortcuts_RenderToResponse('idf/issues/index.html',
|
||||
$params, $request);
|
||||
@@ -109,17 +111,28 @@ class IDF_Views_Issue
|
||||
foreach ($owners as $user => $nb) {
|
||||
if ($user === '') {
|
||||
$key = __('Not assigned');
|
||||
$login = null;
|
||||
} else {
|
||||
$obj = Pluf::factory('Pluf_User')->getOne(array('filter'=>'id='.$user));
|
||||
$key = $obj->first_name . ' ' . $obj->last_name;
|
||||
$login = $obj->login;
|
||||
}
|
||||
$ownerStatistics[$key] = array($nb, (int)(100 * $nb / $opened));
|
||||
$ownerStatistics[$key] = array($nb, (int)(100 * $nb / $opened), $login);
|
||||
}
|
||||
arsort($ownerStatistics);
|
||||
|
||||
// Issue class tag statistics
|
||||
$tags = $prj->getTagCloud();
|
||||
foreach ($tags as $t) {
|
||||
$tagStatistics[$t->class][$t->name] = array($t->nb_use, $t->id);
|
||||
$grouped_tags = $prj->getTagCloud();
|
||||
foreach ($grouped_tags as $class => $tags) {
|
||||
foreach ($tags as $tag) {
|
||||
$tagStatistics[$class][$tag->name] = array($tag->nb_use, $tag->id);
|
||||
}
|
||||
uasort($tagStatistics[$class], function ($a, $b) {
|
||||
if ($a[0] === $b[0])
|
||||
return 0;
|
||||
|
||||
return ($a[0] > $b[0]) ? -1 : 1;
|
||||
});
|
||||
}
|
||||
foreach($tagStatistics as $k => $v) {
|
||||
$nbIssueInClass = 0;
|
||||
@@ -130,10 +143,6 @@ class IDF_Views_Issue
|
||||
$tagStatistics[$k][$kk] = array($vv[0], (int)(100 * $vv[0] / $nbIssueInClass), $vv[1]);
|
||||
}
|
||||
}
|
||||
|
||||
// Sort
|
||||
krsort($tagStatistics);
|
||||
arsort($ownerStatistics);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,42 +322,55 @@ class IDF_Views_Issue
|
||||
*
|
||||
* Only open issues are shown.
|
||||
*/
|
||||
public $myIssues_precond = array('IDF_Precondition::accessIssues',
|
||||
'Pluf_Precondition::loginRequired');
|
||||
public function myIssues($request, $match)
|
||||
public $userIssues_precond = array('IDF_Precondition::accessIssues');
|
||||
public function userIssues($request, $match)
|
||||
{
|
||||
$prj = $request->project;
|
||||
|
||||
$sql = new Pluf_SQL('login=%s', array($match[2]));
|
||||
$user = Pluf::factory('Pluf_User')->getOne(array('filter' => $sql->gen()));
|
||||
if ($user === null) {
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Issue::index',
|
||||
array($prj->shortname));
|
||||
return new Pluf_HTTP_Response_Redirect($url);
|
||||
}
|
||||
|
||||
$otags = $prj->getTagIdsByStatus('open');
|
||||
$ctags = $prj->getTagIdsByStatus('closed');
|
||||
if (count($otags) == 0) $otags[] = 0;
|
||||
if (count($ctags) == 0) $ctags[] = 0;
|
||||
switch ($match[2]) {
|
||||
switch ($match[3]) {
|
||||
case 'submit':
|
||||
$title = sprintf(__('My Submitted %s Issues'), (string) $prj);
|
||||
$f_sql = new Pluf_SQL('project=%s AND submitter=%s AND status IN ('.implode(', ', $otags).')', array($prj->id, $request->user->id));
|
||||
$titleFormat = __('%s %s Submitted %s Issues');
|
||||
$f_sql = new Pluf_SQL('project=%s AND submitter=%s AND status IN ('.implode(', ', $otags).')', array($prj->id, $user->id));
|
||||
break;
|
||||
case 'submitclosed':
|
||||
$title = sprintf(__('My Closed Submitted %s Issues'), (string) $prj);
|
||||
$f_sql = new Pluf_SQL('project=%s AND submitter=%s AND status IN ('.implode(', ', $ctags).')', array($prj->id, $request->user->id));
|
||||
$titleFormat = __('%s %s Closed Submitted %s Issues');
|
||||
$f_sql = new Pluf_SQL('project=%s AND submitter=%s AND status IN ('.implode(', ', $ctags).')', array($prj->id, $user->id));
|
||||
break;
|
||||
case 'ownerclosed':
|
||||
$title = sprintf(__('My Closed Working %s Issues'), (string) $prj);
|
||||
$f_sql = new Pluf_SQL('project=%s AND owner=%s AND status IN ('.implode(', ', $ctags).')', array($prj->id, $request->user->id));
|
||||
$titleFormat = __('%s %s Closed Working %s Issues');
|
||||
$f_sql = new Pluf_SQL('project=%s AND owner=%s AND status IN ('.implode(', ', $ctags).')', array($prj->id, $user->id));
|
||||
break;
|
||||
default:
|
||||
$title = sprintf(__('My Working %s Issues'), (string) $prj);
|
||||
$f_sql = new Pluf_SQL('project=%s AND owner=%s AND status IN ('.implode(', ', $otags).')', array($prj->id, $request->user->id));
|
||||
$titleFormat = __('%s %s Working %s Issues');
|
||||
$f_sql = new Pluf_SQL('project=%s AND owner=%s AND status IN ('.implode(', ', $otags).')', array($prj->id, $user->id));
|
||||
break;
|
||||
}
|
||||
$title = sprintf($titleFormat,
|
||||
$user->first_name,
|
||||
$user->last_name,
|
||||
(string) $prj);
|
||||
|
||||
// Get stats about the issues
|
||||
$sql = new Pluf_SQL('project=%s AND submitter=%s AND status IN ('.implode(', ', $otags).')', array($prj->id, $request->user->id));
|
||||
$sql = new Pluf_SQL('project=%s AND submitter=%s AND status IN ('.implode(', ', $otags).')', array($prj->id, $user->id));
|
||||
$nb_submit = Pluf::factory('IDF_Issue')->getCount(array('filter'=>$sql->gen()));
|
||||
$sql = new Pluf_SQL('project=%s AND owner=%s AND status IN ('.implode(', ', $otags).')', array($prj->id, $request->user->id));
|
||||
$sql = new Pluf_SQL('project=%s AND owner=%s AND status IN ('.implode(', ', $otags).')', array($prj->id, $user->id));
|
||||
$nb_owner = Pluf::factory('IDF_Issue')->getCount(array('filter'=>$sql->gen()));
|
||||
// Closed issues
|
||||
$sql = new Pluf_SQL('project=%s AND submitter=%s AND status IN ('.implode(', ', $ctags).')', array($prj->id, $request->user->id));
|
||||
$sql = new Pluf_SQL('project=%s AND submitter=%s AND status IN ('.implode(', ', $ctags).')', array($prj->id, $user->id));
|
||||
$nb_submit_closed = Pluf::factory('IDF_Issue')->getCount(array('filter'=>$sql->gen()));
|
||||
$sql = new Pluf_SQL('project=%s AND owner=%s AND status IN ('.implode(', ', $ctags).')', array($prj->id, $request->user->id));
|
||||
$sql = new Pluf_SQL('project=%s AND owner=%s AND status IN ('.implode(', ', $ctags).')', array($prj->id, $user->id));
|
||||
$nb_owner_closed = Pluf::factory('IDF_Issue')->getCount(array('filter'=>$sql->gen()));
|
||||
|
||||
// Paginator to paginate the issues
|
||||
@@ -359,7 +381,7 @@ class IDF_Views_Issue
|
||||
'current_user' => $request->user);
|
||||
$pag->summary = __('This table shows the open issues.');
|
||||
$pag->forced_where = $f_sql;
|
||||
$pag->action = array('IDF_Views_Issue::myIssues', array($prj->shortname, $match[2]));
|
||||
$pag->action = array('IDF_Views_Issue::userIssues', array($prj->shortname, $match[2]));
|
||||
$pag->sort_order = array('modif_dtime', 'ASC'); // will be reverted
|
||||
$pag->sort_reverse_order = array('modif_dtime');
|
||||
$pag->sort_link_title = true;
|
||||
@@ -374,9 +396,10 @@ class IDF_Views_Issue
|
||||
$pag->items_per_page = 10;
|
||||
$pag->no_results_text = __('No issues were found.');
|
||||
$pag->setFromRequest($request);
|
||||
return Pluf_Shortcuts_RenderToResponse('idf/issues/my-issues.html',
|
||||
return Pluf_Shortcuts_RenderToResponse('idf/issues/userIssues.html',
|
||||
array('project' => $prj,
|
||||
'page_title' => $title,
|
||||
'login' => $user->login,
|
||||
'nb_submit' => $nb_submit,
|
||||
'nb_owner' => $nb_owner,
|
||||
'nb_submit_closed' => $nb_submit_closed,
|
||||
@@ -429,45 +452,142 @@ class IDF_Views_Issue
|
||||
|
||||
public $search_precond = array('IDF_Precondition::accessIssues');
|
||||
public function search($request, $match)
|
||||
{
|
||||
$query = !isset($request->REQUEST['q']) ? '' : $request->REQUEST['q'];
|
||||
return $this->doSearch($request, $query, 'open');
|
||||
}
|
||||
|
||||
public $searchStatus_precond = array('IDF_Precondition::accessIssues');
|
||||
public function searchStatus($request, $match)
|
||||
{
|
||||
$query = !isset($request->REQUEST['q']) ? '' : $request->REQUEST['q'];
|
||||
$status = in_array($match[2], array('open', 'closed')) ? $match[2] : 'open';
|
||||
return $this->doSearch($request, $query, $status);
|
||||
}
|
||||
|
||||
public $searchLabel_precond = array('IDF_Precondition::accessIssues');
|
||||
public function searchLabel($request, $match)
|
||||
{
|
||||
$query = !isset($request->REQUEST['q']) ? '' : $request->REQUEST['q'];
|
||||
$tag_id = intval($match[2]);
|
||||
$status = in_array($match[3], array('open', 'closed')) ? $match[3] : 'open';
|
||||
return $this->doSearch($request, $query, $status, $tag_id);
|
||||
}
|
||||
|
||||
private function doSearch($request, $query, $status, $tag_id=null)
|
||||
{
|
||||
$prj = $request->project;
|
||||
if (!isset($request->REQUEST['q']) or trim($request->REQUEST['q']) == '') {
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Issue::index',
|
||||
array($prj->shortname));
|
||||
if (trim($query) == '') {
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Issue::index', array($prj->shortname));
|
||||
return new Pluf_HTTP_Response_Redirect($url);
|
||||
}
|
||||
$q = $request->REQUEST['q'];
|
||||
$title = sprintf(__('Search Issues - %s'), $q);
|
||||
$issues = new Pluf_Search_ResultSet(IDF_Search::mySearch($q, $prj, 'IDF_Issue'));
|
||||
if (count($issues) > 100) {
|
||||
// no more than 100 results as we do not care
|
||||
$issues->results = array_slice($issues->results, 0, 100);
|
||||
|
||||
$tag = null;
|
||||
if ($tag_id !== null) {
|
||||
$tag = Pluf_Shortcuts_GetObjectOr404('IDF_Tag', $tag_id);
|
||||
}
|
||||
|
||||
$title = sprintf(__('Search issues - %s'), $query);
|
||||
if ($status === 'closed') {
|
||||
$title = sprintf(__('Search closed issues - %s'), $query);
|
||||
}
|
||||
|
||||
// using Plufs ResultSet implementation here is inefficient, because
|
||||
// it makes a SELECT for each item and does not allow for further
|
||||
// filtering neither, so we just return the ids and filter by them
|
||||
// and other things in the next round
|
||||
$results = IDF_Search::mySearch($query, $prj, 'IDF_Issue');
|
||||
|
||||
$issue_ids = array(0);
|
||||
foreach ($results as $result) {
|
||||
$issue_ids[] = $result['model_id'];
|
||||
}
|
||||
|
||||
$otags = $prj->getTagIdsByStatus($status);
|
||||
if (count($otags) == 0) $otags[] = 0;
|
||||
$sql = new Pluf_SQL(
|
||||
'id IN ('.implode(',', $issue_ids).') '.
|
||||
'AND status IN ('.implode(', ', $otags).') '.
|
||||
($tag_id !== null ? 'AND idf_tag_id='.$tag_id.' ' : '')
|
||||
);
|
||||
$model = new IDF_Issue();
|
||||
$issues = $model->getList(array('filter' => $sql->gen(), 'view' => 'join_tags'));
|
||||
|
||||
// we unfortunately loose the original sort order,
|
||||
// so we manually have to apply it here again
|
||||
$sorted_issues = new ArrayObject();
|
||||
$filtered_issue_ids = array(0);
|
||||
foreach ($issue_ids as $issue_id) {
|
||||
foreach ($issues as $issue) {
|
||||
if ($issue->id != $issue_id)
|
||||
continue;
|
||||
if (array_key_exists($issue_id, $sorted_issues))
|
||||
continue;
|
||||
$sorted_issues[$issue_id] = $issue;
|
||||
$filtered_issue_ids[] = $issue_id;
|
||||
}
|
||||
}
|
||||
|
||||
$pag = new Pluf_Paginator();
|
||||
$pag->items = $issues;
|
||||
$pag->class = 'recent-issues';
|
||||
$pag->item_extra_props = array('project_m' => $prj,
|
||||
$pag->items = $sorted_issues;
|
||||
$pag->item_extra_props = array(
|
||||
'project_m' => $prj,
|
||||
'shortname' => $prj->shortname,
|
||||
'current_user' => $request->user);
|
||||
'current_user' => $request->user
|
||||
);
|
||||
$pag->summary = __('This table shows the found issues.');
|
||||
$pag->action = array('IDF_Views_Issue::search', array($prj->shortname), array('q'=> $q));
|
||||
$pag->extra_classes = array('a-c', '', 'a-c', '');
|
||||
$list_display = array(
|
||||
$pag->configure(array(
|
||||
'id' => __('Id'),
|
||||
array('summary', 'IDF_Views_Issue_SummaryAndLabels', __('Summary')),
|
||||
array('status', 'IDF_Views_Issue_ShowStatus', __('Status')),
|
||||
array('modif_dtime', 'Pluf_Paginator_DateAgo', __('Last Updated')),
|
||||
);
|
||||
$pag->configure($list_display);
|
||||
$pag->items_per_page = 100;
|
||||
));
|
||||
// disable paginating
|
||||
$pag->items_per_page = PHP_INT_MAX;
|
||||
$pag->no_results_text = __('No issues were found.');
|
||||
$pag->setFromRequest($request);
|
||||
$params = array('page_title' => $title,
|
||||
'issues' => $pag,
|
||||
'q' => $q,
|
||||
);
|
||||
return Pluf_Shortcuts_RenderToResponse('idf/issues/search.html', $params, $request);
|
||||
|
||||
if ($tag_id === null) {
|
||||
$pag->action = array('IDF_Views_Issue::searchStatus',
|
||||
array($prj->shortname, $status),
|
||||
array('q'=> $query),
|
||||
);
|
||||
} else {
|
||||
$pag->action = array('IDF_Views_Issue::searchLabel',
|
||||
array($prj->shortname, $tag_id, $status),
|
||||
array('q'=> $query),
|
||||
);
|
||||
}
|
||||
|
||||
// get stats about the issues
|
||||
$open = $prj->getIssueCountByStatus('open', $tag, $issue_ids);
|
||||
$closed = $prj->getIssueCountByStatus('closed', $tag, $issue_ids);
|
||||
|
||||
// query the available tags for this search result
|
||||
$all_tags = $prj->getTagsByIssues($filtered_issue_ids);
|
||||
$grouped_tags = array();
|
||||
foreach ($all_tags as $atag) {
|
||||
// group by class
|
||||
if (!array_key_exists($atag->class, $grouped_tags)) {
|
||||
$grouped_tags[$atag->class] = array();
|
||||
}
|
||||
$grouped_tags[$atag->class][] = $atag;
|
||||
}
|
||||
|
||||
$params = array(
|
||||
'page_title' => $title,
|
||||
'issues' => $pag,
|
||||
'query' => $query,
|
||||
'status' => $status,
|
||||
'open' => $open,
|
||||
'closed' => $closed,
|
||||
'tag' => $tag,
|
||||
'all_tags' => $grouped_tags,
|
||||
);
|
||||
|
||||
return Pluf_Shortcuts_RenderToResponse('idf/issues/search.html', $params, $request);
|
||||
}
|
||||
|
||||
public $view_precond = array('IDF_Precondition::accessIssues');
|
||||
@@ -615,6 +735,13 @@ class IDF_Views_Issue
|
||||
{
|
||||
$prj = $request->project;
|
||||
$status = $match[2];
|
||||
|
||||
if (mb_strtolower($status) == 'open') {
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Issue::index',
|
||||
array($prj->shortname));
|
||||
return new Pluf_HTTP_Response_Redirect($url);
|
||||
}
|
||||
|
||||
$title = sprintf(__('%s Closed Issues'), (string) $prj);
|
||||
// Get stats about the issues
|
||||
$open = $prj->getIssueCountByStatus('open');
|
||||
@@ -747,7 +874,13 @@ class IDF_Views_Issue
|
||||
else {
|
||||
// ID-based search
|
||||
if (is_numeric($query)) {
|
||||
$sql = new Pluf_SQL('project=%s AND id LIKE %s', array($prj->id, $query.'%'));
|
||||
$sql = 'project=%s AND CAST(id AS VARCHAR) LIKE %s';
|
||||
// MySQL can't cast to VARCHAR and a CAST to CHAR converts
|
||||
// the whole number, not just the first digit
|
||||
if (strtolower(Pluf::f('db_engine')) == 'mysql') {
|
||||
$sql = 'project=%s AND CAST(id AS CHAR) LIKE %s';
|
||||
}
|
||||
$sql = new Pluf_SQL($sql, array($prj->id, $query.'%'));
|
||||
$tmp = Pluf::factory('IDF_Issue')->getList(array(
|
||||
'filter' => $sql->gen(),
|
||||
'order' => 'id ASC'
|
||||
@@ -863,9 +996,8 @@ class IDF_Views_Issue
|
||||
$r = $project->getRelationsFromConfig();
|
||||
$auto['auto_relation_types'] = '';
|
||||
foreach ($r as $rt) {
|
||||
$esc = Pluf_esc($rt);
|
||||
$auto['auto_relation_types'] .= sprintf('{ name: "%s", to: "%s" }, ',
|
||||
$esc, $esc);
|
||||
Pluf_esc(__($rt)), Pluf_esc($rt));
|
||||
}
|
||||
$auto['auto_relation_types'] = substr($auto['auto_relation_types'], 0, -2);
|
||||
return $auto;
|
||||
|
@@ -418,8 +418,17 @@ class IDF_Views_Project
|
||||
$title = sprintf(__('%s Documentation Configuration'), (string) $prj);
|
||||
$conf = new IDF_Conf();
|
||||
$conf->setProject($prj);
|
||||
|
||||
// Get the Wiki list pages
|
||||
$sql = new Pluf_SQL('project=%s', array($prj->id));
|
||||
$pages = Pluf::factory('IDF_WikiPage')->getList(array('filter'=>$sql->gen()));
|
||||
$auto_wiki_page_name = "";
|
||||
foreach ($pages as $p) {
|
||||
$auto_wiki_page_name .= '{ name: "' . $p->summary . '", to: "' . $p->title . '" }, ';
|
||||
}
|
||||
|
||||
if ($request->method == 'POST') {
|
||||
$form = new IDF_Form_WikiConf($request->POST);
|
||||
$form = new IDF_Form_WikiConf(array_merge($request->POST, array('projectId' => $prj->id)));
|
||||
if ($form->isValid()) {
|
||||
foreach ($form->cleaned_data as $key=>$val) {
|
||||
$conf->setVal($key, $val);
|
||||
@@ -431,7 +440,7 @@ class IDF_Views_Project
|
||||
}
|
||||
} else {
|
||||
$params = array();
|
||||
$keys = array('labels_wiki_predefined', 'labels_wiki_one_max');
|
||||
$keys = array('labels_wiki_predefined', 'labels_wiki_one_max', 'wiki_default_page');
|
||||
foreach ($keys as $key) {
|
||||
$_val = $conf->getVal($key, false);
|
||||
if ($_val !== false) {
|
||||
@@ -447,6 +456,7 @@ class IDF_Views_Project
|
||||
array(
|
||||
'page_title' => $title,
|
||||
'form' => $form,
|
||||
'auto_wiki_page_name' => $auto_wiki_page_name,
|
||||
),
|
||||
$request);
|
||||
}
|
||||
|
@@ -35,7 +35,43 @@ class IDF_Views_Wiki
|
||||
* View list of issues for a given project.
|
||||
*/
|
||||
public $index_precond = array('IDF_Precondition::accessWiki');
|
||||
public function index($request, $match, $api=false)
|
||||
public function index($request, $match)
|
||||
{
|
||||
$project = $request->project;
|
||||
|
||||
// Search for the default page
|
||||
$conf = new IDF_Conf();
|
||||
$conf->setProject($project);
|
||||
$page = $conf->getVal('wiki_default_page', null);
|
||||
if ($page === null) {
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::listing',
|
||||
array($project->shortname));
|
||||
return new Pluf_HTTP_Response_Redirect($url);
|
||||
}
|
||||
|
||||
// Find the page
|
||||
$sql = new Pluf_SQL('project=%s AND title=%s',
|
||||
array($project->id, $page));
|
||||
$pages = Pluf::factory('IDF_WikiPage')->getList(array('filter'=>$sql->gen()));
|
||||
if ($pages->count() != 1) {
|
||||
// The default page have been delete
|
||||
$conf->setVal('wiki_default_page', null);
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::listing',
|
||||
array($project->shortname));
|
||||
return new Pluf_HTTP_Response_Redirect($url);
|
||||
}
|
||||
$page = $pages[0];
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::view',
|
||||
array($project->shortname, $page->title));
|
||||
return new Pluf_HTTP_Response_Redirect($url);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* View list of issues for a given project.
|
||||
*/
|
||||
public $listing_precond = array('IDF_Precondition::accessWiki');
|
||||
public function listing($request, $match, $api=false)
|
||||
{
|
||||
$prj = $request->project;
|
||||
$title = sprintf(__('%s Documentation'), (string) $prj);
|
||||
@@ -82,7 +118,7 @@ class IDF_Views_Wiki
|
||||
{
|
||||
$prj = $request->project;
|
||||
if (!isset($request->REQUEST['q']) or trim($request->REQUEST['q']) == '') {
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::index',
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::listing',
|
||||
array($prj->shortname));
|
||||
return new Pluf_HTTP_Response_Redirect($url);
|
||||
}
|
||||
@@ -152,13 +188,11 @@ class IDF_Views_Wiki
|
||||
$pag->items_per_page = 25;
|
||||
$pag->no_results_text = __('No documentation pages were found.');
|
||||
$pag->setFromRequest($request);
|
||||
$tags = $prj->getTagCloud('wiki');
|
||||
return Pluf_Shortcuts_RenderToResponse('idf/wiki/index.html',
|
||||
array(
|
||||
'page_title' => $title,
|
||||
'label' => $tag,
|
||||
'pages' => $pag,
|
||||
'tags' => $tags,
|
||||
'dlabel' => $dtag,
|
||||
),
|
||||
$request);
|
||||
@@ -184,7 +218,7 @@ class IDF_Views_Wiki
|
||||
$urlpage = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::view',
|
||||
array($prj->shortname, $page->title));
|
||||
$request->user->setMessage(sprintf(__('The page <a href="%s">%s</a> has been created.'), $urlpage, Pluf_esc($page->title)));
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::index',
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::listing',
|
||||
array($prj->shortname));
|
||||
return new Pluf_HTTP_Response_Redirect($url);
|
||||
} elseif (isset($request->POST['preview'])) {
|
||||
@@ -228,7 +262,13 @@ class IDF_Views_Wiki
|
||||
if (isset($request->GET['rev']) and preg_match('/^[0-9]+$/', $request->GET['rev'])) {
|
||||
$oldrev = Pluf_Shortcuts_GetObjectOr404('IDF_WikiRevision',
|
||||
$request->GET['rev']);
|
||||
if ($oldrev->wikipage != $page->id or $oldrev->is_head == true) {
|
||||
if ($oldrev->is_head == true) {
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::view',
|
||||
array($prj->shortname, $page->title));
|
||||
return new Pluf_HTTP_Response_Redirect($url);
|
||||
}
|
||||
|
||||
if ($oldrev->wikipage != $page->id) {
|
||||
return new Pluf_HTTP_Response_NotFound($request);
|
||||
}
|
||||
}
|
||||
@@ -254,6 +294,39 @@ class IDF_Views_Wiki
|
||||
$request);
|
||||
}
|
||||
|
||||
/**
|
||||
* See the revision list of a documentation page.
|
||||
*/
|
||||
public $history_precond = array('IDF_Precondition::accessWiki');
|
||||
public function history($request, $match)
|
||||
{
|
||||
$prj = $request->project;
|
||||
// Find the page
|
||||
$sql = new Pluf_SQL('project=%s AND title=%s',
|
||||
array($prj->id, $match[2]));
|
||||
$pages = Pluf::factory('IDF_WikiPage')->getList(array('filter'=>$sql->gen()));
|
||||
if ($pages->count() != 1) {
|
||||
return new Pluf_HTTP_Response_NotFound($request);
|
||||
}
|
||||
$page = $pages[0];
|
||||
$ptags = self::getWikiTags($prj);
|
||||
$dtag = array_pop($ptags); // The last tag is the deprecated tag.
|
||||
$tags = $page->get_tags_list();
|
||||
$dep = Pluf_Model_InArray($dtag, $tags);
|
||||
$title = sprintf(__('History of the wiki page %s'), $page->title);
|
||||
$revision = $page->get_current_revision();
|
||||
$revs = $page->get_revisions_list(array('order' => 'creation_dtime DESC'));
|
||||
return Pluf_Shortcuts_RenderToResponse('idf/wiki/history.html',
|
||||
array(
|
||||
'page' => $page,
|
||||
'page_title' => $title,
|
||||
'rev' => $revision,
|
||||
'revs' => $revs,
|
||||
'tags' => $tags,
|
||||
),
|
||||
$request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a revision of a page.
|
||||
*/
|
||||
@@ -293,6 +366,57 @@ class IDF_Views_Wiki
|
||||
$request);
|
||||
}
|
||||
|
||||
public $restoreRev_precond = array('IDF_Precondition::accessWiki',
|
||||
'IDF_Precondition::projectMemberOrOwner');
|
||||
public function restoreRev($request, $match)
|
||||
{
|
||||
$prj = $request->project;
|
||||
$oldrev = Pluf_Shortcuts_GetObjectOr404('IDF_WikiRevision', $match[2]);
|
||||
$page = $oldrev->get_wikipage();
|
||||
$prj->inOr404($page);
|
||||
|
||||
// Prevent restore the current version
|
||||
if ($oldrev->is_head == true) {
|
||||
$request->user->setMessage(__('This revision is already the current revision.'));
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::view',
|
||||
array($prj->shortname, $page->title));
|
||||
return new Pluf_HTTP_Response_Redirect($url);
|
||||
}
|
||||
|
||||
$params = array(
|
||||
'project' => $prj,
|
||||
'user' => $request->user,
|
||||
'page' => $page,
|
||||
);
|
||||
|
||||
$data = array(
|
||||
'title' => $page->title,
|
||||
'summary' => $page->summary,
|
||||
'content' => $oldrev->content,
|
||||
'comment' => sprintf(__('Restore old revision (%s)'), $oldrev->id),
|
||||
);
|
||||
|
||||
$tags = $page->get_tags_list();
|
||||
for ($i=1;$i<4;$i++) {
|
||||
if (isset($tags[$i-1])) {
|
||||
if ($tags[$i-1]->class != 'Other') {
|
||||
$data['label'.$i] = (string) $tags[$i-1];
|
||||
} else {
|
||||
$data['label'.$i] = $tags[$i-1]->name;
|
||||
}
|
||||
} else {
|
||||
$data['label'.$i] = '';
|
||||
}
|
||||
}
|
||||
|
||||
$form = new IDF_Form_WikiUpdate($data, $params);
|
||||
$page = $form->save();
|
||||
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::view',
|
||||
array($prj->shortname, $page->title));
|
||||
return new Pluf_HTTP_Response_Redirect($url);
|
||||
}
|
||||
|
||||
/**
|
||||
* View a documentation page.
|
||||
*/
|
||||
@@ -322,7 +446,7 @@ class IDF_Views_Wiki
|
||||
$urlpage = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::view',
|
||||
array($prj->shortname, $page->title));
|
||||
$request->user->setMessage(sprintf(__('The page <a href="%s">%s</a> has been updated.'), $urlpage, Pluf_esc($page->title)));
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::index',
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::listing',
|
||||
array($prj->shortname));
|
||||
return new Pluf_HTTP_Response_Redirect($url);
|
||||
} elseif (isset($request->POST['preview'])) {
|
||||
@@ -360,7 +484,7 @@ class IDF_Views_Wiki
|
||||
if ($form->isValid()) {
|
||||
$form->save();
|
||||
$request->user->setMessage(__('The documentation page has been deleted.'));
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::index',
|
||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Wiki::listing',
|
||||
array($prj->shortname));
|
||||
return new Pluf_HTTP_Response_Redirect($url);
|
||||
}
|
||||
|
@@ -221,4 +221,51 @@ class IDF_WikiPage extends Pluf_Model
|
||||
$tmpl = new Pluf_Template('idf/wiki/feedfragment.xml');
|
||||
return $tmpl->render($context);
|
||||
}
|
||||
|
||||
function projectCreated($signal, &$params)
|
||||
{
|
||||
$project = $params['project'];
|
||||
$users = $project->getMembershipData();
|
||||
$user = $users['owners'][0];
|
||||
$conf = $project->getConf();
|
||||
|
||||
// Insert default wiki page
|
||||
$tmpl = new Pluf_Template('idf/wiki/wiki-default-page.mdtext');
|
||||
$context = new Pluf_Template_Context(array('project' => $project));
|
||||
$content = $tmpl->render($context);
|
||||
$page = new IDF_WikiPage();
|
||||
$page->project = $project;
|
||||
$page->submitter = $user;
|
||||
$page->summary = __('Default page for your project Wiki.');
|
||||
$page->title = 'IndeferoSummaryDefault';
|
||||
$page->create();
|
||||
$rev = new IDF_WikiRevision();
|
||||
$rev->wikipage = $page;
|
||||
$rev->content = $content;
|
||||
$rev->submitter = $user;
|
||||
$rev->summary = __('Initial page creation');
|
||||
$rev->create();
|
||||
$rev->notify($project->getConf());
|
||||
|
||||
// Insert markdown help wiki page
|
||||
$tmpl = new Pluf_Template('idf/wiki/wiki-markdown-help.mdtext');
|
||||
$context = new Pluf_Template_Context(array('project' => $project));
|
||||
$content = $tmpl->render($context);
|
||||
$page = new IDF_WikiPage();
|
||||
$page->project = $project;
|
||||
$page->submitter = $user;
|
||||
$page->summary = __('Help about Markdown syntax.');
|
||||
$page->title = 'IndeferoMarkdownHelp';
|
||||
$page->create();
|
||||
$rev = new IDF_WikiRevision();
|
||||
$rev->wikipage = $page;
|
||||
$rev->content = $content;
|
||||
$rev->submitter = $user;
|
||||
$rev->summary = __('Initial page creation');
|
||||
$rev->create();
|
||||
$rev->notify($project->getConf());
|
||||
|
||||
$conf->setVal('wiki_default_page', 'IndeferoSummaryDefault');
|
||||
$conf->setVal('labels_wiki_predefined', IDF_Form_WikiConf::init_predefined);
|
||||
}
|
||||
}
|
@@ -119,7 +119,7 @@ $cfg['time_zone'] = 'Europe/Berlin';
|
||||
# Configure which languages should be available in your forge.
|
||||
# If you want to enable an additional language, ensure that the
|
||||
# language file in question resides in 'src/IDF/locale'.
|
||||
$cfg['languages'] = array('en', 'fr', 'de', 'es_ES');
|
||||
$cfg['languages'] = array('en', 'fr', 'de', 'es_ES', 'ru');
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------- #
|
||||
|
@@ -128,6 +128,16 @@ $ctl[] = array('regex' => '#^/p/([\-\w]+)/issues/search/$#',
|
||||
'model' => 'IDF_Views_Issue',
|
||||
'method' => 'search');
|
||||
|
||||
$ctl[] = array('regex' => '#^/p/([\-\w]+)/issues/search/status/(\w+)/$#',
|
||||
'base' => $base,
|
||||
'model' => 'IDF_Views_Issue',
|
||||
'method' => 'searchStatus');
|
||||
|
||||
$ctl[] = array('regex' => '#^/p/([\-\w]+)/issues/search/label/(\d+)/(\w+)/$#',
|
||||
'base' => $base,
|
||||
'model' => 'IDF_Views_Issue',
|
||||
'method' => 'searchLabel');
|
||||
|
||||
$ctl[] = array('regex' => '#^/p/([\-\w]+)/issues/(\d+)/$#',
|
||||
'base' => $base,
|
||||
'model' => 'IDF_Views_Issue',
|
||||
@@ -153,10 +163,10 @@ $ctl[] = array('regex' => '#^/p/([\-\w]+)/issues/create/$#',
|
||||
'model' => 'IDF_Views_Issue',
|
||||
'method' => 'create');
|
||||
|
||||
$ctl[] = array('regex' => '#^/p/([\-\w]+)/issues/my/(\w+)/$#',
|
||||
$ctl[] = array('regex' => '#^/p/([\-\w]+)/issues/(.*)/(\w+)/$#',
|
||||
'base' => $base,
|
||||
'model' => 'IDF_Views_Issue',
|
||||
'method' => 'myIssues');
|
||||
'method' => 'userIssues');
|
||||
|
||||
$ctl[] = array('regex' => '#^/p/([\-\w]+)/issues/attachment/(\d+)/(.*)$#',
|
||||
'base' => $base,
|
||||
@@ -252,6 +262,11 @@ $ctl[] = array('regex' => '#^/p/([\-\w]+)/doc/$#',
|
||||
'model' => 'IDF_Views_Wiki',
|
||||
'method' => 'index');
|
||||
|
||||
$ctl[] = array('regex' => '#^/p/([\-\w]+)/doc/list/$#',
|
||||
'base' => $base,
|
||||
'model' => 'IDF_Views_Wiki',
|
||||
'method' => 'listing');
|
||||
|
||||
$ctl[] = array('regex' => '#^/p/([\-\w]+)/doc/create/$#',
|
||||
'base' => $base,
|
||||
'model' => 'IDF_Views_Wiki',
|
||||
@@ -277,11 +292,21 @@ $ctl[] = array('regex' => '#^/p/([\-\w]+)/doc/delrev/(\d+)/$#',
|
||||
'model' => 'IDF_Views_Wiki',
|
||||
'method' => 'deleteRev');
|
||||
|
||||
$ctl[] = array('regex' => '#^/p/([\-\w]+)/doc/resrev/(\d+)/$#',
|
||||
'base' => $base,
|
||||
'model' => 'IDF_Views_Wiki',
|
||||
'method' => 'restoreRev');
|
||||
|
||||
$ctl[] = array('regex' => '#^/p/([\-\w]+)/doc/delete/(\d+)/$#',
|
||||
'base' => $base,
|
||||
'model' => 'IDF_Views_Wiki',
|
||||
'method' => 'delete');
|
||||
|
||||
$ctl[] = array('regex' => '#^/p/([\-\w]+)/doc/history/(.*)/$#',
|
||||
'base' => $base,
|
||||
'model' => 'IDF_Views_Wiki',
|
||||
'method' => 'history');
|
||||
|
||||
$ctl[] = array('regex' => '#^/p/([\-\w]+)/page/(.*)/$#',
|
||||
'base' => $base,
|
||||
'model' => 'IDF_Views_Wiki',
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
4587
src/IDF/locale/pt_BR/idf.po
Normal file
4587
src/IDF/locale/pt_BR/idf.po
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
4581
src/IDF/locale/tr/idf.po
Normal file
4581
src/IDF/locale/tr/idf.po
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -115,4 +115,10 @@ Pluf_Signal::connect('queuecron.php::run',
|
||||
Pluf_Signal::connect('IDF_Queue::processItem',
|
||||
Pluf::f('idf_hook_process_item',
|
||||
array('IDF_Webhook', 'process')));
|
||||
|
||||
#
|
||||
# Wiki init
|
||||
Pluf_Signal::connect('IDF_Project::created',
|
||||
array('IDF_WikiPage', 'projectCreated'));
|
||||
|
||||
return $m;
|
||||
|
@@ -16,6 +16,34 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">{$form.f.wiki_default_page.labelTag}:<br />
|
||||
{if $form.f.wiki_default_page.errors}{$form.f.wiki_default_page.fieldErrors}{/if}
|
||||
{$form.f.wiki_default_page|unsafe}
|
||||
</td>
|
||||
<script type="text/javascript" src="{media '/idf/js/jquery.bgiframe.min.js'}"></script>
|
||||
<script type="text/javascript" src="{media '/idf/js/jquery.autocomplete.min.js'}"></script>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
{literal}
|
||||
$(document).ready(function(){
|
||||
var auto_wiki_page_name = [{/literal}{$auto_wiki_page_name|safe}{literal}];
|
||||
$("#id_wiki_default_page").autocomplete(auto_wiki_page_name, {
|
||||
minChars: 0,
|
||||
width: 310,
|
||||
matchContains: true,
|
||||
max: 50,
|
||||
highlightItem: false,
|
||||
formatItem: function(row, i, max, term) {
|
||||
return row.to.replace(new RegExp("(" + term + ")", "gi"), "<strong>$1</strong>") + " <span style='font-size: 80%;'>" + row.name + "</span>";
|
||||
},
|
||||
formatResult: function(row) {
|
||||
return row.to;
|
||||
}
|
||||
});
|
||||
});
|
||||
{/literal}
|
||||
</script>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="submit" value="{trans 'Save Changes'}" name="submit" />
|
||||
</td>
|
||||
|
@@ -2,12 +2,15 @@
|
||||
{block tabissues} class="active"{/block}
|
||||
{block subtabs}
|
||||
<div id="sub-tabs">
|
||||
<a {if $inSummaryIssues}class="active" {/if}href="{url 'IDF_Views_Issue::summary', array($project.shortname)}">{trans 'Summary'}</a>
|
||||
| <a {if $inOpenIssues}class="active" {/if}href="{url 'IDF_Views_Issue::index', array($project.shortname)}">{trans 'Open Issues'}</a>
|
||||
{if !$user.isAnonymous()} | <a {if $inCreate}class="active" {/if}href="{url 'IDF_Views_Issue::create', array($project.shortname)}">{trans 'New Issue'}</a> | <a {if $inMyIssues}class="active" {/if}href="{url 'IDF_Views_Issue::myIssues', array($project.shortname, 'submit')}">{trans 'My Issues'}</a>
|
||||
| <a {if $inWatchList}class="active" {/if}href="{url 'IDF_Views_Issue::watchList', array($project.shortname, 'open')}">{trans 'My watch list'}</a>{/if} |
|
||||
<form class="star" action="{url 'IDF_Views_Issue::search', array($project.shortname)}" method="get">
|
||||
<input accesskey="4" type="text" value="{$q}" name="q" size="20" />
|
||||
<a {if $inSummaryIssues}class="active" {/if}href="{url 'IDF_Views_Issue::summary', array($project.shortname)}">{trans 'Summary'}</a>
|
||||
| <a {if $inAllIssues}class="active" {/if}href="{url 'IDF_Views_Issue::index', array($project.shortname)}">{trans 'All Issues'}</a>
|
||||
{if !$user.isAnonymous()}
|
||||
| <a {if $inMyIssues}class="active" {/if}href="{url 'IDF_Views_Issue::userIssues', array($project.shortname, $user.login, 'submit')}">{trans 'My Issues'}</a>
|
||||
| <a {if $inWatchList}class="active" {/if}href="{url 'IDF_Views_Issue::watchList', array($project.shortname, 'open')}">{trans 'My watch list'}</a>
|
||||
| <a {if $inCreate}class="active" {/if}href="{url 'IDF_Views_Issue::create', array($project.shortname)}">{trans 'New Issue'}</a>
|
||||
{/if}
|
||||
| <form class="star" action="{url 'IDF_Views_Issue::search', array($project.shortname)}" method="get">
|
||||
<input accesskey="4" type="text" value="{$query}" name="q" size="20" />
|
||||
<input type="submit" name="s" value="{trans 'Search'}" />
|
||||
</form>
|
||||
{if $inIssue} |
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{extends "idf/issues/base.html"}
|
||||
{block docclass}yui-t1{/block}
|
||||
{block docclass}yui-t1{assign $inAllIssues=true}{/block}
|
||||
{block body}
|
||||
{$issues.render}
|
||||
{if !$user.isAnonymous()}
|
||||
@@ -8,16 +8,15 @@
|
||||
|
||||
{/block}
|
||||
{block context}
|
||||
<p><strong>{trans 'Label:'}</strong>
|
||||
{aurl 'url', 'IDF_Views_Issue::listLabel', array($project.shortname, $label.id, 'open')}
|
||||
<a href="{$url}" class="label"><strong>{$label.class}:</strong>{$label.name}</a></p>
|
||||
{aurl 'open_url', 'IDF_Views_Issue::listLabel', array($project.shortname, $label.id, 'open')}
|
||||
{aurl 'closed_url', 'IDF_Views_Issue::listLabel', array($project.shortname, $label.id, 'closed')}
|
||||
{blocktrans}<p><strong>Open issues:</strong> <a href="{$open_url}">{$open}</a></p>
|
||||
<p><strong>Closed issues:</strong> <a href="{$closed_url}">{$closed}</a></p>
|
||||
{/blocktrans}{if $completion}
|
||||
{/blocktrans}
|
||||
<p><strong>{trans 'Label:'}</strong>
|
||||
{aurl 'url', 'IDF_Views_Issue::listLabel', array($project.shortname, $label.id, 'open')}
|
||||
<a href="{$url}" class="label"><strong>{$label.class}:</strong>{$label.name}</a></p>
|
||||
{if $completion}
|
||||
<p><strong>{trans 'Completion:'}</strong> {$completion}</p>
|
||||
{/if}
|
||||
|
||||
|
||||
{/block}
|
||||
|
@@ -14,8 +14,18 @@
|
||||
</ul>{/if}
|
||||
{if $c.changes}
|
||||
{foreach $c.changes as $w => $v}
|
||||
<strong>{if $w == 'su'}{trans 'Summary:'}{/if}{if $w == 'st'}{trans 'Status:'}{/if}{if $w == 'ow'}{trans 'Owner:'}{/if}{if $w == 'lb'}{trans 'Labels:'}{/if}</strong> {if $w == 'lb'}{assign $l = implode(', ', $v)}{$l}{else}{$v}{/if}<br />
|
||||
<strong>{if $w == 'su'}{trans 'Summary:'}{/if}{if $w == 'st'}{trans 'Status:'}{/if}{if $w == 'ow'}{trans 'Owner:'}{/if}{if $w == 'lb'}{trans 'Labels:'}{/if}{if $w == 'rel'}{trans 'Relations:'}{/if}</strong>
|
||||
{if $w == 'lb' or $w == 'rel'}
|
||||
{foreach $v as $t => $ls}
|
||||
{foreach $ls as $l}
|
||||
{if $t == 'rem'}<s>{/if}{$l}{if $t == 'rem'}</s>{/if}
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
{else}
|
||||
{$v}
|
||||
{/if}<br />
|
||||
{/foreach}
|
||||
{/if}
|
||||
</div></content>
|
||||
</entry>
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{extends "idf/issues/base.html"}
|
||||
{block docclass}yui-t2{assign $inOpenIssues=true}{/block}
|
||||
{block docclass}yui-t2{assign $inAllIssues=true}{/block}
|
||||
{block body}
|
||||
{$issues.render}
|
||||
{if !$user.isAnonymous()}
|
||||
@@ -13,6 +13,5 @@
|
||||
{blocktrans}<p><strong>Open issues:</strong> <a href="{$open_url}">{$open}</a></p>
|
||||
<p><strong>Closed issues:</strong> <a href="{$closed_url}">{$closed}</a></p>{/blocktrans}
|
||||
{assign $cloud_url = 'IDF_Views_Issue::listLabel'}
|
||||
{assign $cloud = 'issues'}
|
||||
{include 'idf/tags-cloud.html'}
|
||||
{/block}
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
{if strlen($c.content) > 0}{$c.content|safe}{/if}{if $c.changedIssue()}
|
||||
{foreach $c.changes as $w => $v}
|
||||
{if $w == 'su'}{trans 'Summary:'}{/if}{if $w == 'st'}{trans 'Status:'}{/if}{if $w == 'ow'}{trans 'Owner:'}{/if}{if $w == 'lb'}{trans 'Labels:'}{/if} {if $w == 'lb'}{assign $l = implode(', ', $v)}{$l}{else}{$v}{/if}{/foreach}{/if}{assign $attachments = $c.get_attachment_list()}{if $attachments.count() > 0}
|
||||
{if $w == 'su'}{trans 'Summary:'}{/if}{if $w == 'st'}{trans 'Status:'}{/if}{if $w == 'ow'}{trans 'Owner:'}{/if}{if $w == 'lb'}{trans 'Labels:'}{/if}{if $w == 'rel'}{trans 'Relations:'}{/if} {if $w == 'lb' or $w == 'rel'}{foreach $v as $t => $ls}{foreach $ls as $l}{if $t == 'rem'}-{/if}{$l} {/foreach}{/foreach}{else}{$v}{/if}{/foreach}{/if}{assign $attachments = $c.get_attachment_list()}{if $attachments.count() > 0}
|
||||
|
||||
{trans 'Attachments:'}{foreach $attachments as $a}
|
||||
- {$a.filename|safe} - {$a.filesize|ssize}
|
||||
|
@@ -68,6 +68,9 @@
|
||||
return row.to;
|
||||
}
|
||||
});
|
||||
{/literal}
|
||||
{if $issue}
|
||||
{literal}
|
||||
$("#id_relation_issue" + idx).autocomplete("{/literal}{url 'IDF_Views_Issue::autoCompleteIssueList', array($project.shortname, $issue.id)}{literal}", {
|
||||
minChars: 0,
|
||||
width: 310,
|
||||
@@ -83,6 +86,9 @@
|
||||
return row[1];
|
||||
}
|
||||
});
|
||||
{/literal}
|
||||
{/if}
|
||||
{literal}
|
||||
}
|
||||
});
|
||||
{/literal} //-->
|
||||
|
@@ -8,5 +8,25 @@
|
||||
|
||||
{/block}
|
||||
{block context}
|
||||
<p><strong>{trans 'Found issues:'}</strong> {$issues.nb_items}</p>
|
||||
{aurl 'open_url', 'IDF_Views_Issue::searchStatus', array($project.shortname, 'open'), array('q' => $query)}
|
||||
{aurl 'closed_url', 'IDF_Views_Issue::searchStatus', array($project.shortname, 'closed'), array('q' => $query)}
|
||||
{if $tag != null}
|
||||
{aurl 'open_url', 'IDF_Views_Issue::searchLabel', array($project.shortname, $tag.id, 'open'), array('q' => $query)}
|
||||
{aurl 'closed_url', 'IDF_Views_Issue::searchLabel', array($project.shortname, $tag.id, 'closed'), array('q' => $query)}
|
||||
{/if}
|
||||
{blocktrans}
|
||||
<p><strong>Found open issues:</strong> <a href="{$open_url}">{$open}</a></p>
|
||||
<p><strong>Found closed issues:</strong> <a href="{$closed_url}">{$closed}</a></p>{/blocktrans}
|
||||
{if $tag !== null}
|
||||
{blocktrans}<p><strong>Label:</strong>
|
||||
<a href="{$open_url}" class="label"><strong>{$tag.class}:</strong>{$tag.name}</a></p>{/blocktrans}
|
||||
{else}
|
||||
{* yes, this is duplicated from tags-cloud.html, but the code there cannot be easily overridden *}
|
||||
<div id="tagscloud" class="smaller"><dl>{foreach $all_tags as $class => $labels}
|
||||
<dt class="label">{$class}</dt>
|
||||
{foreach $labels as $idx => $label}
|
||||
{aurl 'url', 'IDF_Views_Issue::searchLabel', array($project.shortname, $label.id, $status), array('q'=> $query)}
|
||||
<dd><a href="{$url}" class="label">{$label.name}{if $idx != count($labels) - 1},{/if}</a></dd>
|
||||
{/foreach}{/foreach}</dl></p>
|
||||
{/if}
|
||||
{/block}
|
||||
|
@@ -71,7 +71,12 @@
|
||||
<tbody>
|
||||
{foreach $ownerStatistics as $key => $value}
|
||||
<tr>
|
||||
<td class="name">{$key}</td>
|
||||
<td class="name">
|
||||
{if !empty($value[2])}
|
||||
{aurl 'url', 'IDF_Views_Issue::userIssues', array($project.shortname, $value[2], 'owner')}
|
||||
<a href="{$url}">{$key}</a>
|
||||
{else}{$key}{/if}
|
||||
</td>
|
||||
<td class="count">{$value[0]}</td>
|
||||
<td class="graph">
|
||||
<table class='graph'>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{extends "idf/issues/base.html"}
|
||||
{block docclass}yui-t2{assign $inMyIssues = true}{/block}
|
||||
{block docclass}yui-t2{if $user.login == $login}{assign $inMyIssues = true}{/if}{/block}
|
||||
{block body}
|
||||
{$issues.render}
|
||||
{if !$user.isAnonymous()}
|
||||
@@ -8,10 +8,10 @@
|
||||
|
||||
{/block}
|
||||
{block context}
|
||||
{aurl 'owner_url', 'IDF_Views_Issue::myIssues', array($project.shortname, 'owner')}
|
||||
{aurl 'submit_url', 'IDF_Views_Issue::myIssues', array($project.shortname, 'submit')}
|
||||
{aurl 'owner_closed_url', 'IDF_Views_Issue::myIssues', array($project.shortname, 'ownerclosed')}
|
||||
{aurl 'submit_closed_url', 'IDF_Views_Issue::myIssues', array($project.shortname, 'submitclosed')}
|
||||
{aurl 'owner_url', 'IDF_Views_Issue::userIssues', array($project.shortname, $login, 'owner')}
|
||||
{aurl 'submit_url', 'IDF_Views_Issue::userIssues', array($project.shortname, $login, 'submit')}
|
||||
{aurl 'owner_closed_url', 'IDF_Views_Issue::userIssues', array($project.shortname, $login, 'ownerclosed')}
|
||||
{aurl 'submit_closed_url', 'IDF_Views_Issue::userIssues', array($project.shortname, $login, 'submitclosed')}
|
||||
<p><strong>{trans 'Submitted issues:'}</strong> <a href="{$submit_url}">{$nb_submit}</a>
|
||||
{if $nb_submit_closed}<br /><span class="helptext">{blocktrans $nb_submit_closed}See the <a href="{$submit_closed_url}">{$nb_submit_closed} closed</a>.{plural}See the <a href="{$submit_closed_url}">{$nb_submit_closed} closed</a>.{/blocktrans}</span>{/if}</p>
|
||||
{if $nb_owner > 0}
|
@@ -17,7 +17,7 @@
|
||||
{assign $submitter_data = $c.get_submitter_data()}
|
||||
<div class="issue-comment{if $i == 0} issue-comment-first{/if}{if $i == ($nc-1)} issue-comment-last{/if}" id="ic{$c.id}">
|
||||
{if $submitter_data.avatar != ''}
|
||||
<img style="float:right; position: relative; max-height: 60px; max-width: 60px;" src="{media}/upload/avatars/{$submitter_data.avatar}" alt=" " />
|
||||
<img style="float:right; position: relative; max-height: 60px; max-width: 60px;" src="{upload}/avatars/{$submitter_data.avatar}" alt=" " />
|
||||
{else}
|
||||
<img style="float:right; position: relative; max-height: 60px; max-width: 60px;" src="http://www.gravatar.com/avatar/{$submitter.email|md5}.jpg?s=60&d={media}/idf/img/spacer.gif" alt=" " />
|
||||
{/if}
|
||||
@@ -190,6 +190,7 @@
|
||||
{if count($related_issues) > 0}
|
||||
{foreach $related_issues as $verb => $rel_issues}
|
||||
<p>
|
||||
{assign $verb = __($verb)}
|
||||
<strong>{blocktrans}This issue {$verb}{/blocktrans}</strong><br />
|
||||
{foreach $rel_issues as $rel_issue}
|
||||
<span class="label">
|
||||
|
@@ -10,8 +10,8 @@
|
||||
{if $hasWikiAccess}{hotkey 'Shift+o', 'IDF_Views_Wiki::index', array($project.shortname)}{/if}
|
||||
{if $hasSourceAccess}{hotkey 'Shift+s', 'IDF_Views_Source::treeBase', array($project.shortname, $project.getScmRoot())}{/if}
|
||||
{if $hasIssuesAccess and !$user.isAnonymous()}
|
||||
{hotkey 'Shift+m', 'IDF_Views_Issue::myIssues', array($project.shortname, 'submit')}
|
||||
{hotkey 'Shift+w', 'IDF_Views_Issue::myIssues', array($project.shortname, 'owner')}
|
||||
{hotkey 'Shift+m', 'IDF_Views_Issue::userIssues', array($project.shortname, $user.login, 'submit')}
|
||||
{hotkey 'Shift+w', 'IDF_Views_Issue::userIssues', array($project.shortname, $user.login, 'owner')}
|
||||
{/if}{/if} //-->
|
||||
</script>
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
<div id="sub-tabs">
|
||||
<a {if $inOpenReviews}class="active" {/if}href="{url 'IDF_Views_Review::index', array($project.shortname)}">{trans 'Open Reviews'}</a> {*
|
||||
|
||||
{if !$user.isAnonymous()} | <a {if $inCreate}class="active" {/if}href="{url 'IDF_Views_Issue::create', array($project.shortname)}">{trans 'New Issue'}</a> | <a {if $inMyIssues}class="active" {/if}href="{url 'IDF_Views_Issue::myIssues', array($project.shortname, 'submit')}">{trans 'My Issues'}</a>{/if} |
|
||||
{if !$user.isAnonymous()} | <a {if $inCreate}class="active" {/if}href="{url 'IDF_Views_Issue::create', array($project.shortname)}">{trans 'New Issue'}</a> | <a {if $inMyIssues}class="active" {/if}href="{url 'IDF_Views_Issue::userIssues', array($project.shortname, $user.login, 'submit')}">{trans 'My Issues'}</a>{/if} |
|
||||
<form class="star" action="{url 'IDF_Views_Issue::search', array($project.shortname)}" method="get">
|
||||
<input accesskey="4" type="text" value="{$q}" name="q" size="20" />
|
||||
<input type="submit" name="s" value="{trans 'Search'}" />
|
||||
|
@@ -5,17 +5,4 @@
|
||||
{if !$user.isAnonymous()}
|
||||
{aurl 'url', 'IDF_Views_Review::create', array($project.shortname)}
|
||||
<p><a href="{$url}"><img style="vertical-align: text-bottom;" src="{media '/idf/img/add.png'}" alt="+" align="bottom" /></a> <a href="{$url}">{trans 'Start Code Review'}</a></p>{/if}
|
||||
|
||||
{/block}
|
||||
{block context}
|
||||
{*
|
||||
{aurl 'open_url', 'IDF_Views_Issue::index', array($project.shortname)}
|
||||
{aurl 'closed_url', 'IDF_Views_Issue::listStatus', array($project.shortname, 'closed')}
|
||||
{blocktrans}<p><strong>Open issues:</strong> <a href="{$open_url}">{$open}</a></p>
|
||||
<p><strong>Closed issues:</strong> <a href="{$closed_url}">{$closed}</a></p>{/blocktrans}
|
||||
{assign $class = ''}{assign $i = 0}
|
||||
<p class="smaller">{foreach $project.getTagCloud($cloud) as $label}
|
||||
{aurl 'url', 'IDF_Views_Issue::listLabel', array($project.shortname, $label.id, 'open')}
|
||||
{if $class != $label.class}{if $i != 0}<br />{/if}<strong class="label">{$label.class}:</strong> {/if}
|
||||
<a href="{$url}" class="label">{$label.name}</a>,{assign $class = $label.class}{assign $i = $i + 1}{/foreach}</p>
|
||||
*}{/block}
|
||||
|
@@ -10,8 +10,26 @@
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
<table class="disp" summary="">
|
||||
<tr><td>
|
||||
{if !$user.isAnonymous()}
|
||||
<div class="issue-submit-info" style="width: 50%; float: right; position: relative;">
|
||||
<p><strong>{trans 'How to Participate in a Code Review'}</strong></p>
|
||||
|
||||
<p>{blocktrans}Code review is a process in which
|
||||
after or before changes are commited into the code repository,
|
||||
different people discuss the code changes. The goal is
|
||||
to <strong>improve the quality of the code and the
|
||||
contributions</strong>, as such, you must be pragmatic when writing
|
||||
your review. Correctly mention the line numbers (in the old or in the
|
||||
new file) and try to keep a good balance between seriousness and fun.
|
||||
{/blocktrans}</p>
|
||||
<p>{blocktrans}
|
||||
<strong>Proposing code for review is intimidating</strong>, you know
|
||||
you will receive critics, so please, as a reviewer, <strong>keep this
|
||||
process fun</strong>, use it to help your contributor learn your
|
||||
coding standards and the structure of the code and <strong>make them want
|
||||
to propose more contributions</strong>.
|
||||
{/blocktrans}</p></div>
|
||||
{/if}
|
||||
<table class="commit" summary="">
|
||||
<tr>
|
||||
<th><strong>{trans 'Created:'}</strong></th><td>{$patch.creation_dtime|date:"%Y-%m-%d %H:%M:%S"} ({$patch.creation_dtime|dateago})</td>
|
||||
@@ -45,39 +63,12 @@
|
||||
<th> </th><td><a href="{$url}"><img style="vertical-align: text-bottom;" src="{media '/idf/img/package-grey.png'}" alt="{trans 'Archive'}" align="bottom" /></a> <a href="{$url}" class="soft">{trans 'Download the corresponding diff file'}</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td><td>
|
||||
{if !$user.isAnonymous()}
|
||||
<div class="issue-submit-info" style="width: 90%; float: right; position: relative;">
|
||||
<p><strong>{trans 'How to Participate in a Code Review'}</strong></p>
|
||||
|
||||
<p>{blocktrans}Code review is a process in which
|
||||
after or before changes are commited into the code repository,
|
||||
different people discuss the code changes. The goal is
|
||||
to <strong>improve the quality of the code and the
|
||||
contributions</strong>, as such, you must be pragmatic when writing
|
||||
your review. Correctly mention the line numbers (in the old or in the
|
||||
new file) and try to keep a good balance between seriousness and fun.
|
||||
{/blocktrans}</p>
|
||||
<p>{blocktrans}
|
||||
<strong>Proposing code for review is intimidating</strong>, you know
|
||||
you will receive critics, so please, as a reviewer, <strong>keep this
|
||||
process fun</strong>, use it to help your contributor learn your
|
||||
coding standards and the structure of the code and <strong>make them want
|
||||
to propose more contributions</strong>.
|
||||
{/blocktrans}</p></div>
|
||||
{/if}
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
<form method="post" action=".">
|
||||
{foreach $files as $file=>$def}
|
||||
<table class="diff" summary=" ">
|
||||
<tbody>
|
||||
<tr id="diff-{$file|md5}"><th colspan="4">{$file}</th></tr>
|
||||
<tr><th colspan="2">{trans 'Old'}</th><th colspan="2">{trans 'New'}</th></tr>
|
||||
{$def[0]}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{$def[0]}
|
||||
|
||||
{assign $fcomments = $def[2]}
|
||||
{assign $nc = $fcomments.count()}
|
||||
{assign $i = 1}
|
||||
@@ -109,7 +100,7 @@ to propose more contributions</strong>.
|
||||
{foreach $comments as $c}{ashowuser 'submitter', $c.get_submitter(), $request}{assign $submitter = $c.get_submitter()}{assign $submitter_data = $c.get_submitter_data()}
|
||||
<div class="issue-comment{if $i == 1} issue-comment-first{/if}{if $i == ($nc)} issue-comment-last{/if}" id="ic{$c.id}">
|
||||
{if $submitter_data.avatar != ''}
|
||||
<img style="float:right; position: relative; max-height: 60px; max-width: 60px;" src="{media}/upload/avatars/{$submitter_data.avatar}" alt=" " />
|
||||
<img style="float:right; position: relative; max-height: 60px; max-width: 60px;" src="{upload}/avatars/{$submitter_data.avatar}" alt=" " />
|
||||
{else}
|
||||
<img style="float:right; position: relative;" src="http://www.gravatar.com/avatar/{$submitter.email|md5}.jpg?s=60&d={media}/idf/img/spacer.gif" alt=" " />
|
||||
{/if}
|
||||
|
@@ -1,8 +1,6 @@
|
||||
{assign $class = ''}{assign $i = 0}
|
||||
<div id="tagscloud" class="smaller"><dl>{foreach $project.getTagCloud($cloud) as $label}
|
||||
<div id="tagscloud" class="smaller"><dl>{foreach $project.getTagCloud($cloud) as $class => $labels}
|
||||
<dt class="label">{$class}</dt>
|
||||
{foreach $labels as $idx => $label}
|
||||
{aurl 'url', $cloud_url, array($project.shortname, $label.id, 'open')}
|
||||
{if $class != $label.class}<dt class="label">{$label.class}</dt>{assign $i = 0}{/if}
|
||||
<dd><a href="{$url}" class="label">{$label.name},</a></dd>
|
||||
{assign $class = $label.class}
|
||||
{assign $i = $i + 1}
|
||||
{/foreach}</dl></p>
|
||||
<dd><a href="{$url}" class="label">{$label.name}{if $idx != count($labels) - 1},{/if}</a></dd>
|
||||
{/foreach}{/foreach}</dl></p>
|
||||
|
@@ -3,7 +3,7 @@
|
||||
<table class="form" summary="">
|
||||
<tr>
|
||||
<th style="text-align: right">{if $user_data.avatar != ''}
|
||||
<img style="max-height: 60px; max-width: 60px;" src="{media}/upload/avatars/{$user_data.avatar}" alt=" " />
|
||||
<img style="max-height: 60px; max-width: 60px;" src="{upload}/avatars/{$user_data.avatar}" alt=" " />
|
||||
{else}
|
||||
<img src="http://www.gravatar.com/avatar/{$member.email|md5}.jpg?s=60&d={media}/idf/img/spacer.gif" alt=" " />
|
||||
{/if}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
{block tabwiki} class="active"{/block}
|
||||
{block subtabs}
|
||||
<div id="sub-tabs">
|
||||
<a {if $inWiki}class="active" {/if}href="{url 'IDF_Views_Wiki::index', array($project.shortname)}">{trans 'List Pages'}</a>
|
||||
<a {if $inWiki}class="active" {/if}href="{url 'IDF_Views_Wiki::listing', array($project.shortname)}">{trans 'List Pages'}</a>
|
||||
{if !$user.isAnonymous()} | <a {if $inCreate}class="active" {/if}href="{url 'IDF_Views_Wiki::create', array($project.shortname)}">{trans 'New Page'}</a> {/if}
|
||||
{if !$user.isAnonymous() and $inView} | <a href="{url 'IDF_Views_Wiki::update', array($project.shortname, $page.title)}">{trans 'Update This Page'}</a> {/if}
|
||||
|
|
||||
|
38
src/IDF/templates/idf/wiki/history.html
Normal file
38
src/IDF/templates/idf/wiki/history.html
Normal file
@@ -0,0 +1,38 @@
|
||||
{extends "idf/wiki/base.html"}
|
||||
|
||||
{block extraheader}
|
||||
<meta name="ROBOTS" content="NOINDEX" />
|
||||
{/block}
|
||||
|
||||
{block docclass}yui-t3{assign $inView=true}{/block}
|
||||
|
||||
{block body}
|
||||
<table class="recent-issues">
|
||||
<tr><th>Id</th><th>Who</th><th>When</th><th>Summary</th><th>Actions</th></tr>
|
||||
{foreach $revs as $r}
|
||||
{ashowuser 'submitter', $rev.get_submitter(), $request}
|
||||
{aurl 'view_url', 'IDF_Views_Wiki::view', array($project.shortname, $page.title), array('rev' => $r->id)}
|
||||
{aurl 'delete_url', 'IDF_Views_Wiki::deleteRev', array($project.shortname, $r->id)}
|
||||
{aurl 'restore_url', 'IDF_Views_Wiki::restoreRev', array($project.shortname, $r->id)}
|
||||
<tr><td><a href="{$view_url}">{$r->id}</a></td><td>{$submitter}</td><td class="a-c">{$r->creation_dtime|dateago}</td><td>{$r->summary}</td><td>{if $r->is_head == false}<a href="{$view_url}">View</a> - <a href="{$delete_url}">Delete</a> - <a href="{$restore_url}">Restore</a>{/if}</td></tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
{aurl 'add_rev', 'IDF_Views_Wiki::update', array($project.shortname, $page.title)}
|
||||
<p><a href="{$add_rev}"><img style="vertical-align: text-bottom;" src="{media '/idf/img/add.png'}" alt="+" align="bottom"></a> <a href="{$add_rev}">{trans 'Update This Page'}</a></p>
|
||||
{/block}
|
||||
|
||||
|
||||
{block context}
|
||||
{ashowuser 'submitter', $page.get_submitter(), $request}
|
||||
<p><strong>{trans 'Created:'}</strong> <span class="nobrk">{$page.creation_dtime|dateago}</span><br /><span class="nobrk">{blocktrans}by {$submitter}{/blocktrans}</span></p>
|
||||
{if $rev.creation_dtime != $page.creation_dtime}<p>{ashowuser 'submitter', $rev.get_submitter(), $request}
|
||||
<strong>{trans 'Updated:'}</strong> <span class="nobrk">{$rev.creation_dtime|dateago}</span><br /><span class="nobrk">{blocktrans}by {$submitter}{/blocktrans}</span></p>{/if}
|
||||
{if $tags.count()}
|
||||
<p>
|
||||
<strong>{trans 'Labels:'}</strong><br />
|
||||
{foreach $tags as $tag}
|
||||
<span class="label"><strong>{$tag.class}:</strong>{$tag.name}</span><br />
|
||||
{/foreach}
|
||||
</p>{/if}
|
||||
<p class="helptext"><a href="{url 'IDF_Views_Wiki::view', array($project.shortname, $page.title)}">{trans 'See current revision'}</a></p>
|
||||
{/block}
|
@@ -1,5 +1,10 @@
|
||||
{extends "idf/wiki/base.html"}
|
||||
{block extraheader}{if $oldrev}<meta name="ROBOTS" content="NOINDEX" />{/if}{/block}
|
||||
|
||||
{block extraheader}
|
||||
{if $oldrev}<meta name="ROBOTS" content="NOINDEX" />{/if}
|
||||
<link rel="stylesheet" type="text/css" media="print" href="{media '/idf/css/print-wiki.css'}" />
|
||||
{/block}
|
||||
|
||||
{block docclass}yui-t3{assign $inView=true}{/block}
|
||||
|
||||
{block body}
|
||||
@@ -47,9 +52,6 @@ by {$submitter}.{/blocktrans}</p>
|
||||
{/foreach}
|
||||
</p>{/if}
|
||||
{if $revs.count() > 0}
|
||||
<p><strong>{trans 'Old Revisions'}</strong></p>
|
||||
<ul>{foreach $revs as $old}
|
||||
<li><a href="{url 'IDF_Views_Wiki::view', array($project.shortname, $page.title), array('rev'=>$old.id)}">{$old.summary}</a></li>
|
||||
{/foreach}</ul>
|
||||
<p class="helptext"><a href="{url 'IDF_Views_Wiki::history', array($project.shortname, $page.title)}">{trans 'See older revision'}</a></p>
|
||||
{/if}
|
||||
{/block}
|
||||
|
17
src/IDF/templates/idf/wiki/wiki-default-page.mdtext
Normal file
17
src/IDF/templates/idf/wiki/wiki-default-page.mdtext
Normal file
@@ -0,0 +1,17 @@
|
||||
{aurl 'syntax_url', 'IDF_Views_Wiki::view', array($project.shortname, 'IndeferoMarkdownHelp')}
|
||||
{aurl 'wiki_add', 'IDF_Views_Wiki::create', array($project.shortname)}
|
||||
{aurl 'wiki_update', 'IDF_Views_Wiki::update', array($project.shortname, 'IndeferoSummaryDefault')}
|
||||
{aurl 'wiki_history', 'IDF_Views_Wiki::history', array($project.shortname, 'IndeferoSummaryDefault')}
|
||||
{aurl 'wiki_admin', 'IDF_Views_Project::adminWiki', array($project.shortname)}
|
||||
{blocktrans}
|
||||
Welcome on the documentation section of the project {$project->name}.
|
||||
All documentation page use the markdown syntax, you can find help about this syntax on this [page]({$syntax_url}).
|
||||
|
||||
- You can another Wiki page [here]({$wiki_add}).
|
||||
- You can update this page [here]({$wiki_update}).
|
||||
- You can select an other default wiki page [here]({$wiki_admin}). You need to be admin.
|
||||
|
||||
|
||||
All modification on a wiki page are saved, and you can see this history for each pages.
|
||||
The history of the current page can be see [here]({$wiki_history}).
|
||||
{/blocktrans}
|
569
src/IDF/templates/idf/wiki/wiki-markdown-help.mdtext
Normal file
569
src/IDF/templates/idf/wiki/wiki-markdown-help.mdtext
Normal file
@@ -0,0 +1,569 @@
|
||||
Block Elements
|
||||
==============
|
||||
|
||||
|
||||
Paragraphs and Line Breaks
|
||||
--------------------------
|
||||
|
||||
A paragraph is simply one or more consecutive lines of text, separated
|
||||
by one or more blank lines. (A blank line is any line that looks like a
|
||||
blank line -- a line containing nothing but spaces or tabs is considered
|
||||
blank.) Normal paragraphs should not be indented with spaces or tabs.
|
||||
|
||||
The implication of the "one or more consecutive lines of text" rule is
|
||||
that Markdown supports "hard-wrapped" text paragraphs. This differs
|
||||
significantly from most other text-to-HTML formatters (including Movable
|
||||
Type's "Convert Line Breaks" option) which translate every line break
|
||||
character in a paragraph into a `<br />` tag.
|
||||
|
||||
When you *do* want to insert a `<br />` break tag using Markdown, you
|
||||
end a line with two or more spaces, then type return.
|
||||
|
||||
|
||||
|
||||
|
||||
Headers
|
||||
-------
|
||||
|
||||
Markdown supports two styles of headers, [Setext] [1] and [atx] [2].
|
||||
|
||||
Setext-style headers are "underlined" using equal signs (for first-level
|
||||
headers) and dashes (for second-level headers). For example:
|
||||
|
||||
This is an H1
|
||||
=============
|
||||
|
||||
This is an H2
|
||||
-------------
|
||||
|
||||
Any number of underlining `=`'s or `-`'s will work.
|
||||
|
||||
Atx-style headers use 1-6 hash characters at the start of the line,
|
||||
corresponding to header levels 1-6. For example:
|
||||
|
||||
# This is an H1
|
||||
|
||||
## This is an H2
|
||||
|
||||
###### This is an H6
|
||||
|
||||
Optionally, you may "close" atx-style headers. This is purely
|
||||
cosmetic -- you can use this if you think it looks better. The
|
||||
closing hashes don't even need to match the number of hashes
|
||||
used to open the header. (The number of opening hashes
|
||||
determines the header level.) :
|
||||
|
||||
# This is an H1 #
|
||||
|
||||
## This is an H2 ##
|
||||
|
||||
### This is an H3 ######
|
||||
|
||||
|
||||
|
||||
|
||||
Blockquotes
|
||||
-----------
|
||||
|
||||
Markdown uses email-style `>` characters for blockquoting. If you're
|
||||
familiar with quoting passages of text in an email message, then you
|
||||
know how to create a blockquote in Markdown. It looks best if you hard
|
||||
wrap the text and put a `>` before every line:
|
||||
|
||||
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
|
||||
> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
|
||||
> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
|
||||
>
|
||||
> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
|
||||
> id sem consectetuer libero luctus adipiscing.
|
||||
|
||||
Markdown allows you to be lazy and only put the `>` before the first
|
||||
line of a hard-wrapped paragraph:
|
||||
|
||||
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
|
||||
consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
|
||||
Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
|
||||
|
||||
> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
|
||||
id sem consectetuer libero luctus adipiscing.
|
||||
|
||||
Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by
|
||||
adding additional levels of `>`:
|
||||
|
||||
> This is the first level of quoting.
|
||||
>
|
||||
> > This is nested blockquote.
|
||||
>
|
||||
> Back to the first level.
|
||||
|
||||
Blockquotes can contain other Markdown elements, including headers, lists,
|
||||
and code blocks:
|
||||
|
||||
> ## This is a header.
|
||||
>
|
||||
> 1. This is the first list item.
|
||||
> 2. This is the second list item.
|
||||
>
|
||||
> Here's some example code:
|
||||
>
|
||||
> return shell_exec("echo $input | $markdown_script");
|
||||
|
||||
Any decent text editor should make email-style quoting easy. For
|
||||
example, with BBEdit, you can make a selection and choose Increase
|
||||
Quote Level from the Text menu.
|
||||
|
||||
|
||||
|
||||
|
||||
Lists
|
||||
-----
|
||||
|
||||
Markdown supports ordered (numbered) and unordered (bulleted) lists.
|
||||
|
||||
Unordered lists use asterisks, pluses, and hyphens -- interchangably
|
||||
-- as list markers:
|
||||
|
||||
* Red
|
||||
* Green
|
||||
* Blue
|
||||
|
||||
is equivalent to:
|
||||
|
||||
+ Red
|
||||
+ Green
|
||||
+ Blue
|
||||
|
||||
and:
|
||||
|
||||
- Red
|
||||
- Green
|
||||
- Blue
|
||||
|
||||
Ordered lists use numbers followed by periods:
|
||||
|
||||
1. Bird
|
||||
2. McHale
|
||||
3. Parish
|
||||
|
||||
It's important to note that the actual numbers you use to mark the
|
||||
list have no effect on the HTML output Markdown produces. The HTML
|
||||
Markdown produces from the above list is:
|
||||
|
||||
<ol>
|
||||
<li>Bird</li>
|
||||
<li>McHale</li>
|
||||
<li>Parish</li>
|
||||
</ol>
|
||||
|
||||
If you instead wrote the list in Markdown like this:
|
||||
|
||||
1. Bird
|
||||
1. McHale
|
||||
1. Parish
|
||||
|
||||
or even:
|
||||
|
||||
3. Bird
|
||||
1. McHale
|
||||
8. Parish
|
||||
|
||||
you'd get the exact same HTML output. The point is, if you want to,
|
||||
you can use ordinal numbers in your ordered Markdown lists, so that
|
||||
the numbers in your source match the numbers in your published HTML.
|
||||
But if you want to be lazy, you don't have to.
|
||||
|
||||
If you do use lazy list numbering, however, you should still start the
|
||||
list with the number 1. At some point in the future, Markdown may support
|
||||
starting ordered lists at an arbitrary number.
|
||||
|
||||
List markers typically start at the left margin, but may be indented by
|
||||
up to three spaces. List markers must be followed by one or more spaces
|
||||
or a tab.
|
||||
|
||||
To make lists look nice, you can wrap items with hanging indents:
|
||||
|
||||
* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
|
||||
Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
|
||||
viverra nec, fringilla in, laoreet vitae, risus.
|
||||
* Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
|
||||
Suspendisse id sem consectetuer libero luctus adipiscing.
|
||||
|
||||
But if you want to be lazy, you don't have to:
|
||||
|
||||
* Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
|
||||
Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
|
||||
viverra nec, fringilla in, laoreet vitae, risus.
|
||||
* Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
|
||||
Suspendisse id sem consectetuer libero luctus adipiscing.
|
||||
|
||||
If list items are separated by blank lines, Markdown will wrap the
|
||||
items in `<p>` tags in the HTML output. For example, this input:
|
||||
|
||||
* Bird
|
||||
* Magic
|
||||
|
||||
will turn into:
|
||||
|
||||
<ul>
|
||||
<li>Bird</li>
|
||||
<li>Magic</li>
|
||||
</ul>
|
||||
|
||||
But this:
|
||||
|
||||
* Bird
|
||||
|
||||
* Magic
|
||||
|
||||
will turn into:
|
||||
|
||||
<ul>
|
||||
<li><p>Bird</p></li>
|
||||
<li><p>Magic</p></li>
|
||||
</ul>
|
||||
|
||||
List items may consist of multiple paragraphs. Each subsequent
|
||||
paragraph in a list item must be indented by either 4 spaces
|
||||
or one tab:
|
||||
|
||||
1. This is a list item with two paragraphs. Lorem ipsum dolor
|
||||
sit amet, consectetuer adipiscing elit. Aliquam hendrerit
|
||||
mi posuere lectus.
|
||||
|
||||
Vestibulum enim wisi, viverra nec, fringilla in, laoreet
|
||||
vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
|
||||
sit amet velit.
|
||||
|
||||
2. Suspendisse id sem consectetuer libero luctus adipiscing.
|
||||
|
||||
It looks nice if you indent every line of the subsequent
|
||||
paragraphs, but here again, Markdown will allow you to be
|
||||
lazy:
|
||||
|
||||
* This is a list item with two paragraphs.
|
||||
|
||||
This is the second paragraph in the list item. You're
|
||||
only required to indent the first line. Lorem ipsum dolor
|
||||
sit amet, consectetuer adipiscing elit.
|
||||
|
||||
* Another item in the same list.
|
||||
|
||||
To put a blockquote within a list item, the blockquote's `>`
|
||||
delimiters need to be indented:
|
||||
|
||||
* A list item with a blockquote:
|
||||
|
||||
> This is a blockquote
|
||||
> inside a list item.
|
||||
|
||||
To put a code block within a list item, the code block needs
|
||||
to be indented *twice* -- 8 spaces or two tabs:
|
||||
|
||||
* A list item with a code block:
|
||||
|
||||
<code goes here>
|
||||
|
||||
|
||||
It's worth noting that it's possible to trigger an ordered list by
|
||||
accident, by writing something like this:
|
||||
|
||||
1986. What a great season.
|
||||
|
||||
In other words, a *number-period-space* sequence at the beginning of a
|
||||
line. To avoid this, you can backslash-escape the period:
|
||||
|
||||
1986\. What a great season.
|
||||
|
||||
|
||||
|
||||
|
||||
Code Blocks
|
||||
-----------
|
||||
|
||||
Pre-formatted code blocks are used for writing about programming or
|
||||
markup source code. Rather than forming normal paragraphs, the lines
|
||||
of a code block are interpreted literally. Markdown wraps a code block
|
||||
in both `<pre>` and `<code>` tags.
|
||||
|
||||
To produce a code block in Markdown, simply indent every line of the
|
||||
block by at least 4 spaces or 1 tab. For example, given this input:
|
||||
|
||||
This is a normal paragraph:
|
||||
|
||||
This is a code block.
|
||||
|
||||
Markdown will generate:
|
||||
|
||||
<p>This is a normal paragraph:</p>
|
||||
|
||||
<pre><code>This is a code block.
|
||||
</code></pre>
|
||||
|
||||
One level of indentation -- 4 spaces or 1 tab -- is removed from each
|
||||
line of the code block. For example, this:
|
||||
|
||||
Here is an example of AppleScript:
|
||||
|
||||
tell application "Foo"
|
||||
beep
|
||||
end tell
|
||||
|
||||
will turn into:
|
||||
|
||||
<p>Here is an example of AppleScript:</p>
|
||||
|
||||
<pre><code>tell application "Foo"
|
||||
beep
|
||||
end tell
|
||||
</code></pre>
|
||||
|
||||
A code block continues until it reaches a line that is not indented
|
||||
(or the end of the article).
|
||||
|
||||
Within a code block, ampersands (`&`) and angle brackets (`<` and `>`)
|
||||
are automatically converted into HTML entities. This makes it very
|
||||
easy to include example HTML source code using Markdown -- just paste
|
||||
it and indent it, and Markdown will handle the hassle of encoding the
|
||||
ampersands and angle brackets. For example, this:
|
||||
|
||||
<div class="footer">
|
||||
© 2004 Foo Corporation
|
||||
</div>
|
||||
|
||||
will turn into:
|
||||
|
||||
<pre><code><div class="footer">
|
||||
&copy; 2004 Foo Corporation
|
||||
</div>
|
||||
</code></pre>
|
||||
|
||||
Regular Markdown syntax is not processed within code blocks. E.g.,
|
||||
asterisks are just literal asterisks within a code block. This means
|
||||
it's also easy to use Markdown to write about Markdown's own syntax.
|
||||
|
||||
|
||||
|
||||
|
||||
Span Elements
|
||||
=============
|
||||
|
||||
|
||||
Links
|
||||
-----
|
||||
|
||||
Markdown supports two style of links: *inline* and *reference*.
|
||||
|
||||
In both styles, the link text is delimited by [square brackets].
|
||||
|
||||
To create an inline link, use a set of regular parentheses immediately
|
||||
after the link text's closing square bracket. Inside the parentheses,
|
||||
put the URL where you want the link to point, along with an *optional*
|
||||
title for the link, surrounded in quotes. For example:
|
||||
|
||||
This is [an example](http://example.com/ "Title") inline link.
|
||||
|
||||
[This link](http://example.net/) has no title attribute.
|
||||
|
||||
Will produce:
|
||||
|
||||
<p>This is <a href="http://example.com/" title="Title">
|
||||
an example</a> inline link.</p>
|
||||
|
||||
<p><a href="http://example.net/">This link</a> has no
|
||||
title attribute.</p>
|
||||
|
||||
If you're referring to a local resource on the same server, you can
|
||||
use relative paths:
|
||||
|
||||
See my [About](/about/) page for details.
|
||||
|
||||
Reference-style links use a second set of square brackets, inside
|
||||
which you place a label of your choosing to identify the link:
|
||||
|
||||
This is [an example][id] reference-style link.
|
||||
|
||||
You can optionally use a space to separate the sets of brackets:
|
||||
|
||||
This is [an example] [id] reference-style link.
|
||||
|
||||
Then, anywhere in the document, you define your link label like this,
|
||||
on a line by itself:
|
||||
|
||||
[id]: http://example.com/ "Optional Title Here"
|
||||
|
||||
That is:
|
||||
|
||||
* Square brackets containing the link identifier (optionally
|
||||
indented from the left margin using up to three spaces);
|
||||
* followed by a colon;
|
||||
* followed by one or more spaces (or tabs);
|
||||
* followed by the URL for the link;
|
||||
* optionally followed by a title attribute for the link, enclosed
|
||||
in double or single quotes, or enclosed in parentheses.
|
||||
|
||||
The following three link definitions are equivalent:
|
||||
|
||||
[foo]: http://example.com/ "Optional Title Here"
|
||||
[foo]: http://example.com/ 'Optional Title Here'
|
||||
[foo]: http://example.com/ (Optional Title Here)
|
||||
|
||||
**Note:** There is a known bug in Markdown.pl 1.0.1 which prevents
|
||||
single quotes from being used to delimit link titles.
|
||||
|
||||
The link URL may, optionally, be surrounded by angle brackets:
|
||||
|
||||
[id]: <http://example.com/> "Optional Title Here"
|
||||
|
||||
You can put the title attribute on the next line and use extra spaces
|
||||
or tabs for padding, which tends to look better with longer URLs:
|
||||
|
||||
[id]: http://example.com/longish/path/to/resource/here
|
||||
"Optional Title Here"
|
||||
|
||||
Link definitions are only used for creating links during Markdown
|
||||
processing, and are stripped from your document in the HTML output.
|
||||
|
||||
Link definition names may consist of letters, numbers, spaces, and
|
||||
punctuation -- but they are *not* case sensitive. E.g. these two
|
||||
links:
|
||||
|
||||
[link text][a]
|
||||
[link text][A]
|
||||
|
||||
are equivalent.
|
||||
|
||||
The *implicit link name* shortcut allows you to omit the name of the
|
||||
link, in which case the link text itself is used as the name.
|
||||
Just use an empty set of square brackets -- e.g., to link the word
|
||||
"Google" to the google.com web site, you could simply write:
|
||||
|
||||
[Google][]
|
||||
|
||||
And then define the link:
|
||||
|
||||
[Google]: http://google.com/
|
||||
|
||||
Because link names may contain spaces, this shortcut even works for
|
||||
multiple words in the link text:
|
||||
|
||||
Visit [Daring Fireball][] for more information.
|
||||
|
||||
And then define the link:
|
||||
|
||||
[Daring Fireball]: http://daringfireball.net/
|
||||
|
||||
Link definitions can be placed anywhere in your Markdown document. I
|
||||
tend to put them immediately after each paragraph in which they're
|
||||
used, but if you want, you can put them all at the end of your
|
||||
document, sort of like footnotes.
|
||||
|
||||
Here's an example of reference links in action:
|
||||
|
||||
I get 10 times more traffic from [Google] [1] than from
|
||||
[Yahoo] [2] or [MSN] [3].
|
||||
|
||||
[1]: http://google.com/ "Google"
|
||||
[2]: http://search.yahoo.com/ "Yahoo Search"
|
||||
|
||||
|
||||
|
||||
Emphasis
|
||||
--------
|
||||
|
||||
Markdown treats asterisks (`*`) and underscores (`_`) as indicators of
|
||||
emphasis. Text wrapped with one `*` or `_` will be wrapped with an
|
||||
HTML `<em>` tag; double `*`'s or `_`'s will be wrapped with an HTML
|
||||
`<strong>` tag. E.g., this input:
|
||||
|
||||
*single asterisks*
|
||||
|
||||
_single underscores_
|
||||
|
||||
**double asterisks**
|
||||
|
||||
__double underscores__
|
||||
|
||||
will produce:
|
||||
|
||||
<em>single asterisks</em>
|
||||
|
||||
<em>single underscores</em>
|
||||
|
||||
<strong>double asterisks</strong>
|
||||
|
||||
<strong>double underscores</strong>
|
||||
|
||||
You can use whichever style you prefer; the lone restriction is that
|
||||
the same character must be used to open and close an emphasis span.
|
||||
|
||||
Emphasis can be used in the middle of a word:
|
||||
|
||||
un*frigging*believable
|
||||
|
||||
But if you surround an `*` or `_` with spaces, it'll be treated as a
|
||||
literal asterisk or underscore.
|
||||
|
||||
To produce a literal asterisk or underscore at a position where it
|
||||
would otherwise be used as an emphasis delimiter, you can backslash
|
||||
escape it:
|
||||
|
||||
\*this text is surrounded by literal asterisks\*
|
||||
|
||||
|
||||
|
||||
|
||||
Code
|
||||
----
|
||||
|
||||
To indicate a span of code, wrap it with backtick quotes (`` ` ``).
|
||||
Unlike a pre-formatted code block, a code span indicates code within a
|
||||
normal paragraph. For example:
|
||||
|
||||
Use the `printf()` function.
|
||||
|
||||
will produce:
|
||||
|
||||
<p>Use the <code>printf()</code> function.</p>
|
||||
|
||||
To include a literal backtick character within a code span, you can use
|
||||
multiple backticks as the opening and closing delimiters:
|
||||
|
||||
``There is a literal backtick (`) here.``
|
||||
|
||||
which will produce this:
|
||||
|
||||
<p><code>There is a literal backtick (`) here.</code></p>
|
||||
|
||||
The backtick delimiters surrounding a code span may include spaces --
|
||||
one after the opening, one before the closing. This allows you to place
|
||||
literal backtick characters at the beginning or end of a code span:
|
||||
|
||||
A single backtick in a code span: `` ` ``
|
||||
|
||||
A backtick-delimited string in a code span: `` `foo` ``
|
||||
|
||||
will produce:
|
||||
|
||||
<p>A single backtick in a code span: <code>`</code></p>
|
||||
|
||||
<p>A backtick-delimited string in a code span: <code>`foo`</code></p>
|
||||
|
||||
With a code span, ampersands and angle brackets are encoded as HTML
|
||||
entities automatically, which makes it easy to include example HTML
|
||||
tags. Markdown will turn this:
|
||||
|
||||
Please don't use any `<blink>` tags.
|
||||
|
||||
into:
|
||||
|
||||
<p>Please don't use any <code><blink></code> tags.</p>
|
||||
|
||||
You can write this:
|
||||
|
||||
`—` is the decimal-encoded equivalent of `—`.
|
||||
|
||||
to produce:
|
||||
|
||||
<p><code>&#8212;</code> is the decimal-encoded
|
||||
equivalent of <code>&mdash;</code>.</p>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
return array(
|
||||
'version' => '1.2-dev',
|
||||
'version' => '1.3-dev',
|
||||
'revision' => '$Format:%H$',
|
||||
);
|
||||
|
@@ -38,11 +38,9 @@ class IDF_DiffTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
$expectedfile = str_replace('.diff', '.expected', $difffile);
|
||||
$expectedcontent = @file_get_contents($expectedfile);
|
||||
|
||||
$diffcontent = file_get_contents($difffile);
|
||||
$diff = new IDF_Diff($diffcontent, $diffprefix);
|
||||
$this->assertEquals(unserialize($expectedcontent),
|
||||
$this->assertEquals(require_once($expectedfile),
|
||||
$diff->parse(),
|
||||
'parsed diff '.$difffile.' does not match');
|
||||
}
|
||||
|
@@ -625,6 +625,7 @@ END;
|
||||
'additions' => array('new_dir', 'new_dir/new_file'),
|
||||
'deletions' => array('old_dir', 'old_dir/old_file'),
|
||||
'renames' => array('dir_with_old_name' => 'new_dir/dir_with_new_name'),
|
||||
'copies' => array(), // this is always empty
|
||||
'patches' => array('existing_file'),
|
||||
'properties' => array(
|
||||
'new_dir/dir_with_new_name' => array(
|
||||
|
55
test/IDF/Scm/SvnTest.php
Normal file
55
test/IDF/Scm/SvnTest.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/*
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# This file is part of InDefero, an open source project management application.
|
||||
# Copyright (C) 2011 Céondo Ltd and contributors.
|
||||
#
|
||||
# InDefero is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# InDefero is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
# ***** END LICENSE BLOCK ***** */
|
||||
|
||||
class IDF_Scm_SvnTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
private $proj = null;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->proj = new IDF_Project();
|
||||
$this->proj->id = 1;
|
||||
$this->proj->name = $this->proj->shortname = 'test';
|
||||
$this->proj->create();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
$this->proj->delete();
|
||||
}
|
||||
|
||||
public function createMock($reponame)
|
||||
{
|
||||
$repourl = 'file://'.DATADIR.'/'.__CLASS__.'/'.$reponame;
|
||||
$instance = new IDF_Scm_Svn($repourl, $this->proj);
|
||||
return $instance;
|
||||
}
|
||||
|
||||
public function testAccessHistoryOfRenamedAndDeletedFiles()
|
||||
{
|
||||
$instance = $this->createMock(__FUNCTION__);
|
||||
$this->assertEquals('new-file', $instance->getPathInfo('new-file', 1)->fullpath);
|
||||
$this->assertEquals('alternate-name', $instance->getPathInfo('alternate-name', 2)->fullpath);
|
||||
}
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ if (file_exists($testconfig['db_database'])) {
|
||||
}
|
||||
|
||||
echo ">>> creating empty test database...\n";
|
||||
passthru('php ' . PLUF_PATH . '/migrate.php --conf=' . TESTDIR . '/config.php -a -i');
|
||||
passthru('php ' . escapeshellarg(PLUF_PATH.'/migrate.php') . ' --conf=' . escapeshellarg(TESTDIR.'/config.php').' -a -i');
|
||||
|
||||
echo ">>> setting up web application...\n";
|
||||
require 'Pluf.php';
|
||||
|
File diff suppressed because one or more lines are too long
@@ -15,375 +15,10 @@ Index: LinuxBIOSv1/src/include/cpu/i786/cpufixup.h
|
||||
+
|
||||
+
|
||||
|
||||
Eigenschafts<EFBFBD>nderungen: LinuxBIOSv1\src\include\cpu\i786\cpufixup.h
|
||||
Eigenschafts<EFBFBD>nderungen: LinuxBIOSv1\src\include\cpu\i786\cpufixup.h
|
||||
___________________________________________________________________
|
||||
Hinzugef<EFBFBD>gt: svn:keywords
|
||||
Hinzugef<EFBFBD>gt: svn:keywords
|
||||
+ Author Date Id Revision
|
||||
Hinzugef<EFBFBD>gt: svn:eol-style
|
||||
+ native
|
||||
|
||||
Index: LinuxBIOSv1/src/mainboard/tyan/guiness/cmos.layout
|
||||
===================================================================
|
||||
--- LinuxBIOSv1/src/mainboard/tyan/guiness/cmos.layout (Revision 0)
|
||||
+++ LinuxBIOSv1/src/mainboard/tyan/guiness/cmos.layout (Revision 665)
|
||||
@@ -0,0 +1,63 @@
|
||||
+entries
|
||||
+
|
||||
+#start-bit length config config-ID name
|
||||
+#0 8 r 0 seconds
|
||||
+#8 8 r 0 alarm_seconds
|
||||
+#16 8 r 0 minutes
|
||||
+#24 8 r 0 alarm_minutes
|
||||
+#32 8 r 0 hours
|
||||
+#40 8 r 0 alarm_hours
|
||||
+#48 8 r 0 day_of_week
|
||||
+#56 8 r 0 day_of_month
|
||||
+#64 8 r 0 month
|
||||
+#72 8 r 0 year
|
||||
+#80 4 r 0 rate_select
|
||||
+#84 3 r 0 REF_Clock
|
||||
+#87 1 r 0 UIP
|
||||
+#88 1 r 0 auto_switch_DST
|
||||
+#89 1 r 0 24_hour_mode
|
||||
+#90 1 r 0 binary_values_enable
|
||||
+#91 1 r 0 square-wave_out_enable
|
||||
+#92 1 r 0 update_finished_enable
|
||||
+#93 1 r 0 alarm_interrupt_enable
|
||||
+#94 1 r 0 periodic_interrupt_enable
|
||||
+#95 1 r 0 disable_clock_updates
|
||||
+#96 288 r 0 temporary_filler
|
||||
+0 384 r 0 reserved_memory
|
||||
+384 1 e 4 boot_option
|
||||
+385 1 e 4 last_boot
|
||||
+386 3 e 5 baud_rate
|
||||
+392 4 e 6 debug_level
|
||||
+396 1 e 1 power_on_after_fail
|
||||
+#401 1 e 1 ECC_memory
|
||||
+#402 1 e 2 hda_disk
|
||||
+#403 1 e 2 hdb_disk
|
||||
+#404 1 e 2 hdc_disk
|
||||
+#405 1 e 2 hdd_disk
|
||||
+#406 2 e 7 boot_device
|
||||
+
|
||||
+enumerations
|
||||
+
|
||||
+#ID value text
|
||||
+1 0 Disable
|
||||
+1 1 Enable
|
||||
+#2 0 No
|
||||
+#2 1 Yes
|
||||
+4 0 Fallback
|
||||
+4 1 Normal
|
||||
+5 0 115200
|
||||
+5 1 57600
|
||||
+5 2 38400
|
||||
+5 3 19200
|
||||
+5 4 9600
|
||||
+5 5 4800
|
||||
+5 6 2400
|
||||
+5 7 1200
|
||||
+6 6 Notice
|
||||
+6 7 Info
|
||||
+6 8 Debug
|
||||
+6 9 Spew
|
||||
+#7 0 Network
|
||||
+#7 1 HDD
|
||||
+#7 2 Floppy
|
||||
+#7 3 ROM
|
||||
|
||||
Eigenschafts<EFBFBD>nderungen: LinuxBIOSv1\src\mainboard\tyan\guiness\cmos.layout
|
||||
___________________________________________________________________
|
||||
Hinzugef<EFBFBD>gt: svn:keywords
|
||||
+ Author Date Id Revision
|
||||
Hinzugef<EFBFBD>gt: svn:eol-style
|
||||
+ native
|
||||
|
||||
Index: LinuxBIOSv1/src/config/linuxbios_c.ld
|
||||
===================================================================
|
||||
--- LinuxBIOSv1/src/config/linuxbios_c.ld (Revision 0)
|
||||
+++ LinuxBIOSv1/src/config/linuxbios_c.ld (Revision 665)
|
||||
@@ -0,0 +1,105 @@
|
||||
+/*
|
||||
+ * Memory map:
|
||||
+ *
|
||||
+ * _RAMBASE
|
||||
+ * : data segment
|
||||
+ * : bss segment
|
||||
+ * : heap
|
||||
+ * : stack
|
||||
+ */
|
||||
+/*
|
||||
+ * Bootstrap code for the STPC Consumer
|
||||
+ * Copyright (c) 1999 by Net Insight AB. All Rights Reserved.
|
||||
+ *
|
||||
+ * $Id$
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+/*
|
||||
+ * Written by Johan Rydberg, based on work by Daniel Kahlin.
|
||||
+ * Rewritten by Eric Biederman
|
||||
+ */
|
||||
+/*
|
||||
+ * We use ELF as output format. So that we can
|
||||
+ * debug the code in some form.
|
||||
+ */
|
||||
+INCLUDE ldoptions
|
||||
+
|
||||
+ENTRY(_start)
|
||||
+
|
||||
+SECTIONS
|
||||
+{
|
||||
+ . = _RAMBASE;
|
||||
+ /*
|
||||
+ * First we place the code and read only data (typically const declared).
|
||||
+ * This get placed in rom.
|
||||
+ */
|
||||
+ .text : {
|
||||
+ _text = .;
|
||||
+ *(.text);
|
||||
+ *(.text.*);
|
||||
+ . = ALIGN(16);
|
||||
+ _etext = .;
|
||||
+ }
|
||||
+ .rodata : {
|
||||
+ _rodata = .;
|
||||
+ . = ALIGN(4);
|
||||
+ streams = . ;
|
||||
+ *(.rodata.streams)
|
||||
+ estreams = .;
|
||||
+ . = ALIGN(4);
|
||||
+ pci_drivers = . ;
|
||||
+ *(.rodata.pci_drivers)
|
||||
+ epci_drivers = . ;
|
||||
+ *(.rodata)
|
||||
+ *(.rodata.*)
|
||||
+ _erodata = .;
|
||||
+ }
|
||||
+ /*
|
||||
+ * After the code we place initialized data (typically initialized
|
||||
+ * global variables). This gets copied into ram by startup code.
|
||||
+ * __data_start and __data_end shows where in ram this should be placed,
|
||||
+ * whereas __data_loadstart and __data_loadend shows where in rom to
|
||||
+ * copy from.
|
||||
+ */
|
||||
+ .data : {
|
||||
+ _data = .;
|
||||
+ *(.data)
|
||||
+ _edata = .;
|
||||
+ }
|
||||
+ /*
|
||||
+ * bss does not contain data, it is just a space that should be zero
|
||||
+ * initialized on startup. (typically uninitialized global variables)
|
||||
+ * crt0.S fills between _bss and _ebss with zeroes.
|
||||
+ */
|
||||
+ _bss = .;
|
||||
+ .bss . : {
|
||||
+ *(.bss)
|
||||
+ *(.sbss)
|
||||
+ *(COMMON)
|
||||
+ }
|
||||
+ _ebss = .;
|
||||
+ _end = .;
|
||||
+ _stack = .;
|
||||
+ .stack . : {
|
||||
+ /* Reserve a stack for each possible cpu, +1 extra */
|
||||
+ . = ((MAX_CPUS * STACK_SIZE) + STACK_SIZE) ;
|
||||
+ }
|
||||
+ _estack = .;
|
||||
+ _heap = .;
|
||||
+ .heap . : {
|
||||
+ /* Reserve 256K for the heap */
|
||||
+ . = HEAP_SIZE ;
|
||||
+ . = ALIGN(4);
|
||||
+ }
|
||||
+ _eheap = .;
|
||||
+ /* The ram segment
|
||||
+ * This is all address of the memory resident copy of linuxBIOS.
|
||||
+ */
|
||||
+ _ram_seg = _text;
|
||||
+ _eram_seg = _eheap;
|
||||
+ /DISCARD/ : {
|
||||
+ *(.comment)
|
||||
+ *(.note)
|
||||
+ }
|
||||
+}
|
||||
|
||||
Eigenschafts<EFBFBD>nderungen: LinuxBIOSv1\src\config\linuxbios_c.ld
|
||||
___________________________________________________________________
|
||||
Hinzugef<EFBFBD>gt: svn:keywords
|
||||
+ Author Date Id Revision
|
||||
Hinzugef<EFBFBD>gt: svn:eol-style
|
||||
+ native
|
||||
|
||||
Index: LinuxBIOSv1/src/arch/i386/include/arch/rom_segs.h
|
||||
===================================================================
|
||||
--- LinuxBIOSv1/src/arch/i386/include/arch/rom_segs.h (Revision 0)
|
||||
+++ LinuxBIOSv1/src/arch/i386/include/arch/rom_segs.h (Revision 665)
|
||||
@@ -0,0 +1,10 @@
|
||||
+#ifndef ROM_SEGS_H
|
||||
+#define ROM_SEGS_H
|
||||
+
|
||||
+#define ROM_CODE_SEG 0x08
|
||||
+#define ROM_DATA_SEG 0x10
|
||||
+
|
||||
+#define CACHE_RAM_CODE_SEG 0x18
|
||||
+#define CACHE_RAM_DATA_SEG 0x20
|
||||
+
|
||||
+#endif /* ROM_SEGS_H */
|
||||
|
||||
Eigenschafts<EFBFBD>nderungen: LinuxBIOSv1\src\arch\i386\include\arch\rom_segs.h
|
||||
___________________________________________________________________
|
||||
Hinzugef<EFBFBD>gt: svn:keywords
|
||||
+ Author Date Id Revision
|
||||
Hinzugef<EFBFBD>gt: svn:eol-style
|
||||
+ native
|
||||
|
||||
Index: LinuxBIOSv1/src/arch/i386/lib/c_start.S
|
||||
===================================================================
|
||||
--- LinuxBIOSv1/src/arch/i386/lib/c_start.S (Revision 0)
|
||||
+++ LinuxBIOSv1/src/arch/i386/lib/c_start.S (Revision 665)
|
||||
@@ -0,0 +1,135 @@
|
||||
+#include <arch/asm.h>
|
||||
+#include <arch/intel.h>
|
||||
+#ifdef SMP
|
||||
+#include <cpu/p6/apic.h>
|
||||
+#endif
|
||||
+ .section ".text"
|
||||
+ .code32
|
||||
+ .globl _start
|
||||
+_start:
|
||||
+ cli
|
||||
+ lgdt %cs:gdtaddr
|
||||
+ ljmp $0x10, $1f
|
||||
+1: movl $0x18, %ax
|
||||
+ movl %eax, %ds
|
||||
+ movl %eax, %es
|
||||
+ movl %eax, %ss
|
||||
+ movl %eax, %fs
|
||||
+ movl %eax, %gs
|
||||
+
|
||||
+ intel_chip_post_macro(0x13) /* post 12 */
|
||||
+
|
||||
+ /** clear stack */
|
||||
+ leal EXT(_stack), %edi
|
||||
+ movl $EXT(_estack), %ecx
|
||||
+ subl %edi, %ecx
|
||||
+ xorl %eax, %eax
|
||||
+ rep
|
||||
+ stosb
|
||||
+
|
||||
+ /** clear bss */
|
||||
+ leal EXT(_bss), %edi
|
||||
+ movl $EXT(_ebss), %ecx
|
||||
+ subl %edi, %ecx
|
||||
+ jz .Lnobss
|
||||
+ xorl %eax, %eax
|
||||
+ rep
|
||||
+ stosb
|
||||
+.Lnobss:
|
||||
+
|
||||
+ /* set new stack */
|
||||
+ movl $_estack, %esp
|
||||
+#ifdef SMP
|
||||
+ /* Get the cpu id */
|
||||
+ movl $APIC_DEFAULT_BASE, %edi
|
||||
+ movl APIC_ID(%edi), %eax
|
||||
+ shrl $24, %eax
|
||||
+
|
||||
+ /* Get the cpu index (MAX_CPUS on error) */
|
||||
+ movl $-4, %ebx
|
||||
+1: addl $4, %ebx
|
||||
+ cmpl $(MAX_CPUS << 2), %ebx
|
||||
+ je 2
|
||||
+ cmpl %eax, EXT(initial_apicid)(%ebx)
|
||||
+ jne 1b
|
||||
+2: shrl $2, %ebx
|
||||
+
|
||||
+ /* Now compute the appropriate stack */
|
||||
+ movl %ebx, %eax
|
||||
+ movl $STACK_SIZE, %ebx
|
||||
+ mull %ebx
|
||||
+ subl %eax, %esp
|
||||
+
|
||||
+ /* push the boot_complete flag */
|
||||
+ pushl %ebp
|
||||
+
|
||||
+ /* Save the stack location */
|
||||
+ movl %esp, %ebp
|
||||
+
|
||||
+ /*
|
||||
+ * Now we are finished. Memory is up, data is copied and
|
||||
+ * bss is cleared. Now we call the main routine and
|
||||
+ * let it do the rest.
|
||||
+ */
|
||||
+ intel_chip_post_macro(0xfe) /* post fe */
|
||||
+
|
||||
+ /* Resort the stack location */
|
||||
+ movl %ebp, %esp
|
||||
+
|
||||
+ /* The boot_complete flag has already been pushed */
|
||||
+ call EXT(hardwaremain)
|
||||
+ /*NOTREACHED*/
|
||||
+.Lhlt:
|
||||
+ intel_chip_post_macro(0xee) /* post fe */
|
||||
+ hlt
|
||||
+ jmp .Lhlt
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
+ .globl gdt, gdt_end, gdt_limit
|
||||
+
|
||||
+gdt_limit = gdt_end - gdt - 1 /* compute the table limit */
|
||||
+gdtaddr:
|
||||
+ .word gdt_limit
|
||||
+ .long gdt /* we know the offset */
|
||||
+
|
||||
+gdt:
|
||||
+// selgdt 0
|
||||
+ .word 0x0000, 0x0000 /* dummy */
|
||||
+ .byte 0x00, 0x00, 0x00, 0x00
|
||||
+
|
||||
+// selgdt 8
|
||||
+ .word 0x0000, 0x0000 /* dummy */
|
||||
+ .byte 0x00, 0x00, 0x00, 0x00
|
||||
+
|
||||
+// selgdt 0x10
|
||||
+/* flat code segment */
|
||||
+ .word 0xffff, 0x0000
|
||||
+ .byte 0x00, 0x9b, 0xcf, 0x00
|
||||
+
|
||||
+//selgdt 0x18
|
||||
+/* flat data segment */
|
||||
+ .word 0xffff, 0x0000
|
||||
+ .byte 0x00, 0x93, 0xcf, 0x00
|
||||
+
|
||||
+//selgdt 0x20
|
||||
+ .word 0x0000, 0x0000 /* dummy */
|
||||
+ .byte 0x00, 0x00, 0x00, 0x00
|
||||
+
|
||||
+#if defined(CONFIG_VGABIOS) && (CONFIG_VGABIOS == 1)
|
||||
+ // from monty:
|
||||
+ /* 0x00009a00,0000ffffULL, 20h: 16-bit 64k code at 0x00000000 */
|
||||
+ /* 0x00009200,0000ffffULL 28h: 16-bit 64k data at 0x00000000 */
|
||||
+// selgdt 0x28
|
||||
+/*16-bit 64k code at 0x00000000 */
|
||||
+ .word 0xffff, 0x0000
|
||||
+ .byte 0, 0x9a, 0, 0
|
||||
+
|
||||
+// selgdt 0x30
|
||||
+/*16-bit 64k data at 0x00000000 */
|
||||
+ .word 0xffff, 0x0000
|
||||
+ .byte 0, 0x92, 0, 0
|
||||
+#endif // defined(CONFIG_VGABIOS) && (CONFIG_VGABIOS == 1)
|
||||
+gdt_end:
|
||||
+
|
||||
+.code32
|
||||
|
||||
Eigenschafts<EFBFBD>nderungen: LinuxBIOSv1\src\arch\i386\lib\c_start.S
|
||||
___________________________________________________________________
|
||||
Hinzugef<EFBFBD>gt: svn:keywords
|
||||
+ Author Date Id Revision
|
||||
Hinzugef<EFBFBD>gt: svn:eol-style
|
||||
Hinzugef<EFBFBD>gt: svn:eol-style
|
||||
+ native
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@@ -1 +1,33 @@
|
||||
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:1:{i:0;a:3:{i:0;s:0:"";i:1;s:1:"1";i:2;s:3:"abc";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"0";i:1;s:1:"0";}i:1;a:2:{i:0;s:1:"1";i:1;i:1;}}}}}
|
||||
<?php return array (
|
||||
'a' =>
|
||||
array (
|
||||
'chunks' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '',
|
||||
1 => '1',
|
||||
2 => "abc\r\n",
|
||||
),
|
||||
),
|
||||
),
|
||||
'chunks_def' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '0',
|
||||
1 => '0',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
@@ -1 +1,39 @@
|
||||
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:2:{i:0;a:3:{i:0;s:0:"";i:1;s:1:"1";i:2;s:3:"abc";}i:1;a:3:{i:0;s:0:"";i:1;i:2;i:2;s:3:"abc";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"0";i:1;s:1:"0";}i:1;a:2:{i:0;s:1:"1";i:1;s:1:"2";}}}}}
|
||||
<?php return array (
|
||||
'a' =>
|
||||
array (
|
||||
'chunks' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '',
|
||||
1 => '1',
|
||||
2 => "abc\r\n",
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '',
|
||||
1 => 2,
|
||||
2 => "abc\r\n",
|
||||
),
|
||||
),
|
||||
),
|
||||
'chunks_def' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '0',
|
||||
1 => '0',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '2',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
@@ -1 +1,39 @@
|
||||
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:2:{i:0;a:3:{i:0;s:1:"1";i:1;s:1:"1";i:2;s:3:"abc";}i:1;a:3:{i:0;i:2;i:1;s:0:"";i:2;s:3:"abc";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;s:1:"2";}i:1;a:2:{i:0;s:1:"1";i:1;i:1;}}}}}
|
||||
<?php return array (
|
||||
'a' =>
|
||||
array (
|
||||
'chunks' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '1',
|
||||
2 => "abc\r\n",
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => 2,
|
||||
1 => '',
|
||||
2 => "abc\r\n",
|
||||
),
|
||||
),
|
||||
),
|
||||
'chunks_def' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '2',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
@@ -1 +1,39 @@
|
||||
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:2:{i:0;a:3:{i:0;s:1:"1";i:1;s:0:"";i:2;s:3:"abc";}i:1;a:3:{i:0;s:0:"";i:1;s:1:"1";i:2;s:2:"ls";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;i:1;}i:1;a:2:{i:0;s:1:"1";i:1;i:1;}}}}}
|
||||
<?php return array (
|
||||
'a' =>
|
||||
array (
|
||||
'chunks' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '',
|
||||
2 => "abc\r\n",
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '',
|
||||
1 => '1',
|
||||
2 => "ls\r\n",
|
||||
),
|
||||
),
|
||||
),
|
||||
'chunks_def' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => 1,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
@@ -1 +1,39 @@
|
||||
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:2:{i:0;a:3:{i:0;s:1:"1";i:1;s:1:"1";i:2;s:2:"ls";}i:1;a:3:{i:0;s:0:"";i:1;i:2;i:2;s:2:"ls";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;i:1;}i:1;a:2:{i:0;s:1:"1";i:1;s:1:"2";}}}}}
|
||||
<?php return array (
|
||||
'a' =>
|
||||
array (
|
||||
'chunks' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '1',
|
||||
2 => "ls\r\n",
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '',
|
||||
1 => 2,
|
||||
2 => "ls\r\n",
|
||||
),
|
||||
),
|
||||
),
|
||||
'chunks_def' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => 1,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '2',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
@@ -1 +1,45 @@
|
||||
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:3:{i:0;a:3:{i:0;s:1:"1";i:1;s:1:"1";i:2;s:2:"ls";}i:1;a:3:{i:0;i:2;i:1;i:2;i:2;s:2:"ls";}i:2;a:3:{i:0;s:0:"";i:1;i:3;i:2;s:1:"l";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;s:1:"2";}i:1;a:2:{i:0;s:1:"1";i:1;s:1:"3";}}}}}
|
||||
<?php return array (
|
||||
'a' =>
|
||||
array (
|
||||
'chunks' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '1',
|
||||
2 => "ls\r\n",
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => 2,
|
||||
1 => 2,
|
||||
2 => "ls\r\n",
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
0 => '',
|
||||
1 => 3,
|
||||
2 => "l\r\n",
|
||||
),
|
||||
),
|
||||
),
|
||||
'chunks_def' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '2',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '3',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
@@ -1 +1,33 @@
|
||||
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:1:{i:0;a:3:{i:0;s:0:"";i:1;s:1:"1";i:2;s:3:"foo";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"0";i:1;s:1:"0";}i:1;a:2:{i:0;s:1:"1";i:1;s:1:"1";}}}}}
|
||||
<?php return array (
|
||||
'a' =>
|
||||
array (
|
||||
'chunks' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '',
|
||||
1 => '1',
|
||||
2 => "foo\n",
|
||||
),
|
||||
),
|
||||
),
|
||||
'chunks_def' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '0',
|
||||
1 => '0',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '1',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
@@ -1 +1,39 @@
|
||||
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:2:{i:0;a:3:{i:0;s:1:"1";i:1;s:1:"1";i:2;s:3:"foo";}i:1;a:3:{i:0;s:0:"";i:1;i:2;i:2;s:2:"bf";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;s:1:"1";}i:1;a:2:{i:0;s:1:"1";i:1;s:1:"2";}}}}}
|
||||
<?php return array (
|
||||
'a' =>
|
||||
array (
|
||||
'chunks' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '1',
|
||||
2 => "foo\n",
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '',
|
||||
1 => 2,
|
||||
2 => "bf\n",
|
||||
),
|
||||
),
|
||||
),
|
||||
'chunks_def' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '1',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '2',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
@@ -1 +1,33 @@
|
||||
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:1:{i:0;a:3:{i:0;s:0:"";i:1;s:1:"1";i:2;s:3:"abc";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"0";i:1;s:1:"0";}i:1;a:2:{i:0;s:1:"1";i:1;i:1;}}}}}
|
||||
<?php return array (
|
||||
'a' =>
|
||||
array (
|
||||
'chunks' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '',
|
||||
1 => '1',
|
||||
2 => "abc\n",
|
||||
),
|
||||
),
|
||||
),
|
||||
'chunks_def' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '0',
|
||||
1 => '0',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
@@ -1 +1,45 @@
|
||||
a:1:{s:1:"b";a:2:{s:6:"chunks";a:1:{i:0;a:3:{i:0;a:3:{i:0;s:0:"";i:1;s:1:"1";i:2;s:1:"a";}i:1;a:3:{i:0;s:0:"";i:1;i:2;i:2;s:1:"b";}i:2;a:3:{i:0;s:0:"";i:1;i:3;i:2;b:0;}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"0";i:1;s:1:"0";}i:1;a:2:{i:0;s:1:"1";i:1;s:1:"3";}}}}}
|
||||
<?php return array (
|
||||
'b' =>
|
||||
array (
|
||||
'chunks' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '',
|
||||
1 => '1',
|
||||
2 => "a\n",
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '',
|
||||
1 => 2,
|
||||
2 => "b\n",
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
0 => '',
|
||||
1 => 3,
|
||||
2 => "\n",
|
||||
),
|
||||
),
|
||||
),
|
||||
'chunks_def' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '0',
|
||||
1 => '0',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '3',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
@@ -1 +1,51 @@
|
||||
a:1:{s:1:"b";a:2:{s:6:"chunks";a:1:{i:0;a:4:{i:0;a:3:{i:0;s:1:"1";i:1;s:1:"1";i:2;s:1:"a";}i:1;a:3:{i:0;s:0:"";i:1;i:2;i:2;s:1:"l";}i:2;a:3:{i:0;i:2;i:1;i:3;i:2;s:1:"b";}i:3;a:3:{i:0;i:3;i:1;i:4;i:2;b:0;}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;s:1:"3";}i:1;a:2:{i:0;s:1:"1";i:1;s:1:"4";}}}}}
|
||||
<?php return array (
|
||||
'b' =>
|
||||
array (
|
||||
'chunks' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '1',
|
||||
2 => "a\n",
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '',
|
||||
1 => 2,
|
||||
2 => "l\n",
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
0 => 2,
|
||||
1 => 3,
|
||||
2 => "b\n",
|
||||
),
|
||||
3 =>
|
||||
array (
|
||||
0 => 3,
|
||||
1 => 4,
|
||||
2 => "\n",
|
||||
),
|
||||
),
|
||||
),
|
||||
'chunks_def' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '3',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '4',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
@@ -1 +1,45 @@
|
||||
a:1:{s:1:"b";a:2:{s:6:"chunks";a:1:{i:0;a:3:{i:0;a:3:{i:0;s:1:"1";i:1;s:1:"1";i:2;s:1:"a";}i:1;a:3:{i:0;i:2;i:1;s:0:"";i:2;s:1:"b";}i:2;a:3:{i:0;i:3;i:1;s:0:"";i:2;b:0;}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;s:1:"3";}i:1;a:2:{i:0;s:1:"1";i:1;i:1;}}}}}
|
||||
<?php return array (
|
||||
'b' =>
|
||||
array (
|
||||
'chunks' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '1',
|
||||
2 => "a\n",
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => 2,
|
||||
1 => '',
|
||||
2 => "b\n",
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
0 => 3,
|
||||
1 => '',
|
||||
2 => "\n",
|
||||
),
|
||||
),
|
||||
),
|
||||
'chunks_def' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '3',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
@@ -1 +1,39 @@
|
||||
a:1:{s:9:"test_file";a:2:{s:6:"chunks";a:1:{i:0;a:2:{i:0;a:3:{i:0;s:1:"1";i:1;s:0:"";i:2;s:17:"Steddy is awesome";}i:1;a:3:{i:0;s:0:"";i:1;s:1:"1";i:2;s:22:"Steddy is very awesome";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;i:1;}i:1;a:2:{i:0;s:1:"1";i:1;i:1;}}}}}
|
||||
<?php return array (
|
||||
'test_file' =>
|
||||
array (
|
||||
'chunks' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '',
|
||||
2 => "Steddy is awesome\n",
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '',
|
||||
1 => '1',
|
||||
2 => 'Steddy is very awesome',
|
||||
),
|
||||
),
|
||||
),
|
||||
'chunks_def' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => 1,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
@@ -1 +1,39 @@
|
||||
a:1:{s:3:"foo";a:2:{s:6:"chunks";a:1:{i:0;a:2:{i:0;a:3:{i:0;s:1:"1";i:1;s:0:"";i:2;s:11:"This is foo";}i:1;a:3:{i:0;s:0:"";i:1;s:1:"1";i:2;s:11:"This is foo";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;i:1;}i:1;a:2:{i:0;s:1:"1";i:1;i:1;}}}}}
|
||||
<?php return array (
|
||||
'foo' =>
|
||||
array (
|
||||
'chunks' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '',
|
||||
2 => "This is foo\n",
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '',
|
||||
1 => '1',
|
||||
2 => 'This is foo',
|
||||
),
|
||||
),
|
||||
),
|
||||
'chunks_def' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => 1,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
@@ -1 +1,39 @@
|
||||
a:1:{s:3:"foo";a:2:{s:6:"chunks";a:1:{i:0;a:2:{i:0;a:3:{i:0;s:1:"1";i:1;s:0:"";i:2;s:11:"This is foo";}i:1;a:3:{i:0;s:0:"";i:1;s:1:"1";i:2;s:11:"This is foo";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;i:1;}i:1;a:2:{i:0;s:1:"1";i:1;i:1;}}}}}
|
||||
<?php return array (
|
||||
'foo' =>
|
||||
array (
|
||||
'chunks' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '',
|
||||
2 => "This is foo",
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '',
|
||||
1 => '1',
|
||||
2 => "This is foo\n",
|
||||
),
|
||||
),
|
||||
),
|
||||
'chunks_def' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => 1,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
10
test/data/IDF_DiffTest/test-18-git-lineendings.diff
Normal file
10
test/data/IDF_DiffTest/test-18-git-lineendings.diff
Normal file
@@ -0,0 +1,10 @@
|
||||
diff --git a/lineendings b/lineendings
|
||||
index 7c2b7ec..9c59944 100644
|
||||
--- a/lineendings
|
||||
+++ b/lineendings
|
||||
@@ -1,3 +1,4 @@
|
||||
+Unix, again
|
||||
Windows
|
||||
Unix
|
||||
Old Macintosh
|
||||
Nothing
|
51
test/data/IDF_DiffTest/test-18-git-lineendings.expected
Normal file
51
test/data/IDF_DiffTest/test-18-git-lineendings.expected
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php return array (
|
||||
'lineendings' =>
|
||||
array (
|
||||
'chunks' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '',
|
||||
1 => '1',
|
||||
2 => "Unix, again\n",
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => 2,
|
||||
2 => "Windows\r\n",
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
0 => 2,
|
||||
1 => 3,
|
||||
2 => "Unix\n",
|
||||
),
|
||||
3 =>
|
||||
array (
|
||||
0 => 3,
|
||||
1 => 4,
|
||||
2 => "Old Macintosh\rNothing",
|
||||
),
|
||||
),
|
||||
),
|
||||
'chunks_def' =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '3',
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
0 => '1',
|
||||
1 => '4',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
@@ -0,0 +1 @@
|
||||
3
|
@@ -0,0 +1,2 @@
|
||||
4
|
||||
layout sharded 1000
|
@@ -0,0 +1 @@
|
||||
fsfs
|
@@ -0,0 +1 @@
|
||||
0
|
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
K 8
|
||||
svn:date
|
||||
V 27
|
||||
2011-08-12T17:06:15.429110Z
|
||||
END
|
@@ -0,0 +1,13 @@
|
||||
K 10
|
||||
svn:author
|
||||
V 7
|
||||
patrick
|
||||
K 8
|
||||
svn:date
|
||||
V 27
|
||||
2011-08-12T17:07:33.111035Z
|
||||
K 7
|
||||
svn:log
|
||||
V 12
|
||||
added a file
|
||||
END
|
@@ -0,0 +1,13 @@
|
||||
K 10
|
||||
svn:author
|
||||
V 7
|
||||
patrick
|
||||
K 8
|
||||
svn:date
|
||||
V 27
|
||||
2011-08-12T17:07:55.894416Z
|
||||
K 7
|
||||
svn:log
|
||||
V 14
|
||||
renamed a file
|
||||
END
|
@@ -0,0 +1,13 @@
|
||||
K 10
|
||||
svn:author
|
||||
V 7
|
||||
patrick
|
||||
K 8
|
||||
svn:date
|
||||
V 27
|
||||
2011-08-12T17:08:12.646051Z
|
||||
K 7
|
||||
svn:log
|
||||
V 14
|
||||
deleted a file
|
||||
END
|
@@ -0,0 +1,11 @@
|
||||
PLAIN
|
||||
END
|
||||
ENDREP
|
||||
id: 0.0.r0/17
|
||||
type: dir
|
||||
count: 0
|
||||
text: 0 0 4 4 2d2977d1c96f487abe4a1e202dd03b4e
|
||||
cpath: /
|
||||
|
||||
|
||||
17 107
|
@@ -0,0 +1,28 @@
|
||||
DELTA
|
||||
SVNENDREP
|
||||
id: 0-1.0.r1/17
|
||||
type: file
|
||||
count: 0
|
||||
text: 1 0 4 0 d41d8cd98f00b204e9800998ecf8427e da39a3ee5e6b4b0d3255bfef95601890afd80709 0-0/_2
|
||||
cpath: /new-file
|
||||
copyroot: 0 /
|
||||
|
||||
PLAIN
|
||||
K 8
|
||||
new-file
|
||||
V 16
|
||||
file 0-1.0.r1/17
|
||||
END
|
||||
ENDREP
|
||||
id: 0.0.r1/232
|
||||
type: dir
|
||||
pred: 0.0.r0/17
|
||||
count: 1
|
||||
text: 1 180 39 39 4a0c4e617d69f8a0bf11161d1e1b09a6
|
||||
cpath: /
|
||||
copyroot: 0 /
|
||||
|
||||
_0.0.t0-0 add-file true false /new-file
|
||||
|
||||
|
||||
232 357
|
@@ -0,0 +1,29 @@
|
||||
id: 0-1.0-2.r2/0
|
||||
type: file
|
||||
pred: 0-1.0.r1/17
|
||||
count: 1
|
||||
text: 1 0 4 0 d41d8cd98f00b204e9800998ecf8427e da39a3ee5e6b4b0d3255bfef95601890afd80709 0-0/_2
|
||||
cpath: /alternate-name
|
||||
copyfrom: 1 /new-file
|
||||
|
||||
PLAIN
|
||||
K 14
|
||||
alternate-name
|
||||
V 17
|
||||
file 0-1.0-2.r2/0
|
||||
END
|
||||
ENDREP
|
||||
id: 0.0.r2/256
|
||||
type: dir
|
||||
pred: 0.0.r1/232
|
||||
count: 2
|
||||
text: 2 196 47 47 518568bcb7e6fe3165235a9f9993f5e1
|
||||
cpath: /
|
||||
copyroot: 0 /
|
||||
|
||||
0-1.0.r1/17 delete-file false false /new-file
|
||||
|
||||
0-1._0.t1-1 add-file false false /alternate-name
|
||||
1 /new-file
|
||||
|
||||
256 382
|
@@ -0,0 +1,15 @@
|
||||
PLAIN
|
||||
END
|
||||
ENDREP
|
||||
id: 0.0.r3/17
|
||||
type: dir
|
||||
pred: 0.0.r2/256
|
||||
count: 3
|
||||
text: 3 0 4 4 2d2977d1c96f487abe4a1e202dd03b4e
|
||||
cpath: /
|
||||
copyroot: 0 /
|
||||
|
||||
0-1.0-2.r2/0 delete-file false false /alternate-name
|
||||
|
||||
|
||||
17 138
|
@@ -0,0 +1 @@
|
||||
3
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user