/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

Updated from dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
128
128
class ReportCommitToLog(NullCommitReporter):
129
129
 
130
130
    def snapshot_change(self, change, path):
 
131
        if change == 'unchanged':
 
132
            return
131
133
        note("%s %s", change, path)
132
134
 
133
135
    def completed(self, revno, rev_id):
134
 
        note('committed r%d {%s}', revno, rev_id)
 
136
        note('Committed revision %d.', revno)
135
137
    
136
138
    def deleted(self, file_id):
137
139
        note('deleted %s', file_id)
179
181
               verbose=False,
180
182
               revprops=None,
181
183
               working_tree=None,
182
 
               local=False):
 
184
               local=False,
 
185
               reporter=None,
 
186
               config=None):
183
187
        """Commit working copy as a new revision.
184
188
 
185
189
        branch -- the deprecated branch to commit to. New callers should pass in 
227
231
        self.bound_branch = None
228
232
        self.local = local
229
233
        self.master_branch = None
 
234
        self.master_locked = False
230
235
        self.rev_id = rev_id
231
236
        self.specific_files = specific_files
232
237
        self.allow_pointless = allow_pointless
234
239
        if revprops is not None:
235
240
            self.revprops.update(revprops)
236
241
 
 
242
        if reporter is None and self.reporter is None:
 
243
            self.reporter = NullCommitReporter()
 
244
        elif reporter is not None:
 
245
            self.reporter = reporter
 
246
 
237
247
        self.work_tree.lock_write()
238
248
        try:
239
249
            # setup the bound branch variables as needed.
331
341
            self.work_tree.set_last_revision(self.rev_id, precursor)
332
342
            # now the work tree is up to date with the branch
333
343
            
334
 
            self.reporter.completed(self.branch.revno()+1, self.rev_id)
 
344
            self.reporter.completed(self.branch.revno(), self.rev_id)
335
345
            if self.config.post_commit() is not None:
336
346
                hooks = self.config.post_commit().split(' ')
337
347
                # this would be nicer with twisted.python.reflect.namedAny
384
394
        # so grab the lock
385
395
        self.bound_branch = self.branch
386
396
        self.master_branch.lock_write()
 
397
        self.master_locked = True
387
398
####        
388
399
####        # Check to see if we have any pending merges. If we do
389
400
####        # those need to be pushed into the master branch
402
413
        """
403
414
        if not self.bound_branch:
404
415
            return
405
 
        self.master_branch.unlock()
 
416
        if self.master_locked:
 
417
            self.master_branch.unlock()
406
418
 
407
419
    def _escape_commit_message(self):
408
420
        """Replace xml-incompatible control characters."""
492
504
        # mark-merge.  
493
505
        for path, ie in self.new_inv.iter_entries():
494
506
            previous_entries = ie.find_previous_heads(
495
 
                self.parent_invs, 
496
 
                self.weave_store.get_weave_or_empty(ie.file_id,
497
 
                    self.branch.get_transaction()))
 
507
                self.parent_invs,
 
508
                self.weave_store,
 
509
                self.branch.repository.get_transaction())
498
510
            if ie.revision is None:
499
511
                change = ie.snapshot(self.rev_id, path, previous_entries,
500
512
                                     self.work_tree, self.weave_store,