~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Jelmer Vernooij
  • Date: 2006-06-07 18:12:52 UTC
  • mto: This revision was merged to the branch mainline in revision 1753.
  • Revision ID: jelmer@samba.org-20060607181252-3bd3b1113e4cbad6
Move make_revision() to commit builder.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
from bzrlib.lockdir import LockDir
35
35
from bzrlib.osutils import (safe_unicode, rand_bytes, compact_date, 
36
36
                            local_time_offset)
37
 
from bzrlib.revision import NULL_REVISION
 
37
from bzrlib.revision import NULL_REVISION, Revision
38
38
from bzrlib.store.versioned import VersionedFileStore, WeaveStore
39
39
from bzrlib.store.text import TextStore
40
40
from bzrlib.symbol_versioning import *
1918
1918
 
1919
1919
        self._generate_revision_if_needed()
1920
1920
 
 
1921
    def commit(self):
 
1922
        """Make the actual commit.
 
1923
 
 
1924
        :return: The revision id of the recorded revision.
 
1925
        """
 
1926
        rev = Revision(timestamp=self._timestamp,
 
1927
                       timezone=self._timezone,
 
1928
                       committer=self._committer,
 
1929
                       message=self.message,
 
1930
                       inventory_sha1=self.inv_sha1,
 
1931
                       revision_id=self._new_revision_id,
 
1932
                       properties=self._revprops)
 
1933
        rev.parent_ids = self.parents
 
1934
        self.repository.add_revision(self._new_revision_id, rev, 
 
1935
            self.new_inventory, self._config)
 
1936
        return self._new_revision_id
 
1937
 
1921
1938
    def finish_inventory(self):
1922
1939
        """Tell the builder that the inventory is finished.
1923
 
        
1924
 
        :return: SHA1 of the encoded inventory.
1925
1940
        """
1926
1941
        self.new_inventory.revision = self._new_revision_id
1927
 
        return self.repository.add_inventory(
 
1942
        self.inv_sha1 = self.repository.add_inventory(
1928
1943
            self._new_revision_id,
1929
1944
            self.new_inventory,
1930
1945
            self.parents