/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Michael Ellerman
  • Date: 2005-10-17 11:59:18 UTC
  • mto: (1185.16.126)
  • mto: This revision was merged to the branch mainline in revision 1488.
  • Revision ID: michael@ellerman.id.au-20051017115918-be3eadbee7ffa6fb
Implement strict commits with --strict flag.

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
import bzrlib.config
76
76
from bzrlib.errors import (BzrError, PointlessCommit,
77
77
                           HistoryMissing,
78
 
                           ConflictsInTree
 
78
                           ConflictsInTree,
 
79
                           StrictCommitFailed
79
80
                           )
80
81
from bzrlib.revision import Revision
81
82
from bzrlib.trace import mutter, note, warning
160
161
               specific_files=None,
161
162
               rev_id=None,
162
163
               allow_pointless=True,
 
164
               strict=False,
163
165
               verbose=False,
164
166
               revprops=None):
165
167
        """Commit working copy as a new revision.
178
180
        allow_pointless -- If true (default), commit even if nothing
179
181
            has changed and no merges are recorded.
180
182
 
 
183
        strict -- If true, don't allow a commit if the working tree
 
184
            contains unknown files.
 
185
 
181
186
        revprops -- Properties for new revision
182
187
        """
183
188
        mutter('preparing to commit')
189
194
        self.allow_pointless = allow_pointless
190
195
        self.revprops = revprops
191
196
 
 
197
        if strict and branch.unknowns():
 
198
            raise StrictCommitFailed()
 
199
 
192
200
        if timestamp is None:
193
201
            self.timestamp = time.time()
194
202
        else: