~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Jelmer Vernooij
  • Date: 2011-04-11 00:18:12 UTC
  • mto: (5777.7.2 bound-commit-lossy)
  • mto: This revision was merged to the branch mainline in revision 5791.
  • Revision ID: jelmer@samba.org-20110411001812-4z2a44e1z7cm3fdw
Add --lossy option to 'bzr commit'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
 
94
94
    def __init__(self, repository, parents, config, timestamp=None,
95
95
                 timezone=None, committer=None, revprops=None,
96
 
                 revision_id=None):
 
96
                 revision_id=None, lossy=False):
97
97
        """Initiate a CommitBuilder.
98
98
 
99
99
        :param repository: Repository to commit to.
103
103
        :param committer: Optional committer to set for commit.
104
104
        :param revprops: Optional dictionary of revision properties.
105
105
        :param revision_id: Optional revision id.
 
106
        :param lossy: Whether to discard data that can not be natively
 
107
            represented, when pushing to a foreign VCS 
106
108
        """
107
109
        self._config = config
108
110
 
1782
1784
 
1783
1785
    def get_commit_builder(self, branch, parents, config, timestamp=None,
1784
1786
                           timezone=None, committer=None, revprops=None,
1785
 
                           revision_id=None):
 
1787
                           revision_id=None, lossy=False):
1786
1788
        """Obtain a CommitBuilder for this repository.
1787
1789
 
1788
1790
        :param branch: Branch to commit to.
1793
1795
        :param committer: Optional committer to set for commit.
1794
1796
        :param revprops: Optional dictionary of revision properties.
1795
1797
        :param revision_id: Optional revision id.
 
1798
        :param lossy: Whether to discard data that can not be natively
 
1799
            represented, when pushing to a foreign VCS
1796
1800
        """
1797
1801
        if self._fallback_repositories and not self._format.supports_chks:
1798
1802
            raise errors.BzrError("Cannot commit directly to a stacked branch"
1799
1803
                " in pre-2a formats. See "
1800
1804
                "https://bugs.launchpad.net/bzr/+bug/375013 for details.")
1801
1805
        result = self._commit_builder_class(self, parents, config,
1802
 
            timestamp, timezone, committer, revprops, revision_id)
 
1806
            timestamp, timezone, committer, revprops, revision_id,
 
1807
            lossy)
1803
1808
        self.start_write_group()
1804
1809
        return result
1805
1810