'Process a CommitCommand.'

def commit_handler(self, cmd):

    commit = Commit()
    if (cmd.author is not None):
        author = cmd.author
    else:
        author = cmd.committer
    (author_name, author_email, author_timestamp, author_timezone) = author
    (committer_name, committer_email, commit_timestamp, commit_timezone) = cmd.committer
    commit.author = (((author_name + '    <') + author_email) + '>')
    commit.author_timezone = author_timezone
    commit.author_time = int(author_timestamp)
    commit.committer = (((committer_name + '    <') + committer_email) + '>')
    commit.commit_timezone = commit_timezone
    commit.commit_time = int(commit_timestamp)
    commit.message = cmd.message
    commit.parents = []
    if cmd.from_:
        self._reset_base(cmd.from_)
    for filecmd in cmd.iter_files():
        if (filecmd.name == 'filemodify'):
            if (filecmd.data is not None):
                blob = Blob.from_string(filecmd.data)
                self.repo.object_store.add(blob)
                blob_id = blob.id
            else:
                assert filecmd.dataref.startswith(':'), ('non-marker    refs    not    supported    yet    (%r)' % filecmd.dataref)
                blob_id = self.markers[filecmd.dataref[1:]]
            self._contents[filecmd.path] = (filecmd.mode, blob_id)
        elif (filecmd.name == 'filedelete'):
            del self._contents[filecmd.path]
        elif (filecmd.name == 'filecopy'):
            self._contents[filecmd.dest_path] = self._contents[filecmd.src_path]
        elif (filecmd.name == 'filerename'):
            self._contents[filecmd.new_path] = self._contents[filecmd.old_path]
            del self._contents[filecmd.old_path]
        elif (filecmd.name == 'filedeleteall'):
            self._contents = {}
        else:
            raise Exception(('Command    %s    not    supported' % filecmd.name))
    commit.tree = commit_tree(self.repo.object_store, ((path, hexsha, mode) for (path, (mode, hexsha)) in self._contents.items()))
    if (self.last_commit != ZERO_SHA):
        commit.parents.append(self.last_commit)
    for merge in cmd.merges:
        if merge.startswith(':'):
            merge = self.markers[merge[1:]]
        commit.parents.append(merge)
    self.repo.object_store.add_object(commit)
    self.repo[cmd.ref] = commit.id
    self.last_commit = commit.id
    if cmd.mark:
        self.markers[cmd.mark] = commit.id
