/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: John Arbash Meinel
  • Date: 2006-06-18 18:56:23 UTC
  • mfrom: (1790 +trunk)
  • mto: (1711.7.2 win32)
  • mto: This revision was merged to the branch mainline in revision 1796.
  • Revision ID: john@arbash-meinel.com-20060618185623-854bdd0fbc4f230f
[merge] bzr.dev 1790

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
 
99
99
    New code should use the Commit class instead.
100
100
    """
101
 
    ## XXX: Remove this in favor of Branch.commit?
 
101
    ## XXX: Remove this in favor of WorkingTree.commit?
102
102
    Commit().commit(*args, **kwargs)
103
103
 
104
104
 
234
234
        if message is None:
235
235
            raise BzrError("The message keyword parameter is required for commit().")
236
236
 
237
 
        self.weave_store = self.branch.repository.weave_store
238
237
        self.bound_branch = None
239
238
        self.local = local
240
239
        self.master_branch = None
316
315
            # revision data is in the local branch now.
317
316
            
318
317
            # upload revision data to the master.
319
 
            # this will propogate merged revisions too if needed.
 
318
            # this will propagate merged revisions too if needed.
320
319
            if self.bound_branch:
321
320
                self.master_branch.repository.fetch(self.branch.repository,
322
321
                                                    revision_id=self.rev_id)
344
343
            self._emit_progress_update()
345
344
        finally:
346
345
            self._cleanup()
 
346
        return self.rev_id
347
347
 
348
348
    def _check_bound_branch(self):
349
349
        """Check to see if the local branch is bound.
386
386
        self.bound_branch = self.branch
387
387
        self.master_branch.lock_write()
388
388
        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
389
 
398
390
    def _cleanup(self):
399
391
        """Cleanup any open locks, progress bars etc."""
411
403
            except Exception, e:
412
404
                found_exception = e
413
405
        if found_exception is not None: 
414
 
            # dont do a plan raise, because the last exception may have been
 
406
            # don't do a plan raise, because the last exception may have been
415
407
            # trashed, e is our sure-to-work exception even though it loses the
416
408
            # full traceback. XXX: RBC 20060421 perhaps we could check the
417
409
            # exc_info and if its the same one do a plain raise otherwise 
452
444
        """Record the parents of a merge for merge detection."""
453
445
        # TODO: Make sure that this list doesn't contain duplicate 
454
446
        # entries and the order is preserved when doing this.
455
 
        pending_merges = self.work_tree.pending_merges()
456
 
        self.parents = []
 
447
        self.parents = self.work_tree.get_parent_ids()
457
448
        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
449
        for revision in self.parents:
463
450
            if self.branch.repository.has_revision(revision):
464
451
                inventory = self.branch.repository.get_inventory(revision)
532
519
 
533
520
            self.builder.record_entry_contents(ie, self.parent_invs, 
534
521
                path, self.work_tree)
535
 
            # describe the nature of the change that has occured relative to
 
522
            # describe the nature of the change that has occurred relative to
536
523
            # the basis inventory.
537
524
            if (self.basis_inv.has_id(ie.file_id)):
538
525
                basis_ie = self.basis_inv[ie.file_id]