Remove deprecated code from Review Board.

Review Request #12885 — Created March 14, 2023 and submitted — Latest diff uploaded

Information

Review Board
release-6.x

Reviewers

This change removes all RemovedInReviewBoard60 things from our codebase.
The only complicated part of this is that the mercurial diff parsers
were still using the old get_orig_commit_id method, so those have been
updated to set the data correctly on the ParsedDiffChange.

This also makes one small fix to the filediff API resource to handle a
deprecation removal in Djblets.

Ran unit tests.

Diff Revision 6 (Latest)

orig
1
2
3
4
5
6

Commits

First Last Summary ID Author
Remove deprecated code from Review Board.
This change removes all RemovedInReviewBoard60 things from our codebase. The only complicated part of this is that the mercurial diff parsers were still using the old `get_orig_commit_id` method, so those have been updated to set the data correctly on the `ParsedDiffChange`. This also makes one small fix to the filediff API resource to handle a deprecation removal in Djblets. Testing Done: Ran unit tests.
525fa710400876f37a63e803e137a56aa7fefad0 David Trowbridge
reviewboard/deprecation.py
Revision a4b0a9d38774fc77e97b09a9f4227e83b5e388d1 New Change
1
"""Internal support for handling deprecations in Review Board.
1
"""Internal support for handling deprecations in Review Board.
2

    
   
2

   
3
The version-specific objects in this module are not considered stable between
3
The version-specific objects in this module are not considered stable between
4
releases, and may be removed at any point. The base objects are considered
4
releases, and may be removed at any point. The base objects are considered
5
stable.
5
stable.
6
"""
6
"""
7

    
   
7

   
8
import warnings
8
import warnings
9

    
   
9

   

    
   
10
from djblets.deprecation import BaseRemovedInProductVersionWarning
10

    
   
11

   
11
class BaseRemovedInReviewBoardVersionWarning(DeprecationWarning):
12

   

    
   
13
class BaseRemovedInReviewBoardVersionWarning(

    
   
14
    BaseRemovedInProductVersionWarning):
12
    """Base class for a Review Board deprecation warning.
15
    """Base class for a Review Board deprecation warning.
13

    
   
16

   
14
    All version-specific deprecation warnings inherit from this, allowing
17
    All version-specific deprecation warnings inherit from this, allowing
15
    callers to check for Review Board deprecations without being tied to a
18
    callers to check for Review Board deprecations without being tied to a
16
    specific version.
19
    specific version.
17
    """
20
    """
18

    
   
21

   
19
    @classmethod
22
    product = 'Review Board'
20
    def warn(cls, message, stacklevel=2):

   
21
        """Emit the deprecation warning.

   
22

    
   

   
23
        This is a convenience function that emits a deprecation warning using

   
24
        this class, with a suitable default stack level. Callers can provide

   
25
        a useful message and a custom stack level.

   
26

    
   

   
27
        Args:

   
28
            message (unicode):

   
29
                The message to show in the deprecation warning.

   
30

    
   

   
31
            stacklevel (int, optional):

   
32
                The stack level for the warning.

   
33
        """

   
34
        warnings.warn(message, cls, stacklevel=stacklevel + 1)

   
35

    
   

   
36

    
   

   
37
class RemovedInReviewBoard60Warning(BaseRemovedInReviewBoardVersionWarning):

   
38
    """Deprecations for features scheduled for removal in Review Board 6.0.

   
39

    
   

   
40
    Note that this class will itself be removed in Review Board 6.0. If you

   
41
    need to check against Review Board deprecation warnings, please see

   
42
    :py:class:`BaseRemovedInReviewBoardVersionWarning`. Alternatively, you

   
43
    can use the alias for this class,

   
44
    :py:data:`RemovedInNextReviewBoardVersionWarning`.

   
45
    """

   
46

    
   
23

   
47

    
   
24

   
48
class RemovedInReviewBoard70Warning(BaseRemovedInReviewBoardVersionWarning):
25
class RemovedInReviewBoard70Warning(BaseRemovedInReviewBoardVersionWarning):
49
    """Deprecations for features scheduled for removal in Review Board 7.0.
26
    """Deprecations for features scheduled for removal in Review Board 7.0.
50

    
   
27

   
51
    Note that this class will itself be removed in Review Board 7.0. If you
28
    Note that this class will itself be removed in Review Board 7.0. If you
52
    need to check against Review Board deprecation warnings, please see
29
    need to check against Review Board deprecation warnings, please see
53
    :py:class:`BaseRemovedInReviewBoardVersionWarning`. Alternatively, you
30
    :py:class:`BaseRemovedInReviewBoardVersionWarning`. Alternatively, you
54
    can use the alias for this class,
31
    can use the alias for this class,
55
    :py:data:`RemovedInNextReviewBoardVersionWarning`.
32
    :py:data:`RemovedInNextReviewBoardVersionWarning`.
56
    """
33
    """
57

    
   
34

   

    
   
35
    version = '7.0'

    
   
36

   
58

    
   
37

   
59
#: An alias for the next release of Review Board where features will be
38
#: An alias for the next release of Review Board where features will be
60
#: removed.
39
#: removed.
61
RemovedInNextReviewBoardVersionWarning = RemovedInReviewBoard60Warning
40
RemovedInNextReviewBoardVersionWarning = RemovedInReviewBoard70Warning
reviewboard/admin/checks.py
reviewboard/admin/widgets.py
reviewboard/admin/forms/search_settings.py
reviewboard/admin/tests/test_search_settings_form.py
reviewboard/diffviewer/chunk_generator.py
reviewboard/diffviewer/diffutils.py
reviewboard/diffviewer/parser.py
reviewboard/diffviewer/renderers.py
reviewboard/diffviewer/tests/test_diff_chunk_generator.py
reviewboard/diffviewer/tests/test_diff_parser.py
reviewboard/diffviewer/tests/test_diff_renderer.py
reviewboard/diffviewer/tests/test_diffutils.py
reviewboard/diffviewer/tests/test_forms.py
reviewboard/diffviewer/tests/test_raw_diff_chunk_generator.py
reviewboard/hostingsvcs/managers.py
reviewboard/integrations/__init__.py
reviewboard/reviews/managers.py
reviewboard/reviews/tests/test_review_group_manager.py
reviewboard/reviews/ui/text.py
reviewboard/scmtools/forms.py
reviewboard/scmtools/hg.py
reviewboard/scmtools/managers.py
reviewboard/scmtools/models.py
reviewboard/scmtools/registry.py
reviewboard/scmtools/tests/test_registry.py
reviewboard/scmtools/tests/test_repository_form.py
reviewboard/scmtools/tests/test_repository_manager.py
reviewboard/webapi/resources/filediff.py
Loading...