~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Robert Collins
  • Date: 2005-10-18 13:11:57 UTC
  • mfrom: (1185.16.72) (0.2.1)
  • Revision ID: robertc@robertcollins.net-20051018131157-76a9970aa78e927e
Merged Martin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
# merges from, then it should still be reported as newly added
57
57
# relative to the basis revision.
58
58
 
 
59
# TODO: Do checks that the tree can be committed *before* running the 
 
60
# editor; this should include checks for a pointless commit and for 
 
61
# unknown or missing files.
 
62
 
 
63
# TODO: If commit fails, leave the message in a file somewhere.
 
64
 
59
65
 
60
66
import os
61
67
import re
75
81
import bzrlib.config
76
82
from bzrlib.errors import (BzrError, PointlessCommit,
77
83
                           HistoryMissing,
78
 
                           ConflictsInTree
 
84
                           ConflictsInTree,
 
85
                           StrictCommitFailed
79
86
                           )
80
87
import bzrlib.gpg as gpg
81
88
from bzrlib.revision import Revision
166
173
               specific_files=None,
167
174
               rev_id=None,
168
175
               allow_pointless=True,
 
176
               strict=False,
169
177
               verbose=False,
170
178
               revprops=None):
171
179
        """Commit working copy as a new revision.
184
192
        allow_pointless -- If true (default), commit even if nothing
185
193
            has changed and no merges are recorded.
186
194
 
 
195
        strict -- If true, don't allow a commit if the working tree
 
196
            contains unknown files.
 
197
 
187
198
        revprops -- Properties for new revision
188
199
        """
189
200
        mutter('preparing to commit')
195
206
        self.allow_pointless = allow_pointless
196
207
        self.revprops = revprops
197
208
 
 
209
        if strict and branch.unknowns():
 
210
            raise StrictCommitFailed()
 
211
 
198
212
        if timestamp is None:
199
213
            self.timestamp = time.time()
200
214
        else: