~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: John Arbash Meinel
  • Date: 2006-08-14 16:16:53 UTC
  • mto: (1946.2.6 reduce-knit-churn)
  • mto: This revision was merged to the branch mainline in revision 1919.
  • Revision ID: john@arbash-meinel.com-20060814161653-54cdcdadcd4e9003
Remove bogus entry from BRANCH.TODO

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
import re
67
67
import sys
68
68
import time
 
69
import warnings
69
70
 
70
71
from cStringIO import StringIO
71
72
 
82
83
from bzrlib.trace import mutter, note, warning
83
84
from bzrlib.xml5 import serializer_v5
84
85
from bzrlib.inventory import Inventory, ROOT_ID, InventoryEntry
85
 
from bzrlib import symbol_versioning
86
86
from bzrlib.symbol_versioning import (deprecated_passed,
87
87
        deprecated_function,
 
88
        zero_seven,
88
89
        DEPRECATED_PARAMETER)
89
90
from bzrlib.workingtree import WorkingTree
90
91
 
91
92
 
 
93
@deprecated_function(zero_seven)
 
94
def commit(*args, **kwargs):
 
95
    """Commit a new revision to a branch.
 
96
 
 
97
    Function-style interface for convenience of old callers.
 
98
 
 
99
    New code should use the Commit class instead.
 
100
    """
 
101
    ## XXX: Remove this in favor of WorkingTree.commit?
 
102
    Commit().commit(*args, **kwargs)
 
103
 
 
104
 
92
105
class NullCommitReporter(object):
93
106
    """I report on progress of a commit."""
94
107
 
208
221
        mutter('preparing to commit')
209
222
 
210
223
        if deprecated_passed(branch):
211
 
            symbol_versioning.warn("Commit.commit (branch, ...): The branch parameter is "
 
224
            warnings.warn("Commit.commit (branch, ...): The branch parameter is "
212
225
                 "deprecated as of bzr 0.8. Please use working_tree= instead.",
213
226
                 DeprecationWarning, stacklevel=2)
214
227
            self.branch = branch
293
306
                raise PointlessCommit()
294
307
 
295
308
            self._emit_progress_update()
296
 
            # TODO: Now the new inventory is known, check for conflicts and
297
 
            # prompt the user for a commit message.
298
 
            # ADHB 2006-08-08: If this is done, populate_new_inv should not add
299
 
            # weave lines, because nothing should be recorded until it is known
300
 
            # that commit will succeed.
 
309
            # TODO: Now the new inventory is known, check for conflicts and prompt the 
 
310
            # user for a commit message.
301
311
            self.builder.finish_inventory()
302
312
            self._emit_progress_update()
303
313
            self.rev_id = self.builder.commit(self.message)
490
500
        # in bugs like #46635.  Any reason not to use/enhance Tree.changes_from?
491
501
        # ADHB 11-07-2006
492
502
        mutter("Selecting files for commit with filter %s", self.specific_files)
 
503
        # at this point we dont copy the root entry:
493
504
        entries = self.work_inv.iter_entries()
494
 
        if not self.builder.record_root_entry:
495
 
            symbol_versioning.warn('CommitBuilders should support recording'
496
 
                ' the root entry as of bzr 0.10.', DeprecationWarning, 
497
 
                stacklevel=1)
498
 
            self.builder.new_inventory.add(self.basis_inv.root.copy())
499
 
            entries.next()
500
 
            self._emit_progress_update()
 
505
        entries.next()
 
506
        self._emit_progress_update()
501
507
        for path, new_ie in entries:
502
508
            self._emit_progress_update()
503
509
            file_id = new_ie.file_id