Issue #2590 resolved

Add "Revert to Previous Revision" context menu

Harold Howe
created an issue

Please consider adding "Revert to Previous Revision" to the context menu that appears when right clicking on a file in a change set. It would appear below the existing "Revert to Revision". Ideally, I could apply this to multiple selected files, just like the Revert command. The UI that appears would show the files I selected, and the revision they will revert to.

Here is why this would be handy: while browsing recent changesets pulled from other people, I often spot a couple of file changes that I can't cope with at the moment. I want to revert to the previous revision that doesn't have the changes that appear in the changeset I am looking at.

Comments (1)

  1. Angel Ezquerra

    revert: allow reverting files to any of the selected revision parents (fixes #2590)

    This makes it possible to revert a file or files to any of the selected revision parents, in addition to the selected revision itself.

    This change fixes issue #2590. It is not exactly the same that the issue suggests, but it covers very similar ground.

    A few additional caveats:

    • This currently does not work for the working directory or the tipmost applied patch because those use a different Revert dialog. Nevertheless, it is still possible to access this feature indirectly by first selecting the working directory or the tipmost patch and then going to the manifest dialog. Then you can select the file(s) you want to revert and the revision that you want to revert to.
    • The case in which a revision has no parents is a bit special and is handled separately (it shows a message that tells the user that the file(s) will be forgotten).
    • It may be interesting to be able to revert to the last revision in which a given file was modified. For regular modified files this is the same as the selected revision's parent, but for clean files that is not the case. This is currently not possible with this patch.
    • I was careful to make the strings as easy to translate as possible.
    • A revision should never have more than two parents. If that ever changes the code will break gracefully (only the firt two parents would be shown).

    → <<cset e1873f713c7e>>

  2. Log in to comment