* @access public
*
* @param integer Lower (current) revision
+ * @param bool Use separate and individual queries for inserting?
*/
- function build($revision)
+ function build($revision, $seps = false)
{
$start = microtime();
$inserts['nodes'][] = "('$path', '" . $node['kind'] . "', " . $node['commit']['revision'] . ", '" . $this->controller->registry->escape(serialize($loglist)) . "', '" . $this->controller->registry->escape(serialize($proplist["$path"])) . "')";
}
- // insert _revs
- $this->controller->registry->db->query("
- REPLACE INTO c{$this->hash}_revs
- (revision, author, dateline, message, files)
- VALUES
- " . implode(",\n", $inserts['revs'])
- );
-
- // insert _nodes
- $this->controller->registry->db->query("
- REPLACE INTO c{$this->hash}_nodes
- (name, node, revision, history, properties)
- VALUES
- " . implode(",\n", $inserts['nodes'])
- );
+ if ($seps == false)
+ {
+ // insert _revs
+ $this->controller->registry->db->query("
+ REPLACE INTO c{$this->hash}_revs
+ (revision, author, dateline, message, files)
+ VALUES
+ " . implode(",\n", $inserts['revs'])
+ );
+
+ // insert _nodes
+ $this->controller->registry->db->query("
+ REPLACE INTO c{$this->hash}_nodes
+ (name, node, revision, history, properties)
+ VALUES
+ " . implode(",\n", $inserts['nodes'])
+ );
+ }
+ else
+ {
+ // _revs
+ foreach ($inserts['revs'] AS $insert)
+ {
+ $this->controller->registry->db->query("
+ REPLACE INTO c{$this->hash}_revs
+ (revision, author, dateline, message, files)
+ VALUES
+ $insert"
+ );
+ }
+
+ // _nodes
+ foreach ($inserts['nodes'] AS $insert)
+ {
+ $this->controller->registry->db->query("
+ REPLACE INTO c{$this->hash}_nodes
+ (name, node, revision, history, properties)
+ VALUES
+ $insert"
+ );
+ }
+ }
$this->controller->registry->debug("TIME TO (RE)BUILD: " . $this->controller->registry->funct->fetch_microtime_diff($start));
}