Search code examples
mercurial

Mercurial, revert files to a past revision by wildcard?


hg revert -r 4 -I *.aspx

isn't working for me. Any help? And no, I don't want to use TortoiseHG.


Solution

  • Try hg revert -r 4 -I **/*.aspx from the root directory of the repository. The **.aspx matches any file in any subdirectory in the repository whereas *.aspx only matches them in the current directory.

    See hg help patterns for more information, which I've just noticed shows a regexp-based alternative:

      hg revert re:.*\.aspx$