fixed a bug of not handling 'head revision' correctly in code_folder.php
This commit is contained in:
parent
75d3c271d6
commit
b4fdd8f888
@ -1,7 +1,7 @@
|
||||
|
||||
cfgdir=$(CFGDIR)
|
||||
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)
|
||||
|
||||
|
13
codepot/etc/post-revprop-change
Executable file
13
codepot/etc/post-revprop-change
Executable 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
24
codepot/etc/pre-revprop-change
Executable 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
|
@ -53,5 +53,16 @@ class API extends Controller
|
||||
$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, '');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -202,8 +202,11 @@ if (array_key_exists('properties', $file) && count($file['properties']) > 0)
|
||||
{
|
||||
print '<li>';
|
||||
print htmlspecialchars($pn);
|
||||
if ($pv != '')
|
||||
{
|
||||
print ' - ';
|
||||
print htmlspecialchars($pv);
|
||||
}
|
||||
print '</li>';
|
||||
}
|
||||
print '</ul>';
|
||||
|
@ -54,8 +54,11 @@ $this->load->view (
|
||||
{
|
||||
print '<li>';
|
||||
print htmlspecialchars ($pk);
|
||||
if ($pv != '')
|
||||
{
|
||||
print ' - ';
|
||||
print htmlspecialchars ($pv);
|
||||
}
|
||||
print '</li>';
|
||||
}
|
||||
print '</ul>';
|
||||
@ -133,7 +136,7 @@ $this->load->view (
|
||||
$xpar = $this->converter->AsciiTohex ($headpath);
|
||||
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 anchor ("code/history/{$project->id}/{$xpar}", $this->lang->line('History'));
|
||||
|
Loading…
Reference in New Issue
Block a user