~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Jelmer Vernooij
  • Date: 2011-04-18 23:21:01 UTC
  • mfrom: (5799 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5800.
  • Revision ID: jelmer@samba.org-20110418232101-utgj6599ow9ny9nh
merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1028
1028
            self.repository.fetch(source_repo, revision_id=revid)
1029
1029
        self.set_last_revision_info(revno, revid)
1030
1030
 
1031
 
    def import_last_revision_info_and_tags(self, source, revno, revid):
 
1031
    def import_last_revision_info_and_tags(self, source, revno, revid,
 
1032
                                           lossy=False):
1032
1033
        """Set the last revision info, importing from another repo if necessary.
1033
1034
 
1034
1035
        This is used by the bound branch code to upload a revision to
1038
1039
        :param source: Source branch to optionally fetch from
1039
1040
        :param revno: Revision number of the new tip
1040
1041
        :param revid: Revision id of the new tip
 
1042
        :param lossy: Whether to discard metadata that can not be
 
1043
            natively represented
 
1044
        :return: Tuple with the new revision number and revision id
 
1045
            (should only be different from the arguments when lossy=True)
1041
1046
        """
1042
1047
        if not self.repository.has_same_location(source.repository):
1043
1048
            try:
1049
1054
                if_present_ids=tags_to_fetch).execute()
1050
1055
            self.repository.fetch(source.repository, fetch_spec=fetch_spec)
1051
1056
        self.set_last_revision_info(revno, revid)
 
1057
        return (revno, revid)
1052
1058
 
1053
1059
    def revision_id_to_revno(self, revision_id):
1054
1060
        """Given a revision id, return its revno"""