Check-in [1f8460d3c5]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Updated to support creating SHA3 repositories (disabled by default) at the nano layer
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:1f8460d3c561b69fc893a4ac31b2ff389e5b3831
User & Date: rkeene 2017-03-16 16:04:05
Context
2017-03-16
16:07
Added web interface for creating SHA3 repos check-in: 96b4a74064 user: rkeene tags: trunk
16:04
Updated to support creating SHA3 repositories (disabled by default) at the nano layer check-in: 1f8460d3c5 user: rkeene tags: trunk
15:41
Updated to create new repositories as SHA1 for compatibility with older Fossil versions check-in: 1ab71c2b65 user: rkeene tags: trunk
Changes

Changes to nano/fossil.php.

    35     35           } else {
    36     36               $cmd = "unset GATEWAY_INTERFACE; {$cmd}";
    37     37           }
    38     38   
    39     39           return $cmd;
    40     40       }
    41     41   
    42         -    public function newRepo($repo, $password = null, $private = 0, $projectCode = null)
           42  +    public function newRepo($repo, $password = null, $private = 0, $projectCode = null, $sha3 = false)
    43     43       {
    44     44           if (!file_exists($this->path)) {
    45     45               mkdir($this->path);
    46     46   
    47     47               $content = "#!/usr/local/bin/fossil\ndirectory: ./\nnotfound: http://{$_SERVER['SERVER_NAME']}/notfound";
    48     48               file_put_contents("{$this->path}repository", $content);
    49     49               chmod("{$this->path}repository", 0555);
    50     50           }
           51  +
           52  +        if ($sha3 === true) {
           53  +            $shaArg = ""
           54  +        } else {
           55  +            $shaArg = "--sha1"
           56  +        }
    51     57   
    52     58           if (!file_exists("{$this->path}{$repo}.fossil")) {
    53         -            exec($this->getFossilCommand() . " new --sha1 -A " . escapeshellarg($this->user['username']) . " " . escapeshellarg("{$this->path}{$repo}.fossil"), $output, $return);
           59  +            exec($this->getFossilCommand() . " new " . $shaArg . " -A " . escapeshellarg($this->user['username']) . " " . escapeshellarg("{$this->path}{$repo}.fossil"), $output, $return);
    54     60   
    55     61               if ($return !== 0) {
    56     62                   if (file_exists("{$this->path}{$repo}.fossil")) {
    57     63                       unlink("{$this->path}{$repo}.fossil");
    58     64                   }
    59     65   
    60     66                   return false;