uh, we should really share one mtn instance per project and request...

This commit is contained in:
Thomas Keller 2010-06-24 02:27:38 +02:00
parent 4fdf248cb6
commit f3268b3d37

View File

@ -391,6 +391,8 @@ class IDF_Scm_Monotone extends IDF_Scm
private $stdio; private $stdio;
private static $instances = array();
/** /**
* @see IDF_Scm::__construct() * @see IDF_Scm::__construct()
*/ */
@ -873,7 +875,12 @@ class IDF_Scm_Monotone extends IDF_Scm
*/ */
public static function factory($project) public static function factory($project)
{ {
return new IDF_Scm_Monotone($project); if (!array_key_exists($project->shortname, self::$instances))
{
self::$instances[$project->shortname] =
new IDF_Scm_Monotone($project);
}
return self::$instances[$project->shortname];
} }
/** /**