示例#1
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)
示例#2
0
文件: hg.py 项目: zbj00/translate
    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)
示例#3
0
文件: hg.py 项目: ANKIT-KS/fjord
    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)
示例#4
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)
示例#5
0
文件: bzr.py 项目: surli/translate
    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)
示例#6
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)
示例#7
0
文件: cvs.py 项目: surli/translate
    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)
示例#8
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)