Files @ 9855b31d033b
Branch filter:

Location: kallithea/rhodecode/tests/functional/test_changelog.py - annotation

Mads Kiilerich
pullrequests: fix changesets ordering being reversed when creating new pull requests

41b4edf77b5b tried to make the displayed order of changeset consistent: The
topmost is always the latest.

That did however also reverse the ordering of the changesets sent back in the
post when used in the pull request creation form. Displaying the pull request
later on would reverse it again and thus show it in the 'wrong' order.

We now undo that reversing when creating the pull requests, and the stored data
will thus be the same as before.
1e757ac98988
1e757ac98988
b7adbd5456c2
1e757ac98988
1e757ac98988
8acbfa837180
1e757ac98988
88d13c1c6a55
88d13c1c6a55
8acbfa837180
7abbb77b02d0
b7adbd5456c2
623e1d68a2e0
623e1d68a2e0
623e1d68a2e0
623e1d68a2e0
b7adbd5456c2
58dcef7eef03
b7adbd5456c2
58dcef7eef03
b7adbd5456c2
54fda6ce9e98
b7adbd5456c2
88d13c1c6a55
7abbb77b02d0
7abbb77b02d0
7abbb77b02d0
7abbb77b02d0
7abbb77b02d0
7abbb77b02d0
8acbfa837180
58dcef7eef03
58dcef7eef03
80dc0a23edf7
58dcef7eef03
623e1d68a2e0
58dcef7eef03
623e1d68a2e0
58dcef7eef03
623e1d68a2e0
58dcef7eef03
623e1d68a2e0
58dcef7eef03
623e1d68a2e0
88d13c1c6a55
623e1d68a2e0
8acbfa837180
b7adbd5456c2
b7adbd5456c2
623e1d68a2e0
623e1d68a2e0
623e1d68a2e0
623e1d68a2e0
b7adbd5456c2
58dcef7eef03
b7adbd5456c2
58dcef7eef03
b7adbd5456c2
0ea8eca2d63e
7abbb77b02d0
7abbb77b02d0
7abbb77b02d0
7abbb77b02d0
7abbb77b02d0
7abbb77b02d0
7abbb77b02d0
7abbb77b02d0
7abbb77b02d0
7abbb77b02d0
7abbb77b02d0
7abbb77b02d0
7abbb77b02d0
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
58dcef7eef03
from rhodecode.tests import *


class TestChangelogController(TestController):

    def test_index_hg(self):
        self.log_user()
        response = self.app.get(url(controller='changelog', action='index',
                                    repo_name=HG_REPO))

        response.mustcontain('''id="chg_20" class="container tablerow1"''')
        response.mustcontain(
            """<input class="changeset_range" """
            """id="5e204e7583b9c8e7b93a020bd036564b1e731dae" """
            """name="5e204e7583b9c8e7b93a020bd036564b1e731dae" """
            """type="checkbox" value="1" />"""
        )

        response.mustcontain(
            """<span class="changeset_hash">r154:5e204e7583b9</span>"""
        )

        response.mustcontain("""Small update at simplevcs app""")

#        response.mustcontain(
#            """<div id="changed_total_5e204e7583b9c8e7b93a020bd036564b1e731dae" """
#            """style="float:right;" class="changed_total tooltip" """
#            """title="Affected number of files, click to show """
#            """more details">3</div>"""
#        )

    def test_index_pagination_hg(self):
        self.log_user()
        #pagination
        self.app.get(url(controller='changelog', action='index',
                                    repo_name=HG_REPO), {'page': 1})
        self.app.get(url(controller='changelog', action='index',
                                    repo_name=HG_REPO), {'page': 2})
        self.app.get(url(controller='changelog', action='index',
                                    repo_name=HG_REPO), {'page': 3})
        self.app.get(url(controller='changelog', action='index',
                                    repo_name=HG_REPO), {'page': 4})
        self.app.get(url(controller='changelog', action='index',
                                    repo_name=HG_REPO), {'page': 5})
        response = self.app.get(url(controller='changelog', action='index',
                                    repo_name=HG_REPO), {'page': 6})

        # Test response after pagination...
        response.mustcontain(
            """<input class="changeset_range" """
            """id="46ad32a4f974e45472a898c6b0acb600320579b1" """
            """name="46ad32a4f974e45472a898c6b0acb600320579b1" """
            """type="checkbox" value="1" />"""
        )

        response.mustcontain(
            """<span class="changeset_hash">r64:46ad32a4f974</span>"""
        )

#        response.mustcontain(
#            """<div id="changed_total_46ad32a4f974e45472a898c6b0acb600320579b1" """
#            """style="float:right;" class="changed_total tooltip" """
#            """title="Affected number of files, click to show """
#            """more details">21</div>"""
#        )
#
#        response.mustcontain(
#            """<a href="/%s/changeset/"""
#            """46ad32a4f974e45472a898c6b0acb600320579b1" """
#            """title="Merge with 2e6a2bf9356ca56df08807f4ad86d480da72a8f4">"""
#            """46ad32a4f974</a>""" % HG_REPO
#        )

    def test_index_git(self):
        self.log_user()
        response = self.app.get(url(controller='changelog', action='index',
                                    repo_name=GIT_REPO))

        response.mustcontain('''id="chg_20" class="container tablerow1"''')
        response.mustcontain(
            """<input class="changeset_range" """
            """id="95f9a91d775b0084b2368ae7779e44931c849c0e" """
            """name="95f9a91d775b0084b2368ae7779e44931c849c0e" """
            """type="checkbox" value="1" />"""
        )

        response.mustcontain(
            """<span class="changeset_hash">r613:95f9a91d775b</span>"""
        )

        response.mustcontain("""fixing stupid typo in context for mercurial""")

#        response.mustcontain(
#            """<div id="changed_total_5e204e7583b9c8e7b93a020bd036564b1e731dae" """
#            """style="float:right;" class="changed_total tooltip" """
#            """title="Affected number of files, click to show """
#            """more details">3</div>"""
#        )

    def test_index_pagination_git(self):
        self.log_user()
        #pagination
        self.app.get(url(controller='changelog', action='index',
                                    repo_name=GIT_REPO), {'page': 1})
        self.app.get(url(controller='changelog', action='index',
                                    repo_name=GIT_REPO), {'page': 2})
        self.app.get(url(controller='changelog', action='index',
                                    repo_name=GIT_REPO), {'page': 3})
        self.app.get(url(controller='changelog', action='index',
                                    repo_name=GIT_REPO), {'page': 4})
        self.app.get(url(controller='changelog', action='index',
                                    repo_name=GIT_REPO), {'page': 5})
        response = self.app.get(url(controller='changelog', action='index',
                                    repo_name=GIT_REPO), {'page': 6})

        # Test response after pagination...
        response.mustcontain(
            """<input class="changeset_range" """
            """id="636ed213f2f11ef91071b9c24f2d5e6bd01a6ed5" """
            """name="636ed213f2f11ef91071b9c24f2d5e6bd01a6ed5" """
            """type="checkbox" value="1" />"""
        )

        response.mustcontain(
            """<span class="changeset_hash">r515:636ed213f2f1</span>"""
        )