/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: Robert Collins
  • Date: 2006-03-04 21:52:37 UTC
  • mto: This revision was merged to the branch mainline in revision 1590.
  • Revision ID: robertc@robertcollins.net-20060304215237-b1ee1a8c3238a251
Commit revision data locally first for bound branch commits.

Show diffs side-by-side

added added

removed removed

Lines of Context:
307
307
                self.present_parents
308
308
                )
309
309
            self._make_revision()
310
 
            # revision is in the master branch now.
 
310
            # revision data is in the local branch now.
311
311
            
 
312
            # upload revision data to the master.
 
313
            # this will propogate merged revisions too if needed.
 
314
            if self.bound_branch:
 
315
                self.master_branch.repository.fetch(self.branch.repository,
 
316
                                                    revision_id=self.rev_id)
 
317
                # now the master has the revision data
 
318
                # 'commit' to the master first so a timeout here causes the local
 
319
                # branch to be out of date
 
320
                self.master_branch.append_revision(self.rev_id)
 
321
 
 
322
            # and now do the commit locally.
312
323
            self.branch.append_revision(self.rev_id)
313
 
            # now its in the master branch history.
314
 
 
315
 
            self._update_bound_branch()
316
 
            # now the local branch is up to date
317
324
 
318
325
            self.work_tree.set_pending_merges([])
319
326
            if len(self.parents):
372
379
        # so grab the lock
373
380
        self.bound_branch = self.branch
374
381
        self.master_branch.lock_write()
375
 
        self.branch = self.master_branch
376
 
        
377
 
        # Check to see if we have any pending merges. If we do
378
 
        # those need to be pushed into the master branch
379
 
        pending_merges = self.work_tree.pending_merges()
380
 
        if pending_merges:
381
 
            for revision_id in pending_merges:
382
 
                self.master_branch.repository.fetch(self.bound_branch.repository,
383
 
                                                    revision_id=revision_id)
 
382
####        
 
383
####        # Check to see if we have any pending merges. If we do
 
384
####        # those need to be pushed into the master branch
 
385
####        pending_merges = self.work_tree.pending_merges()
 
386
####        if pending_merges:
 
387
####            for revision_id in pending_merges:
 
388
####                self.master_branch.repository.fetch(self.bound_branch.repository,
 
389
####                                                    revision_id=revision_id)
384
390
 
385
391
    def _cleanup_bound_branch(self):
386
392
        """Executed at the end of a try/finally to cleanup a bound branch.
391
397
        """
392
398
        if not self.bound_branch:
393
399
            return
394
 
        self.branch = self.bound_branch
395
400
        self.master_branch.unlock()
396
401
 
397
 
    def _update_bound_branch(self):
398
 
        """Update the local bound branch, after commit.
399
 
 
400
 
        This only runs if the commit to the master branch succeeds.
401
 
        """
402
 
        if not self.bound_branch:
403
 
            return
404
 
        # We always want the local branch to look like the remote one
405
 
        # TODO: jam 20051231 We might want overwrite=True here, but
406
 
        #       the local branch should be a prefix of master anyway
407
 
        self.bound_branch.pull(self.master_branch)
408
 
 
409
 
        # TODO: jam 20051231 At this point we probably 
410
 
        #       want to merge any changes into master branch's
411
 
        #       working tree.
412
 
        
413
402
    def _escape_commit_message(self):
414
403
        """Replace xml-incompatible control characters."""
415
404
        # Python strings can include characters that can't be