Mercurial, revert files to a past revision by wildcard?
Asked Answered
U

1

7
hg revert -r 4 -I *.aspx

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

Unbent answered 6/5, 2011 at 4:0 Comment(0)
Z
13

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$
Zoarah answered 6/5, 2011 at 4:4 Comment(3)
@niall hg revert -r 4 re:.*\.aspx$ did it thanks. I'll be marking this as the answer. All the best! Question, why did the other not workUnbent
@jonathan: did some experimentation and you need to run the command from the repo's root.Zoarah
@niall I ran all of the commands from the root. I am using an older version of hg though. version 1.5.1. Could that be the problem?Unbent

© 2022 - 2024 — McMap. All rights reserved.