Skip to content
Extraits de code Groupes Projets
Valider 117f07ac rédigé par JamesRezo's avatar JamesRezo :tada:
Parcourir les fichiers

version_vcs_courante() -> decrire_version_git()

parent 7f4824ac
Branches
Étiquettes
Aucune requête de fusion associée trouvée
...@@ -112,12 +112,13 @@ ...@@ -112,12 +112,13 @@
$section = dirname($test); $section = dirname($test);
$section_dir = $section; $section_dir = $section;
#$section = str_replace('/tests',' ',dirname($test)); #$section = str_replace('/tests',' ',dirname($test));
if ($svn = version_vcs_courante(dirname(dirname($test)))) if ($vcs = decrire_version_git(dirname(dirname($test)))) {
$section_svn = ' ['.abs($svn).']'; $section_vcs = ' ['.$vcs['commit_short'].']';
}
} }
if ($section <> $sectionold) { if ($section <> $sectionold) {
if ($sectionold) echo "</dl>\n"; if ($sectionold) echo "</dl>\n";
$titre = $dirTests ? $section : "<a href='../$section_dir'>$section</a>$section_svn"; $titre = $dirTests ? $section : "<a href='../$section_dir'>$section</a>$section_vcs";
echo "<dl><dt>$titre</dt>\n"; echo "<dl><dt>$titre</dt>\n";
$sectionold = $section; $sectionold = $section;
} }
...@@ -144,11 +145,12 @@ ...@@ -144,11 +145,12 @@
function version_spip() { function version_spip() {
include_spip('inc/minipres'); include_spip('inc/minipres');
$version = $GLOBALS['spip_version_affichee']; $version = $GLOBALS['spip_version_affichee'];
if ($svn_revision = version_vcs_courante(_DIR_RACINE)) if ($vcs = decrire_version_git(_DIR_RACINE)) {
$version .= ' ' . (($svn_revision < 0) ? 'SVN ':'') $version .= ' ' . ($vcs['vcs'] ?? '')
. "[<a href='http://core.spip.org/projects/spip/repository/revisions/" . "[<a href='https://git.spip.net/spip/spip/commit/"
. abs($svn_revision) . "' onclick=\"window.open(this.href); return false;\">" . $vcs['commit'] . "' onclick=\"window.open(this.href); return false;\">"
. abs($svn_revision) . "</a>]"; . $vcs['commit_short'] . "</a>]";
}
return $version; return $version;
} }
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter