~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-03-04 14:42:39 UTC
  • mfrom: (4048.2.4 masterbranch-update)
  • Revision ID: pqm@pqm.ubuntu.com-20090304144239-ttukklew8lkxslgy
(Jelmer) Add Branch.import_last_revision_info().

Show diffs side-by-side

added added

removed removed

Lines of Context:
706
706
        return InterBranch.get(other, self).update_revisions(stop_revision,
707
707
            overwrite, graph)
708
708
 
 
709
    def import_last_revision_info(self, source_repo, revno, revid):
 
710
        """Set the last revision info, importing from another repo if necessary.
 
711
 
 
712
        This is used by the bound branch code to upload a revision to
 
713
        the master branch first before updating the tip of the local branch.
 
714
 
 
715
        :param source_repo: Source repository to optionally fetch from
 
716
        :param revno: Revision number of the new tip
 
717
        :param revid: Revision id of the new tip
 
718
        """
 
719
        if not self.repository.has_same_location(source_repo):
 
720
            self.repository.fetch(source_repo, revision_id=revid)
 
721
        self.set_last_revision_info(revno, revid)
 
722
 
709
723
    def revision_id_to_revno(self, revision_id):
710
724
        """Given a revision id, return its revno"""
711
725
        if _mod_revision.is_null(revision_id):