Added the latest fixes for the new backend.
This commit is contained in:
@@ -54,6 +54,7 @@ class IDF_Scm_Cache_Git extends Pluf_Model
|
||||
$cache = new IDF_Scm_Cache_Git();
|
||||
$cache->project = $this->_project;
|
||||
$cache->githash = $blob->hash;
|
||||
$blob->title = IDF_Commit::toUTF8($blob->title);
|
||||
$cache->content = $blob->date.chr(31).$blob->author.chr(31).$blob->title;
|
||||
$sql = new Pluf_SQL('project=%s AND githash=%s',
|
||||
array($this->_project->id, $blob->hash));
|
||||
|
@@ -207,17 +207,6 @@ class IDF_Scm_Mercurial extends IDF_Scm
|
||||
} else {
|
||||
$type = 'blob';
|
||||
}
|
||||
if (!$root and !$folder and preg_match('/^.*\/.*$/', $file)) {
|
||||
continue;
|
||||
}
|
||||
if ($folder) {
|
||||
preg_match('|^'.$folder.'[/]?([^/]+)?$|', $file,$match);
|
||||
if (count($match) > 1) {
|
||||
$file = $match[1];
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ($totest == $file) {
|
||||
return (object) array('perm' => $perm, 'type' => $type,
|
||||
'hash' => $hash,
|
||||
@@ -229,19 +218,13 @@ class IDF_Scm_Mercurial extends IDF_Scm
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a blob.
|
||||
*
|
||||
* @param string request_file_info
|
||||
* @param null to be svn client compatible
|
||||
* @return string Raw blob
|
||||
*/
|
||||
public function getBlob($request_file_info, $dummy=null)
|
||||
public function getFile($def, $cmd_only=false)
|
||||
{
|
||||
return shell_exec(sprintf(Pluf::f('hg_path', 'hg').' cat -R %s -r %s %s',
|
||||
escapeshellarg($this->repo),
|
||||
$dummy,
|
||||
escapeshellarg($this->repo . '/' . $request_file_info->file)));
|
||||
$cmd = sprintf(Pluf::f('hg_path', 'hg').' cat -R %s -r %s %s',
|
||||
escapeshellarg($this->repo),
|
||||
escapeshellarg($def->commit),
|
||||
escapeshellarg($this->repo.'/'.$def->file));
|
||||
return ($cmd_only) ? $cmd : shell_exec($cmd);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user