/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

  • Committer: Martin Pool
  • Date: 2006-03-20 22:32:41 UTC
  • mto: This revision was merged to the branch mainline in revision 1621.
  • Revision ID: mbp@sourcefrog.net-20060320223241-95ba66352fd77026
Cleanup and document some check code

Show diffs side-by-side

added added

removed removed

Lines of Context:
231
231
        self.bound_branch = None
232
232
        self.local = local
233
233
        self.master_branch = None
234
 
        self.master_locked = False
235
234
        self.rev_id = rev_id
236
235
        self.specific_files = specific_files
237
236
        self.allow_pointless = allow_pointless
309
308
                    or self.new_inv != self.basis_inv):
310
309
                raise PointlessCommit()
311
310
 
312
 
            if len(self.work_tree.conflicts())>0:
 
311
            if len(list(self.work_tree.iter_conflicts()))>0:
313
312
                raise ConflictsInTree
314
313
 
315
314
            self.inv_sha1 = self.branch.repository.add_inventory(
334
333
            self.branch.append_revision(self.rev_id)
335
334
 
336
335
            self.work_tree.set_pending_merges([])
337
 
            self.work_tree.set_last_revision(self.rev_id)
 
336
            if len(self.parents):
 
337
                precursor = self.parents[0]
 
338
            else:
 
339
                precursor = None
 
340
            self.work_tree.set_last_revision(self.rev_id, precursor)
338
341
            # now the work tree is up to date with the branch
339
342
            
340
343
            self.reporter.completed(self.branch.revno(), self.rev_id)
390
393
        # so grab the lock
391
394
        self.bound_branch = self.branch
392
395
        self.master_branch.lock_write()
393
 
        self.master_locked = True
394
396
####        
395
397
####        # Check to see if we have any pending merges. If we do
396
398
####        # those need to be pushed into the master branch
409
411
        """
410
412
        if not self.bound_branch:
411
413
            return
412
 
        if self.master_locked:
413
 
            self.master_branch.unlock()
 
414
        self.master_branch.unlock()
414
415
 
415
416
    def _escape_commit_message(self):
416
417
        """Replace xml-incompatible control characters."""
522
523
        revision set to their prior value.
523
524
        """
524
525
        mutter("Selecting files for commit with filter %s", self.specific_files)
525
 
        self.new_inv = Inventory(revision_id=self.rev_id)
 
526
        self.new_inv = Inventory()
526
527
        for path, new_ie in self.work_inv.iter_entries():
527
528
            file_id = new_ie.file_id
528
529
            mutter('check %s {%s}', path, new_ie.file_id)