~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Robey Pointer
  • Date: 2006-07-01 19:03:33 UTC
  • mfrom: (1829 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1830.
  • Revision ID: robey@lag.net-20060701190333-f58465aec4bd3412
merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
import re
68
68
import sys
69
69
import time
70
 
import pdb
 
70
import warnings
71
71
 
72
72
from cStringIO import StringIO
73
73
 
75
75
import bzrlib.config
76
76
import bzrlib.errors as errors
77
77
from bzrlib.errors import (BzrError, PointlessCommit,
78
 
                           HistoryMissing,
79
78
                           ConflictsInTree,
80
79
                           StrictCommitFailed
81
80
                           )
86
85
from bzrlib.trace import mutter, note, warning
87
86
from bzrlib.xml5 import serializer_v5
88
87
from bzrlib.inventory import Inventory, ROOT_ID, InventoryEntry
89
 
from bzrlib.symbol_versioning import *
 
88
from bzrlib.symbol_versioning import (deprecated_passed,
 
89
        deprecated_function,
 
90
        zero_seven,
 
91
        DEPRECATED_PARAMETER)
90
92
from bzrlib.workingtree import WorkingTree
91
93
 
92
94
 
221
223
        mutter('preparing to commit')
222
224
 
223
225
        if deprecated_passed(branch):
224
 
            warn("Commit.commit (branch, ...): The branch parameter is "
 
226
            warnings.warn("Commit.commit (branch, ...): The branch parameter is "
225
227
                 "deprecated as of bzr 0.8. Please use working_tree= instead.",
226
228
                 DeprecationWarning, stacklevel=2)
227
229
            self.branch = branch
269
271
                    raise StrictCommitFailed()
270
272
                   
271
273
            if self.config is None:
272
 
                self.config = bzrlib.config.BranchConfig(self.branch)
 
274
                self.config = self.branch.get_config()
273
275
      
274
276
            if isinstance(message, str):
275
277
                message = message.decode(bzrlib.user_encoding)
457
459
            if not self.branch.repository.has_revision(parent_id):
458
460
                if parent_id == self.branch.last_revision():
459
461
                    warning("parent is missing %r", parent_id)
460
 
                    raise HistoryMissing(self.branch, 'revision', parent_id)
461
 
                else:
462
 
                    mutter("commit will ghost revision %r", parent_id)
 
462
                    raise BzrCheckError("branch %s is missing revision {%s}"
 
463
                            % (self.branch, parent_id))
463
464
            
464
465
    def _remove_deleted(self):
465
466
        """Remove deleted files from the working inventories.