Possible bug in revert commands -n option
Peter Williams
pwil3058 at bigpond.net.au
Thu Mar 22 20:34:01 CDT 2007
With mercurial 0.9.3, this option only seems to work when used in
conjunction with the --all option:
[peterw at heathwren test-hg]$ hg revert -n --all
forgetting Zgjhlkg
reverting dfjfg
[peterw at heathwren test-hg]$ hg revert -n dfjfg
[peterw at heathwren test-hg]$ hg revert -n --all
forgetting Zgjhlkg
reverting dfjfg
[peterw at heathwren test-hg]$ hg revert -n Zgjhlkg
[peterw at heathwren test-hg]$ hg revert -n --all
forgetting Zgjhlkg
reverting dfjfg
[peterw at heathwren test-hg]$ hg revert -n Zgjhlkg dfjfg
[peterw at heathwren test-hg]$ hg revert -n --all
forgetting Zgjhlkg
reverting dfjfg
[peterw at heathwren test-hg]$
but the documentation makes no mention of this limitation. Is the
observed behaviour the intended behaviour or is the documentation correct?
Personally, I would like -n to work without the --all option. The
reason for my preference is that I'm writing a GUI wrapper around hg
(and other SCMs) specifically aimed at managing the working directory
rather than the repository itself (which is what existing GUI tools
provide). Part of the functionality of the GUI is allowing the user to
select files (in a file tree) and then invoke file related hg commands
(add, copy, remove, rename, diff, revert) on them. Where the command is
one with likely irreversible consequences I like to pop up a
"confirmation" dialog to give the user to change their mind. The best
way for me to tell the user what's about to happen with a "revert" is to
get the output from a "-n" run to show them what the result will be.
Peter
--
Peter Williams pwil3058 at bigpond.net.au
"Learning, n. The kind of ignorance distinguishing the studious."
-- Ambrose Bierce
More information about the Mercurial-devel
mailing list