Beispiel #1
0
    def run(self):
        assert self.path
        passthrough = self.options.passthrough
        if not passthrough:
            passthrough = self.conf.svnadmin_create_flags

        if not passthrough:
            r = svn.repos.create(self.path, None, None, None, None, self.pool)
            assert r
        else:
            cmd = [
                'svnadmin',
                'create',
            ] + passthrough.split(' ') + [
                self.path,
            ]
            self._verbose(' '.join(cmd))
            subprocess.check_call(cmd)

        root_url = 'file://%s' % os.path.abspath(self.path)

        if self.options.verbose:
            stdout = subprocess.PIPE
        else:
            stdout = open('/dev/null', 'w')

        if not self.component_depth:
            no_svnmucc = self.options.no_svnmucc
            if not no_svnmucc:
                no_svnmucc = self.conf.no_svnmucc_after_evnadmin_create

            standard_layout = self.conf.standard_layout
            if not no_svnmucc and standard_layout:
                cmd = [
                    'svnmucc',
                    '-m',
                    '"Initializing repository."',
                    '--root-url',
                    root_url,
                ]
                for d in standard_layout:
                    cmd += [ 'mkdir', d ]

                self._verbose(' '.join(cmd))

                suppress_stdout = subprocess.check_call(cmd, stdout=stdout)

        with Command.prime(self, EnableCommand) as command:
            command.path = self.path
            command.options.quiet = True
            command.run()

        if self.component_depth not in (0, 1):
            return

        with Command.prime(self, SetRepoComponentDepthCommand) as command:
            command.path = self.path
            command.options.quiet = True
            command.component_depth = self.component_depth
            command.run()
Beispiel #2
0
    def run(self):
        assert self.path
        r = svn.repos.create(self.path, None, None, None, None, self.pool)
        assert r

        with Command.prime(self, EnableCommand) as command:
            command.path = self.path
            command.run()
Beispiel #3
0
    def run(self):
        assert self.path
        r = svn.repos.create(self.path, None, None, None, None, self.pool)
        assert r

        with Command.prime(self, EnableCommand) as command:
            command.path = self.path
            command.run()
Beispiel #4
0
    def run(self):
        self.options.quiet = True

        with Command.prime(self, AnalyzeCommand) as command:
            command.path = self.path
            command.run(from_enable=True)
            if not command.options.quiet:
                self.options.quiet = False

        FixHooksCommand.run(self)

        for h in self.hook_files:
            if not h.is_enabled:
                h.enable()

        self._out("Enabled Enversion for repository '%s'." % self.name)
Beispiel #5
0
 def run(self):
     quiet = self.options.quiet
     for test in self.tests:
         with Command.prime(self, test) as command:
             command.run()