1. David Wolever
  2. hg-mergediff
  3. Issues
Issue #4 wontfix

Integrate with other commands

Jesse Glick
created an issue

Having a standalone command to view a single merge changeset is useful, but I really want other commands which produce diffs to automatically switch to a merge diff when the changeset in question is in fact a merge changeset. In particular, {{{hg out -pv}}} is currently useful only insofar as you have no outgoing merges. http://mercurial.selenic.com/bts/issue981 gives justification.

It would also be desirable for {{{--stat}}} on a merge to show just the diffstat of the mergediff.

Comments (3)

  1. David Wolever repo owner

    I have avoided doing this because, unlike “normal” diffs, a mergediff intentionally discards hunks of the diff, which makes it useless/misleading/dangerous to store or use (ex, as input to `patch`) for anything other than a code review.

    Something like Git's combined diff format would be more appropriate, but this is not mergediff's goal.

  2. Jesse Glick reporter

    First of all, a code review - perhaps by yourself (out -p) - is exactly the use case I was discussing.

    Second, using a regular diff from a merge changeset is usually misleading or wrong; you would rarely store such a patch unless you were trying to reimplement rebase or transplant in a shell script and wanted to ignore second merge parents and the history chains they represent. There are some use cases, but probably rarer than just running log -p on a revset, etc.

    981 suggests a new option that would allow you to explicitly indicate for other commands that you wanted to use mergediffs on merge changesets. (I think this would be the normal decision, but that is why the defaults section exists.)

  3. Log in to comment