~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/remote.py

  • Committer: Martin Pool
  • Date: 2008-05-02 02:31:14 UTC
  • mfrom: (3399 +trunk)
  • mto: (3408.1.1 doc)
  • mto: This revision was merged to the branch mainline in revision 3409.
  • Revision ID: mbp@sourcefrog.net-20080502023114-y2gcg3w3jc770j9m
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
823
823
            # :- its because we're working with a deprecated server anyway, and
824
824
            # the user will almost certainly have seen a warning about the
825
825
            # server version already.
826
 
            return self.get_revision_graph()
 
826
            rg = self.get_revision_graph()
 
827
            # There is an api discrepency between get_parent_map and
 
828
            # get_revision_graph. Specifically, a "key:()" pair in
 
829
            # get_revision_graph just means a node has no parents. For
 
830
            # "get_parent_map" it means the node is a ghost. So fix up the
 
831
            # graph to correct this.
 
832
            #   https://bugs.launchpad.net/bzr/+bug/214894
 
833
            # There is one other "bug" which is that ghosts in
 
834
            # get_revision_graph() are not returned at all. But we won't worry
 
835
            # about that for now.
 
836
            for node_id, parent_ids in rg.iteritems():
 
837
                if parent_ids == ():
 
838
                    rg[node_id] = (NULL_REVISION,)
 
839
            rg[NULL_REVISION] = ()
 
840
            return rg
827
841
 
828
842
        keys = set(keys)
829
843
        if NULL_REVISION in keys:
859
873
        body = self._serialise_search_recipe(recipe)
860
874
        path = self.bzrdir._path_for_remote_call(self._client)
861
875
        for key in keys:
862
 
            assert type(key) is str
 
876
            if type(key) is not str:
 
877
                raise ValueError(
 
878
                    "key %r not a plain string" % (key,))
863
879
        verb = 'Repository.get_parent_map'
864
880
        args = (path,) + tuple(keys)
865
881
        try: