          self.format = kwargs.pop('format', None)
          lookup_field = kwargs.pop('lookup_field', None)
          self.lookup_field = lookup_field or self.lookup_field
  
          # These are deprecated
          if 'pk_url_kwarg' in kwargs:
              msg = 'pk_url_kwarg is deprecated. Use lookup_field instead.'
              warnings.warn(msg, DeprecationWarning, stacklevel=2)
          if 'slug_url_kwarg' in kwargs:
              msg = 'slug_url_kwarg is deprecated. Use lookup_field instead.'
              warnings.warn(msg, DeprecationWarning, stacklevel=2)
          if 'slug_field' in kwargs:
              msg = 'slug_field is deprecated. Use lookup_field instead.'
              warnings.warn(msg, DeprecationWarning, stacklevel=2)
  
          self.slug_field = kwargs.pop('slug_field', self.slug_field)
          default_slug_kwarg = self.slug_url_kwarg or self.slug_field
          self.pk_url_kwarg = kwargs.pop('pk_url_kwarg', self.pk_url_kwarg)
          self.slug_url_kwarg = kwargs.pop('slug_url_kwarg', default_slug_kwarg)
  
          super(HyperlinkedIdentityField, self).__init__(*args, **kwargs)
  
      def field_to_native(self, obj, field_name):
          request = self.context.get('request', None)
          format = self.context.get('format', None)
 
</s> remove         # These are deprecated
        if 'pk_url_kwarg' in kwargs:
            msg = 'pk_url_kwarg is deprecated. Use lookup_field instead.'
            warnings.warn(msg, DeprecationWarning, stacklevel=2)
        if 'slug_url_kwarg' in kwargs:
            msg = 'slug_url_kwarg is deprecated. Use lookup_field instead.'
            warnings.warn(msg, DeprecationWarning, stacklevel=2)
        if 'slug_field' in kwargs:
            msg = 'slug_field is deprecated. Use lookup_field instead.'
            warnings.warn(msg, DeprecationWarning, stacklevel=2)

        self.pk_url_kwarg = kwargs.pop('pk_url_kwarg', self.pk_url_kwarg)
        self.slug_field = kwargs.pop('slug_field', self.slug_field)
        default_slug_kwarg = self.slug_url_kwarg or self.slug_field
        self.slug_url_kwarg = kwargs.pop('slug_url_kwarg', default_slug_kwarg)

 </s> add  </s> remove         try:
            return reverse(view_name, kwargs=kwargs, request=request, format=format)
        except NoReverseMatch:
            pass

        if self.pk_url_kwarg != 'pk':
            # Only try pk if it has been explicitly set.
            # Otherwise, the default `lookup_field = 'pk'` has us covered.
            pk = obj.pk
            kwargs = {self.pk_url_kwarg: pk}
            try:
                return reverse(view_name, kwargs=kwargs, request=request, format=format)
            except NoReverseMatch:
                pass

        slug = getattr(obj, self.slug_field, None)
        if slug is not None:
            # Only try slug if it corresponds to an attribute on the object.
            kwargs = {self.slug_url_kwarg: slug}
            try:
                ret = reverse(view_name, kwargs=kwargs, request=request, format=format)
                if self.slug_field == 'slug' and self.slug_url_kwarg == 'slug':
                    # If the lookup succeeds using the default slug params,
                    # then `slug_field` is being used implicitly, and we
                    # we need to warn about the pending deprecation.
                    msg = 'Implicit slug field hyperlinked fields are deprecated.' \
                          'You should set `lookup_field=slug` on the HyperlinkedRelatedField.'
                    warnings.warn(msg, DeprecationWarning, stacklevel=2)
                return ret
            except NoReverseMatch:
                pass

        raise NoReverseMatch()
 </s> add         return reverse(view_name, kwargs=kwargs, request=request, format=format) </s> remove     # These are all deprecated
    pk_url_kwarg = 'pk'
    slug_field = 'slug'
    slug_url_kwarg = None  # Defaults to same as `slug_field` unless overridden

 </s> add  </s> remove         if lookup is not None:
            filter_kwargs = {self.lookup_field: lookup}
        elif pk is not None and self.lookup_field == 'pk':
            warnings.warn(
                'The `pk_url_kwarg` attribute is deprecated. '
                'Use the `lookup_field` attribute instead',
                DeprecationWarning
            )
            filter_kwargs = {'pk': pk}
        elif slug is not None and self.lookup_field == 'pk':
            warnings.warn(
                'The `slug_url_kwarg` attribute is deprecated. '
                'Use the `lookup_field` attribute instead',
                DeprecationWarning
            )
            filter_kwargs = {self.slug_field: slug}
        else:
 </s> add         if lookup is None: </s> remove         lookup = self.kwargs.get(lookup_url_kwarg, None)
        pk = self.kwargs.get(self.pk_url_kwarg, None)
        slug = self.kwargs.get(self.slug_url_kwarg, None)
        slug_field = slug and self.slug_field or None

        if lookup:
            setattr(obj, self.lookup_field, lookup)

        if pk:
            setattr(obj, 'pk', pk)
 </s> add         lookup_value = self.kwargs[lookup_url_kwarg]
          self.format = kwargs.pop('format', None)
          lookup_field = kwargs.pop('lookup_field', None)
          self.lookup_field = lookup_field or self.lookup_field
  
















          super(HyperlinkedIdentityField, self).__init__(*args, **kwargs)
  
      def field_to_native(self, obj, field_name):
          request = self.context.get('request', None)
          format = self.context.get('format', None)
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Remove `pk_url_field`, `slug_url_field`, `slug_field`.

Closes #1773. 
rest_framework/relations.py