fixed a bug of not handling 'head revision' correctly in code_folder.php

This commit is contained in:
hyung-hwan 2010-04-15 14:17:28 +00:00
parent 75d3c271d6
commit b4fdd8f888
6 changed files with 60 additions and 6 deletions

View File

@ -1,7 +1,7 @@
cfgdir=$(CFGDIR) cfgdir=$(CFGDIR)
cfg_DATA = codepot.ini codepot.sql codepot.a2ldap cfg_DATA = codepot.ini codepot.sql codepot.a2ldap
cfg_SCRIPTS = start-commit pre-commit post-commit cfg_SCRIPTS = start-commit pre-commit post-commit pre-revprop-change post-revprop-change
EXTRA_DIST = $(cfg_DATA) $(cfg_SCRIPTS) EXTRA_DIST = $(cfg_DATA) $(cfg_SCRIPTS)

13
codepot/etc/post-revprop-change Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
REPOBASE="`basename "${1}"`"
REV="${2}"
USER="${3}"
PROPNAME="${4}"
ACTION="${5}"
# [STDIN] PROPVAL ** the old property value is passed via STDIN.
# does not care if logging has failed.
wget -q -O- "%API%/logRevpropChange/svn/${REPOBASE}/${REV}" 2>/dev/null
exit 0

24
codepot/etc/pre-revprop-change Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
REPOBASE="`basename "${1}"`"
USER="${2}"
USER="${3}"
PROPNAME="${4}"
ACTION="${5}"
# [STDIN] PROPVAL ** the new property value is passed via STDIN.
ans="`wget -q -O- "%API%/projectHasMember/${REPOBASE}/${USER}" 2>/dev/null`"
[ "${ans}" = "YES" ] && exit 0
[ "${ans}" = "NO" ] && {
echo "-------------------------------------------------------------" >&2
echo " ${USER} is not a member of ${REPOBASE}" >&2
echo "-------------------------------------------------------------" >&2
exit 1
}
echo "---------------------------------------------------------------------" >&2
echo " Failed to check membership of ${REPOBASE} for ${USER}" >&2
echo "---------------------------------------------------------------------" >&2
exit 1

View File

@ -53,5 +53,16 @@ class API extends Controller
$this->email->send (); $this->email->send ();
*/ */
} }
function logCodeRevpropChange ($type, $repo, $rev, $propname)
{
$this->check_access ();
if (!isset($repo) || !isset($rev) || !isset($propname)) return;
$this->load->model ('LogModel', 'logs');
// TODO:
//$this->logs->writeCodeRevpropChange ($type, $repo, $rev, '');
}
} }

View File

@ -202,8 +202,11 @@ if (array_key_exists('properties', $file) && count($file['properties']) > 0)
{ {
print '<li>'; print '<li>';
print htmlspecialchars($pn); print htmlspecialchars($pn);
print ' - '; if ($pv != '')
print htmlspecialchars($pv); {
print ' - ';
print htmlspecialchars($pv);
}
print '</li>'; print '</li>';
} }
print '</ul>'; print '</ul>';

View File

@ -54,8 +54,11 @@ $this->load->view (
{ {
print '<li>'; print '<li>';
print htmlspecialchars ($pk); print htmlspecialchars ($pk);
print ' - '; if ($pv != '')
print htmlspecialchars ($pv); {
print ' - ';
print htmlspecialchars ($pv);
}
print '</li>'; print '</li>';
} }
print '</ul>'; print '</ul>';
@ -133,7 +136,7 @@ $this->load->view (
$xpar = $this->converter->AsciiTohex ($headpath); $xpar = $this->converter->AsciiTohex ($headpath);
if ($revision > 0 && $revision < $next_revision) if ($revision > 0 && $revision < $next_revision)
{ {
print anchor ("code/file/{$project->id}", $this->lang->line('Head revision')); print anchor ("code/file/{$project->id}/{$xpar}", $this->lang->line('Head revision'));
print ' | '; print ' | ';
} }
print anchor ("code/history/{$project->id}/{$xpar}", $this->lang->line('History')); print anchor ("code/history/{$project->id}/{$xpar}", $this->lang->line('History'));