Beispiel #1
0
    def add(self, files, message=None, author=None):
        """Add and commit the new files."""
        args = ["add"] + prepare_filelist(files)
        command = self._get_git_command(args)
        exitcode, output, error = run_command(command, self.root_dir)
        if exitcode != 0:
            raise IOError("[GIT] add of files in '%s') failed: %s" \
                    % (self.root_dir, error))

        return output + self.commit(message, author, add=False)
Beispiel #2
0
    def add(self, files, message=None, author=None):
        """Add and commit the new files."""
        args = ["add"] + prepare_filelist(files)
        command = self._get_git_command(args)
        exitcode, output, error = run_command(command, self.root_dir)
        if exitcode != 0:
            raise IOError("[GIT] add of files in '%s') failed: %s" \
                    % (self.root_dir, error))

        return output + self.commit(message, author, add=False)
Beispiel #3
0
    def add(self, files, message=None, author=None):
        """Add and commit the new files."""
        command = ["hg", "add", "-q", "--parents"] + prepare_filelist(files)
        exitcode, output, error = run_command(command)
        if exitcode != 0:
            raise IOError("[Mercurial] Error running '%s': %s" % (command, error))

        # go down as deep as possible in the tree to avoid accidental commits
        # TODO: explicitly commit files by name
        youngest_ancestor = os.path.commonprefix(files)
        return output + type(self)(youngest_ancestor).commit(message, author)
Beispiel #4
0
    def add(self, files, message=None, author=None):
        """Add and commit files."""
        command = ["darcs", "add", "--repodir", self.root_dir] + prepare_filelist(files)
        exitcode, output, error = run_command(command)
        if exitcode != 0:
            raise IOError("[Darcs] Error running darcs command '%s': %s" \
                    % (command, error))

        # go down as deep as possible in the tree to avoid accidental commits
        # TODO: explicitly commit files by name
        youngest_ancestor = os.path.commonprefix(files)
        return output + type(self)(youngest_ancestor).commit(message, author)
Beispiel #5
0
    def add(self, files, message=None, author=None):
        """Add and commit files."""
        command = ["bzr", "add"] + prepare_filelist(files)
        exitcode, output, error = run_command(command)
        if exitcode != 0:
            raise IOError("[BZR] add in '%s' failed: %s" \
                    % (self.location_abs, error))

        # go down as deep as possible in the tree to avoid accidental commits
        # TODO: explicitly commit files by name
        youngest_ancestor = os.path.commonprefix(files)
        return output + type(self)(youngest_ancestor).commit(message, author)
Beispiel #6
0
    def add(self, files, message=None, author=None):
        """Add and commit the new files."""
        files = prepare_filelist(files)
        command = ["hg", "add", "-q"] + files
        exitcode, output, error = run_command(command)
        if exitcode != 0:
            raise IOError("[Mercurial] Error running '%s': %s" %
                          (command, error))

        # go down as deep as possible in the tree to avoid accidental commits
        # TODO: explicitly commit files by name
        ancestor = youngest_ancestor(files)
        return output + type(self)(ancestor).commit(message, author)
Beispiel #7
0
    def add(self, files, message=None, author=None):
        """Add and commit files."""
        files = prepare_filelist(files)
        command = ["bzr", "add"] + files
        exitcode, output, error = run_command(command)
        if exitcode != 0:
            raise IOError("[BZR] add in '%s' failed: %s" %
                          (self.location_abs, error))

        # go down as deep as possible in the tree to avoid accidental commits
        # TODO: explicitly commit files by name
        ancestor = youngest_ancestor(files)
        return output + type(self)(ancestor).commit(message, author)
Beispiel #8
0
    def add(self, files, message=None, author=None):
        """Add and commit the new files."""
        files = prepare_filelist(files)
        command = ["svn", "add", "-q", "--non-interactive", "--parents"] + files
        exitcode, output, error = run_command(command)
        if exitcode != 0:
            raise IOError("[SVN] Error running SVN command '%s': %s" %
                          (command, error))

        # go down as deep as possible in the tree to avoid accidental commits
        # TODO: explicitly commit files by name
        ancestor = youngest_ancestor(files)
        return output + type(self)(ancestor).commit(message, author)
Beispiel #9
0
    def add(self, files, message=None, author=None):
        """Add and commit files."""
        files = prepare_filelist(files)
        command = ["darcs", "add", "--repodir", self.root_dir] + files
        exitcode, output, error = run_command(command)
        if exitcode != 0:
            raise IOError("[Darcs] Error running darcs command '%s': %s" \
                    % (command, error))

        # go down as deep as possible in the tree to avoid accidental commits
        # TODO: explicitly commit files by name
        ancestor = youngest_ancestor(files)
        return output + type(self)(ancestor).commit(message, author)
Beispiel #10
0
    def add(self, files, message=None, author=None):
        """Add and commit the new files."""
        working_dir = os.path.dirname(self.location_abs)
        command = ["cvs", "-Q", "add"]
        if message:
            command.extend(["-m", message])
        command.extend(prepare_filelist(files))
        exitcode, output, error = run_command(command, working_dir)
        # raise an error or return successfully - depending on the CVS command
        if exitcode != 0:
            raise IOError("[CVS] Error running CVS command '%s': %s" \
                    % (command, error))

        # go down as deep as possible in the tree to avoid accidental commits
        # TODO: explicitly commit files by name
        youngest_ancestor = os.path.commonprefix(files)
        return output + type(self)(youngest_ancestor).commit(message, author)
Beispiel #11
0
    def add(self, files, message=None, author=None):
        """Add and commit the new files."""
        working_dir = os.path.dirname(self.location_abs)
        command = ["cvs", "-Q", "add"]
        if message:
            command.extend(["-m", message])
        files = prepare_filelist(files)
        command.extend(files)
        exitcode, output, error = run_command(command, working_dir)
        # raise an error or return successfully - depending on the CVS command
        if exitcode != 0:
            raise IOError("[CVS] Error running CVS command '%s': %s" %
                          (command, error))

        # go down as deep as possible in the tree to avoid accidental commits
        # TODO: explicitly commit files by name
        ancestor = youngest_ancestor(files)
        return output + type(self)(ancestor).commit(message, author)