#3369 Make it possible to select matching branch as default PR target
Merged by pingou. Opened by bkabrda.
bkabrda/pagure pr-target-matching-branch  into  master

Download 3369.patch

I have a deployment of Pagure that maintains repos with unused "master" branches, where all the important code is in branches named "product-x.y" or similar. I'd like Pagure to offer these branches as default PR target when creating new PRs in UI. E.g. branch "product-x.y" should be offered as default PR target when making PR from branch "product-x.y-feature.1".
This PR implements this and makes it a non-default behavior controlled by a value in config.

@bkabrda Could you rebase against current master?

rebased onto a92778e2e109d5053ee9d60abd203600353ca64e

:thumbsup: :100:

Code looks fine from a quick read but I'd like to test it a little bit locally before merging.

Thanks :)

Hmm, I've backported this to my 4.0.3 setup and ran into some errors in the code in repo_info.html, which I haven't seen when testing this in master locally. I think the code in repo_info.html is not used any more. Will it be removed altogether or should I fix it before this gets merged?

rebased onto 163859ddad5340a17bb7c8aba6dc70b21d573b1f

I fixed the stuff in repo_info.html mentioned in the previous comment, but I still can't find a way to make that code actually do something in the current master. I'm thinking it may be because of the redesign that has changed a lot of things, IMO this can be removed.

It shouldn't default to master if False, but defaults to the default branch of the git repo (which itself defaults to master but not necessarily)

0target ?

You may want to set the default branch_to to something like _ and use replace below, as I think flask may complain/fail to build the url if one of the mandatory argument is missing

On the other side, we're already using this for branch_from so I guess it'll work :)

Alright, looks fine to me, let's address the the typos in the doc, rebase and merge :)

rebased onto 8159a87486c8b8a0f757914e18a4e9762ea744eb

Fixed and rebased. Thanks for the review!

missing a the at the start of the line?

rebased onto 07edc0b5d3deabed1cacbca57286adf3e5069cd7

Yeah, I added the missing "the" :)

Pull-Request has been merged by pingou

Metadata