Changeset - 5a092b5f0d98
[Not reviewed]
default
0 2 0
Mads Kiilerich - 6 years ago 2019-11-11 01:56:23
mads@kiilerich.com
Grafted from: c618a2902db1
routing: fix files_annotate_home annotate value to be compatible with Routes >= 2

The routing entry for files_annotate_home had annotate=True. That primarily
served to let the controller files.index differentiate files_annotate_home from
files_home and files_home_nopath . Anything true can work.

test_files.py is creating files_annotate_home URLs in an odd way: Instead of
explicitly specifying it is a files_annotate_home URL, it passes expected
controller parameters and expects routing to find a URL that would provide
these parameters. It thus also has to specify the otherwise "invisible"
annotate value. For Routes < 2, True works just fine. For Routes >= 2, it seems
to expect values that actually can be encoded in URLs.

Thus, instead of True, use '1'.
2 files changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
kallithea/config/routing.py
Show inline comments
 
@@ -719,7 +719,7 @@ def make_map(config):
 
    rmap.connect('files_annotate_home',
 
                 '/{repo_name:.*?}/annotate/{revision}/{f_path:.*}',
 
                 controller='files', revision='tip',
 
                 f_path='', annotate=True, conditions=dict(function=check_repo))
 
                 f_path='', annotate='1', conditions=dict(function=check_repo))
 

	
 
    rmap.connect('files_edit_home',
 
                 '/{repo_name:.*?}/edit/{revision}/{f_path:.*}',
kallithea/tests/functional/test_files.py
Show inline comments
 
@@ -136,7 +136,7 @@ class TestFilesController(TestController
 
                                    repo_name=HG_REPO,
 
                                    revision='tip',
 
                                    f_path='vcs/nodes.py',
 
                                    annotate=True))
 
                                    annotate='1'))
 

	
 
        response.mustcontain("""r356:25213a5fbb04""")
 

	
 
@@ -146,7 +146,7 @@ class TestFilesController(TestController
 
                                    repo_name=GIT_REPO,
 
                                    revision='master',
 
                                    f_path='vcs/nodes.py',
 
                                    annotate=True))
 
                                    annotate='1'))
 
        response.mustcontain("""r345:c994f0de03b2""")
 

	
 
    def test_file_annotation_history(self):
 
@@ -155,7 +155,7 @@ class TestFilesController(TestController
 
                                    repo_name=HG_REPO,
 
                                    revision='tip',
 
                                    f_path='vcs/nodes.py',
 
                                    annotate=True),
 
                                    annotate='1'),
 
                                extra_environ={'HTTP_X_PARTIAL_XHR': '1'})
 

	
 
        assert response.body == HG_NODE_HISTORY
 
@@ -177,7 +177,7 @@ class TestFilesController(TestController
 
                                    repo_name=HG_REPO,
 
                                    revision='tip',
 
                                    f_path='vcs/nodes.py',
 
                                    annotate=True))
 
                                    annotate='1'))
 
        response.mustcontain('Marcin Kuzminski')
 
        response.mustcontain('Lukasz Balcerzak')
 

	
 
@@ -187,7 +187,7 @@ class TestFilesController(TestController
 
                                    repo_name=GIT_REPO,
 
                                    revision='master',
 
                                    f_path='vcs/nodes.py',
 
                                    annotate=True))
 
                                    annotate='1'))
 
        response.mustcontain('Marcin Kuzminski')
 
        response.mustcontain('Lukasz Balcerzak')
 

	
0 comments (0 inline, 0 general)