Indefero

Indefero Commit Details


Date:2008-09-12 05:26:51 (16 years 7 months ago)
Author:Nicolas Lassalle
Branch:dev, develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:bd1532875847a5d4e5b4c263580b10254c31353b
Parents: e4f7dd89759f21cf606ff576fbfe924880882105
Message:[PATCH] Fixed issue 41 - View Source : Missing argument 2 for IDF_Scm_Svn::getBlob()

Created an unique method declaration in the tow scm backend.
Passed a more generic argument so that the scm backend could get the
correct data.
Changes:

File differences

src/IDF/Scm/Git.php
203203
204204
205205
206
206
207
207208
208209
209
210
210211
211212
212213
213
214
214215
215216
216217
    /**
     * Get a blob.
     *
     * @param string Blob hash
     * @param string request_file_info
     * @param null to be svn client compatible
     * @return string Raw blob
     */
    public function getBlob($hash)
    public function getBlob($request_file_info, $dummy=null)
    {
        return shell_exec(sprintf('GIT_DIR=%s git-cat-file blob %s',
                                  escapeshellarg($this->repo),
                                  escapeshellarg($hash)));
                                  escapeshellarg($request_file_info->hash)));
    }
    /**
src/IDF/Scm/Svn.php
228228
229229
230230
231
231
232232
233233
234
234
235235
236236
237237
238238
239
239
240240
241241
242242
    /**
     * Get a blob.
     *
     * @param string Blob hash
     * @param string request_file_info
     * @return string Raw blob
     */
    public function getBlob($path, $rev)
    public function getBlob($request_file_info, $rev)
    {
        $cmd = sprintf('svn cat --username=%s --password=%s %s@%s',
                       escapeshellarg($this->username),
                       escapeshellarg($this->password),
                       escapeshellarg($this->repo.'/'.$path),
                       escapeshellarg($this->repo.'/'.$request_file_info->fullpath),
                       escapeshellarg($rev));
        return shell_exec($cmd);
    }
src/IDF/Views/Source.php
124124
125125
126126
127
127
128128
129129
130130
        }
        if ($request_file_info->type != 'tree') {
            $info = self::getMimeType($request_file_info->file);
            $rep = new Pluf_HTTP_Response($scm->getBlob($request_file_info->hash),
            $rep = new Pluf_HTTP_Response($scm->getBlob($request_file_info, $commit),
                                          $info[0]);
            $rep->headers['Content-Disposition'] = 'attachment; filename="'.$info[1].'"';
            return $rep;

Archive Download the corresponding diff file

Page rendered in 0.12812s using 14 queries.