Mercurial close before merge not working

Hi we are currently using RhodeCode 4.19.2 community on a private server.

We have the global vcs setting “Close branch before merging it” enabled.
However for all of our pull requests when using server-side merging, the branch is being closed after the merge, leaving behind the branch head.

Can anyone give me any pointers as to why this might be?
The merge checks on the pull requests tell me its going to be closed after merge, but I dont know why, given we have enabled this setting to avoid this.

Many Thanks.

We’re going to check this, and get back to you.


thanks @rhodecode-support look forward to hearing from you.

After some thinking, we decided this is infact subotimal, we’ll change the order, and close the branch before the merge.

Thanks thats good news.
From looking at the code myself, I suspect the merge / close are happening in the right order, but the required pushes appear to happen out of order, merge first then close. I didnt get a far as experimenting locally myself so I cannot confirm this. I havent looked at it for a few days, so I will check later today and post more detail if I can.


Here’s the relevant code for this:

You might want to edit this on your instance if you want to experiment more.

We’ve fixed this now. It will be included in the next release 4.20.X If you want you can apply this patch on top of your current CE code, and it will change the behavior to the expected.