/breezy/trunk

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/trunk

« back to all changes in this revision

Viewing changes to breezy/git/branch.py

Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
649
649
    def _read_last_revision_info(self):
650
650
        last_revid = self.last_revision()
651
651
        graph = self.repository.get_graph()
652
 
        revno = graph.find_distance_to_null(last_revid,
653
 
                                            [(revision.NULL_REVISION, 0)])
 
652
        try:
 
653
            revno = graph.find_distance_to_null(
 
654
                last_revid, [(revision.NULL_REVISION, 0)])
 
655
        except errors.GhostRevisionsHaveNoRevno:
 
656
            revno = None
654
657
        return revno, last_revid
655
658
 
656
659
    def set_last_revision_info(self, revno, revision_id):
1106
1109
        fetch_tags = c.get('branch.fetch_tags')
1107
1110
 
1108
1111
        if stop_revision is None:
1109
 
            refs = interrepo.fetch(branches=[b"HEAD"], include_tags=fetch_tags)
 
1112
            refs = interrepo.fetch(branches=[self.source.ref], include_tags=fetch_tags)
1110
1113
            try:
1111
 
                head = refs[b"HEAD"]
 
1114
                head = refs[self.source.ref]
1112
1115
            except KeyError:
1113
1116
                stop_revision = revision.NULL_REVISION
1114
1117
            else: