~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

(jelmer) Remove Branch.revision_history() and Branch.set_revision_history().
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3792
3792
            raise errors.UnexpectedSmartServerResponse(response)
3793
3793
        self._run_post_change_branch_tip_hooks(old_revno, old_revid)
3794
3794
 
3795
 
    @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4, 0)))
3796
 
    @needs_write_lock
3797
 
    def set_revision_history(self, rev_history):
3798
 
        """See Branch.set_revision_history."""
3799
 
        self._set_revision_history(rev_history)
3800
 
 
3801
 
    @needs_write_lock
3802
 
    def _set_revision_history(self, rev_history):
3803
 
        # Send just the tip revision of the history; the server will generate
3804
 
        # the full history from that.  If the revision doesn't exist in this
3805
 
        # branch, NoSuchRevision will be raised.
3806
 
        if rev_history == []:
3807
 
            rev_id = 'null:'
3808
 
        else:
3809
 
            rev_id = rev_history[-1]
3810
 
        self._set_last_revision(rev_id)
3811
 
        for hook in branch.Branch.hooks['set_rh']:
3812
 
            hook(self, rev_history)
3813
 
        self._cache_revision_history(rev_history)
3814
 
 
3815
3795
    def _get_parent_location(self):
3816
3796
        medium = self._client._medium
3817
3797
        if medium._is_remote_before((1, 13)):
3949
3929
            except errors.UnknownSmartMethod:
3950
3930
                medium._remember_remote_is_before((1, 6))
3951
3931
        self._clear_cached_state_of_remote_branch_only()
3952
 
        self._set_revision_history(self._lefthand_history(revision_id,
3953
 
            last_rev=last_rev,other_branch=other_branch))
 
3932
        graph = self.repository.get_graph()
 
3933
        (last_revno, last_revid) = self.last_revision_info()
 
3934
        known_revision_ids = [
 
3935
            (last_revid, last_revno),
 
3936
            (_mod_revision.NULL_REVISION, 0),
 
3937
            ]
 
3938
        if last_rev is not None:
 
3939
            if not graph.is_ancestor(last_rev, revision_id):
 
3940
                # our previous tip is not merged into stop_revision
 
3941
                raise errors.DivergedBranches(self, other_branch)
 
3942
        revno = graph.find_distance_to_null(revision_id, known_revision_ids)
 
3943
        self.set_last_revision_info(revno, revision_id)
3954
3944
 
3955
3945
    def set_push_location(self, location):
3956
3946
        self._set_config_location('push_location', location)