What does a Pull Request diff to ? Esp. for old branches

michael.piffret's Avatar


10 Jul, 2018 05:05 PM


I have just installed RhodeCode and have trouble with PRs created on old Mercurial branches. The most extreme example is a branch that is 3 months old, containing 3 commits that changed around 12 files. When I create a PR on this branch, it displays a huge diff for 5000 files!!

It seems like it creates a diff from the source branch to the current target branch state. I was expecting a diff between source branch and common ancestor, for example.

If a branch lives long enough, will the same behaviour occur, files not changed in the branch might appear in the diff ? Or does it only occur when creating a PR on old branch ?
And could we change this behaviour ?

Thanks for your answer, RhodeCode seems so much a better fit for us than Phabricator otherwise.

  1. Support Staff 1 Posted by Marcin Kuzminsk... on 10 Jul, 2018 08:18 PM

    Marcin Kuzminski's Avatar


    The compare simply calculates commits that are not applied onto the other reference. The BIG difference seems odd. Does Mercurial give you the same behaviour when running a hg diff between the branches ?

    Our long experience with Mercurial, caused that we recommend using bookmarks instead of branches for pull requests workflows. Please see: https://rhodecode.com/blog/120/mercurial-workflow-using-bookmarks-h...

    Bookmarks are easily discardable (pushed as seperate heads) and are easily changable, branches aren't. Using bookmarks for us internally was much better in the long run. Please consider also this.


  2. 2 Posted by michael.piffret on 11 Jul, 2018 07:10 AM

    michael.piffret's Avatar


    I checked the diffs in the branch using this command :
    hg diff --stat -r "parents(branch('$branch')) or branch('$branch')"

    I get 18 files changed, 301 insertions(+), 63 deletions(-)

    RhodeCode says The requested commit is too big and content was truncated. 5413 files changed.

    Any idea how I could pinpoint the bug ? Any trace I might enable ?

    Regarding the bookmarks, I had already read the blog article. I tend to agree with your point of view. However, in a company with almost a hundred developers, this kind of change won't happen so easily, habits are not easy to change and I'm not sure I see benefits other than the ability to discard unused branches.


  3. 3 Posted by michael.piffret on 11 Jul, 2018 07:21 AM

    michael.piffret's Avatar

    Update : the huge diff happens with the PR created from the API. If I create it again manually, it shows a diff of 18 files !

    However the source and target appear to be the same. It might be a bug or a bad API call from my code ?

  4. Support Staff 4 Posted by Marcin Kuzminsk... on 11 Jul, 2018 08:38 AM

    Marcin Kuzminski's Avatar

    I'm attaching a patch, would it be possible you apply it, and let us know if that changed the behavior now for API ?

  5. Support Staff 5 Posted by Marcin Kuzminsk... on 11 Jul, 2018 10:42 AM

    Marcin Kuzminski's Avatar

    Thanks for all the feedback, please try this patchfile3 for ancestor calculation.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac


17 Oct, 2018 03:22 PM
15 Oct, 2018 05:20 AM
03 Oct, 2018 01:16 PM
01 Oct, 2018 08:41 AM
28 Sep, 2018 10:12 AM
26 Sep, 2018 04:34 AM