Пример #1
0
    if ($request->valid($vCommitId)) {
        $commit_id = $request->get('commit_id');
    } else {
        $commit_id = 0;
    }
    $vRevId = new Valid_UInt('rev_id');
    $vRevId->required();
    if ($request->valid($vRevId)) {
        $rev_id = $request->get('rev_id');
    } else {
        $rev_id = 0;
    }
    $vOrder = new Valid_WhiteList('order', array('filename', 'type'));
    $vOrder->required();
    if ($request->valid($vOrder)) {
        $order = $request->get('order');
    } else {
        $order = '';
    }
    $pm = ProjectManager::instance();
    $project = $pm->getProject($group_id);
    $group_name = $project->getUnixName(false);
    $result = svn_data_get_revision_detail($group_id, $commit_id, $rev_id, $order);
    if (db_numrows($result) > 0) {
        svn_header(array('title' => $Language->getText('svn_detail_revision', 'svn_rev', db_result($result, 0, 'revision')), 'help' => 'svn.html#the-subversion-browsing-interface'));
        svn_utils_show_revision_detail($result, $group_id, $group_name, $commit_id);
        svn_footer(array());
    } else {
        exit_error($Language->getText('global', 'error'), $Language->getText('svn_detail_revision', 'id_not_found', $commit_id));
    }
}
Пример #2
0
$group_name = $request->get('group_name');
if ($group_name && !$group_id) {
    $grp = group_get_object_by_name($group_name);
    $group_id = $grp->getGroupId();
}
// Commit and patch are not ambiguous (not trackers)
$svn_loc = "/svn/?func=detailrevision&rev_id=" . (int) $aid . "&group_id=" . (int) $group_id;
$cvs_loc = "/cvs/?func=detailcommit&commit_id=" . (int) $aid . "&group_id=" . (int) $group_id;
if ($atn == 'rev' || $atn == 'revision') {
    $location .= $svn_loc;
    header($location);
    exit;
}
if ($atn == 'commit') {
    // when commit is used see if it revision exists in SVN else redirect to CVS
    $res = svn_data_get_revision_detail($group_id, 0, $aid);
    $feed = '';
    if ($res && db_numrows($res) > 0) {
        $location .= $svn_loc . $feed;
    } else {
        // Check that the commit belongs to the same project
        $commit_group_id = util_get_group_from_commit_id($aid);
        if ($commit_group_id && $group_id != $commit_group_id) {
            // The link is coming from another project, add a warning msg
            $group_name = util_get_group_name_from_id($commit_group_id);
            $feed = "&feedback" . urlencode($Language->getText('tracker_gotoid', 'commit_belongs_to', $group_name));
        }
        $location .= $cvs_loc . $feed;
    }
    header($location);
    exit;