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.289
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
Unified Diff Ignore Whitespace Patch
Changes to nano/fossil.php.
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51






52
53
54
55
56
57
58
59
60
        } else {
            $cmd = "unset GATEWAY_INTERFACE; {$cmd}";
        }

        return $cmd;
    }

    public function newRepo($repo, $password = null, $private = 0, $projectCode = null)
    {
        if (!file_exists($this->path)) {
            mkdir($this->path);

            $content = "#!/usr/local/bin/fossil\ndirectory: ./\nnotfound: http://{$_SERVER['SERVER_NAME']}/notfound";
            file_put_contents("{$this->path}repository", $content);
            chmod("{$this->path}repository", 0555);
        }







        if (!file_exists("{$this->path}{$repo}.fossil")) {
            exec($this->getFossilCommand() . " new --sha1 -A " . escapeshellarg($this->user['username']) . " " . escapeshellarg("{$this->path}{$repo}.fossil"), $output, $return);

            if ($return !== 0) {
                if (file_exists("{$this->path}{$repo}.fossil")) {
                    unlink("{$this->path}{$repo}.fossil");
                }

                return false;







|









>
>
>
>
>
>

|







35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
        } else {
            $cmd = "unset GATEWAY_INTERFACE; {$cmd}";
        }

        return $cmd;
    }

    public function newRepo($repo, $password = null, $private = 0, $projectCode = null, $sha3 = false)
    {
        if (!file_exists($this->path)) {
            mkdir($this->path);

            $content = "#!/usr/local/bin/fossil\ndirectory: ./\nnotfound: http://{$_SERVER['SERVER_NAME']}/notfound";
            file_put_contents("{$this->path}repository", $content);
            chmod("{$this->path}repository", 0555);
        }

        if ($sha3 === true) {
            $shaArg = ""
        } else {
            $shaArg = "--sha1"
        }

        if (!file_exists("{$this->path}{$repo}.fossil")) {
            exec($this->getFossilCommand() . " new " . $shaArg . " -A " . escapeshellarg($this->user['username']) . " " . escapeshellarg("{$this->path}{$repo}.fossil"), $output, $return);

            if ($return !== 0) {
                if (file_exists("{$this->path}{$repo}.fossil")) {
                    unlink("{$this->path}{$repo}.fossil");
                }

                return false;