/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

merge

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
70
69
 
71
70
from cStringIO import StringIO
72
71
 
83
82
from bzrlib.trace import mutter, note, warning
84
83
from bzrlib.xml5 import serializer_v5
85
84
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,
89
88
        DEPRECATED_PARAMETER)
90
89
from bzrlib.workingtree import WorkingTree
91
90
 
92
91
 
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
 
 
105
92
class NullCommitReporter(object):
106
93
    """I report on progress of a commit."""
107
94
 
221
208
        mutter('preparing to commit')
222
209
 
223
210
        if deprecated_passed(branch):
224
 
            warnings.warn("Commit.commit (branch, ...): The branch parameter is "
 
211
            symbol_versioning.warn("Commit.commit (branch, ...): The branch parameter is "
225
212
                 "deprecated as of bzr 0.8. Please use working_tree= instead.",
226
213
                 DeprecationWarning, stacklevel=2)
227
214
            self.branch = branch
306
293
                raise PointlessCommit()
307
294
 
308
295
            self._emit_progress_update()
309
 
            # TODO: Now the new inventory is known, check for conflicts and prompt the 
310
 
            # user for a commit message.
 
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.
311
301
            self.builder.finish_inventory()
312
302
            self._emit_progress_update()
313
303
            self.rev_id = self.builder.commit(self.message)
500
490
        # in bugs like #46635.  Any reason not to use/enhance Tree.changes_from?
501
491
        # ADHB 11-07-2006
502
492
        mutter("Selecting files for commit with filter %s", self.specific_files)
503
 
        # at this point we dont copy the root entry:
504
493
        entries = self.work_inv.iter_entries()
505
 
        entries.next()
506
 
        self._emit_progress_update()
 
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()
507
501
        for path, new_ie in entries:
508
502
            self._emit_progress_update()
509
503
            file_id = new_ie.file_id