~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Aaron Bentley
  • Date: 2010-04-23 19:46:24 UTC
  • mto: This revision was merged to the branch mainline in revision 5221.
  • Revision ID: aaron@aaronbentley.com-20100423194624-9y4oia3pzb19505o
TreeTransform supports normal commit parameters and includes branch nick.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    annotate,
26
26
    bencode,
27
27
    bzrdir,
 
28
    commit,
28
29
    delta,
29
30
    errors,
30
31
    inventory,
927
928
        """
928
929
        return _PreviewTree(self)
929
930
 
930
 
    def commit(self, branch, message, merge_parents=None, strict=False):
 
931
    def commit(self, branch, message, merge_parents=None, strict=False,
 
932
               timestamp=None, timezone=None, committer=None, authors=None,
 
933
               revprops=None, revision_id=None):
931
934
        """Commit the result of this TreeTransform to a branch.
932
935
 
933
936
        :param branch: The branch to commit to.
934
937
        :param message: The message to attach to the commit.
935
 
        :param merge_parents: Additional parents specified by pending merges.
 
938
        :param merge_parents: Additional parent revision-ids specified by
 
939
            pending merges.
 
940
        :param strict: If True, abort the commit if there are unversioned
 
941
            files.
 
942
        :param timestamp: if not None, seconds-since-epoch for the time and
 
943
            date.  (May be a float.)
 
944
        :param timezone: Optional timezone for timestamp, as an offset in
 
945
            seconds.
 
946
        :param committer: Optional committer in email-id format.
 
947
            (e.g. "J Random Hacker <jrandom@example.com>")
 
948
        :param authors: Optional list of authors in email-id format.
 
949
        :param revprops: Optional dictionary of revision properties.
 
950
        :param revision_id: Optional revision id.  (Specifying a revision-id
 
951
            may reduce performance for some non-native formats.)
936
952
        :return: The revision_id of the revision committed.
937
953
        """
938
954
        self._check_malformed()
955
971
        if self._tree.get_revision_id() != last_rev_id:
956
972
            raise ValueError('TreeTransform not based on branch basis: %s' %
957
973
                             self._tree.get_revision_id())
958
 
        builder = branch.get_commit_builder(parent_ids)
 
974
        revprops = commit.Commit.update_revprops(revprops, branch, authors)
 
975
        builder = branch.get_commit_builder(parent_ids,
 
976
                                            timestamp=timestamp,
 
977
                                            committer=committer,
 
978
                                            revprops=revprops,
 
979
                                            revision_id=revision_id)
959
980
        preview = self.get_preview_tree()
960
981
        list(builder.record_iter_changes(preview, last_rev_id,
961
982
                                         self.iter_changes()))