diff --git a/CONTRIBUTORS b/CONTRIBUTORS --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -3,6 +3,7 @@ List of contributors to Kallithea projec Thomas De Schampheleire 2014-2020 Mads Kiilerich 2016-2020 Asterios Dimitriou 2016-2017 2020 + Anton Schur 2017 2020 Private 2019-2020 David Ignjić 2020 Dennis Fink 2020 @@ -41,7 +42,6 @@ List of contributors to Kallithea projec Søren Løvborg 2015-2017 Sam Jaques 2015 2017 Alessandro Molina 2017 - Anton Schur 2017 Ching-Chen Mao 2017 Eivind Tagseth 2017 FUJIWARA Katsunori 2017 diff --git a/kallithea/model/pull_request.py b/kallithea/model/pull_request.py --- a/kallithea/model/pull_request.py +++ b/kallithea/model/pull_request.py @@ -139,7 +139,7 @@ class PullRequestModel(object): if pull_request.org_repo.scm_instance.alias == 'git': # remove a ref under refs/pull/ so that commits can be garbage-collected try: - del pull_request.org_repo.scm_instance._repo["refs/pull/%d/head" % pull_request.pull_request_id] + del pull_request.org_repo.scm_instance._repo[b"refs/pull/%d/head" % pull_request.pull_request_id] except KeyError: pass diff --git a/kallithea/templates/about.html b/kallithea/templates/about.html --- a/kallithea/templates/about.html +++ b/kallithea/templates/about.html @@ -28,6 +28,7 @@
  • Copyright © 2014–2020, Thomas De Schampheleire
  • Copyright © 2015–2017, 2019–2020, Étienne Gilli
  • Copyright © 2016–2017, 2020, Asterios Dimitriou
  • +
  • Copyright © 2017, 2020, Anton Schur
  • Copyright © 2019–2020, Private
  • Copyright © 2020, David Ignjić
  • Copyright © 2020, Dennis Fink
  • @@ -63,7 +64,6 @@
  • Copyright © 2015–2017, Søren Løvborg
  • Copyright © 2015, 2017, Sam Jaques
  • Copyright © 2017, Alessandro Molina
  • -
  • Copyright © 2017, Anton Schur
  • Copyright © 2017, Ching-Chen Mao
  • Copyright © 2017, Eivind Tagseth
  • Copyright © 2017, FUJIWARA Katsunori
  • diff --git a/kallithea/tests/functional/test_pullrequests.py b/kallithea/tests/functional/test_pullrequests.py --- a/kallithea/tests/functional/test_pullrequests.py +++ b/kallithea/tests/functional/test_pullrequests.py @@ -32,12 +32,25 @@ class TestPullrequestsController(base.Te '_session_csrf_secret_token': self.session_csrf_secret_token(), }, status=302) + # will redirect to URL like http://localhost/vcs_test_hg/pull-request/1/_/stable + pull_request_id = int(response.location.split('/')[5]) + response = response.follow() assert response.status == '200 OK' response.mustcontain('Successfully opened new pull request') response.mustcontain('No additional changesets found for iterating on this pull request') response.mustcontain('href="/vcs_test_hg/changeset/4f7e2131323e0749a740c0a56ab68ae9269c562a"') + response = self.app.post(base.url('pullrequest_delete', + repo_name=base.HG_REPO, pull_request_id=pull_request_id), + { + '_session_csrf_secret_token': self.session_csrf_secret_token(), + }, + status=302) + response = response.follow() + assert response.status == '200 OK' + response.mustcontain('Successfully deleted pull request') + def test_available(self): self.log_user() response = self.app.post(base.url(controller='pullrequests', action='create', diff --git a/kallithea/tests/functional/test_pullrequests_git.py b/kallithea/tests/functional/test_pullrequests_git.py --- a/kallithea/tests/functional/test_pullrequests_git.py +++ b/kallithea/tests/functional/test_pullrequests_git.py @@ -31,11 +31,25 @@ class TestPullrequestsController(base.Te '_session_csrf_secret_token': self.session_csrf_secret_token(), }, status=302) + # will redirect to URL like http://localhost/vcs_test_git/pull-request/1/_/master + pull_request_id = int(response.location.split('/')[5]) + response = response.follow() assert response.status == '200 OK' response.mustcontain('Successfully opened new pull request') response.mustcontain('Git pull requests don't support iterating yet.') + response = self.app.post(base.url('pullrequest_delete', + repo_name=base.GIT_REPO, pull_request_id=pull_request_id), + { + '_session_csrf_secret_token': self.session_csrf_secret_token(), + }, + status=302) + response = response.follow() + assert response.status == '200 OK' + response.mustcontain('Successfully deleted pull request') + + def test_edit_with_invalid_reviewer(self): invalid_user_id = 99999 self.log_user()