Issue #7391 duplicate

Renamed and copies not shown on commit page

Martin Geisler
created an issue

In a Mercurial repository, you cannot see if a file was renamed (hg rename) or if the old name was deleted and the new added (hg add; hg remove). It is as if Bitbucket runs Mercurial with diff.git = true in the config file.

An example of a rename is 8fb8dce3f9b6 in Mercurial's repository. The test-config-case.t file was renamed to test-config.t, but this cannot be seen. This makes it practically impossible to review changesets involving renames.

Running hg serve --config diff.git=true shows how one can do it instead by adding "rename from tests/test-config-case.t" and "rename to tests/test-config.t" lines above the diff. I'm sure you can come up with something nice here :-)

For copies, it is only the new file that shows up in the diff on Bitbucket, as seen for 5c5152af0d15 where map-cmdline.phases was copied from map-cmdline.defaults.

Comments (3)

  1. Erik van Zijst staff

    Hey Martin,

    You're right that we don't track renames. This was a deliberate decision early on that somewhat simplified our compare view and pull requests implementations. We do the same with Git, which makes certain operations a bit speedier as git doesn't track renames.

    However, it's something we should definitely reconsider and we've already got an open issue for it, so I'll close this one.

  2. Martin Geisler reporter

    Hey Erik,

    Thanks for the always speedy replies! I did find #589, but I created a new issue since I think that issue is about something slightly different: following renames when showing file history. The current issue is about showing a rename in the diff view when you inspect a single commit.

    In command line terms, I'm talking about making the user/repo/commits/REV page show the output of

    $ hg diff --git -c REV
    $ git diff -M 'REV^..REV'

    while I think you and #589 are talking about using hg log --follow and git log --follow in the user/repo/src/REV/FILE pages. Btw, Mercurial only recently got the ability to show links back to the previous file for a rename when you view a file log in hgweb (I'll try to update #589).

    In any case, it's good to hear if you'll reconsider this and at least add support for viewing renames in the single-diff views. Adding it generally to pull request diffs would of course be icing on the cake :-)

  3. Log in to comment