How to merge to get rid of head with Mercurial command line, like I can do with TortoiseHg?

According to TortoiseHG’s source, when you check Discard all changes from merge target (other) revision, it uses the hg debugsetparents command:

hg debugsetparents REV1 [REV2]

manually set the parents of the current working directory

    This is useful for writing repository conversion tools, but should be used with care.

    Returns 0 on success.

use "hg -v help debugsetparents" to show global options

To use:

    hg up <revision-to-keep>
    hg debugsetparents <revision-to-keep> <revision-to-throw-away>
    hg commit -m "Merge to discard ..."

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)