~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: John Arbash Meinel
  • Date: 2006-07-12 18:05:01 UTC
  • mto: This revision was merged to the branch mainline in revision 1871.
  • Revision ID: john@arbash-meinel.com-20060712180501-1a638c0c5b1e7646
Updated WorkingTree to use the new user-level ignores.

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)
386
388
        self.bound_branch = self.branch
387
389
        self.master_branch.lock_write()
388
390
        self.master_locked = True
389
 
####        
390
 
####        # Check to see if we have any pending merges. If we do
391
 
####        # those need to be pushed into the master branch
392
 
####        pending_merges = self.work_tree.pending_merges()
393
 
####        if pending_merges:
394
 
####            for revision_id in pending_merges:
395
 
####                self.master_branch.repository.fetch(self.bound_branch.repository,
396
 
####                                                    revision_id=revision_id)
397
391
 
398
392
    def _cleanup(self):
399
393
        """Cleanup any open locks, progress bars etc."""
452
446
        """Record the parents of a merge for merge detection."""
453
447
        # TODO: Make sure that this list doesn't contain duplicate 
454
448
        # entries and the order is preserved when doing this.
455
 
        pending_merges = self.work_tree.pending_merges()
456
 
        self.parents = []
 
449
        self.parents = self.work_tree.get_parent_ids()
457
450
        self.parent_invs = []
458
 
        precursor_id = self.branch.last_revision()
459
 
        if precursor_id:
460
 
            self.parents.append(precursor_id)
461
 
        self.parents += pending_merges
462
451
        for revision in self.parents:
463
452
            if self.branch.repository.has_revision(revision):
464
453
                inventory = self.branch.repository.get_inventory(revision)
470
459
            if not self.branch.repository.has_revision(parent_id):
471
460
                if parent_id == self.branch.last_revision():
472
461
                    warning("parent is missing %r", parent_id)
473
 
                    raise HistoryMissing(self.branch, 'revision', parent_id)
474
 
                else:
475
 
                    mutter("commit will ghost revision %r", parent_id)
 
462
                    raise BzrCheckError("branch %s is missing revision {%s}"
 
463
                            % (self.branch, parent_id))
476
464
            
477
465
    def _remove_deleted(self):
478
466
        """Remove deleted files from the working inventories.