Is this the expected revert behaviour ?

Thomas Arendsen Hein thomas at intevation.de
Thu May 11 07:36:09 CDT 2006


* Johannes Stezenbach <js at linuxtv.org> [20060506 02:01]:
> On Fri, May 05, 2006, Bryan O'Sullivan wrote:
> > By default, "hg revert" reverts the entire working directory if passed
> > no arguments.  You can't lose any work, since it saves .orig files if
> > necessary, but it could be annoying anyway.
> > 
> > I think revert should require at least one name to revert.  If you
> > really want to revert the entire working dir, just do something like
> > this:
> > 
> >     hg revert $(hg root)
> > 
> > instead.  Opinions?
> 
> "hg add" has a similar problem.
> 
> Following the principle of least surprise I suggest
> "hg add --all" and "hg revert --all", and
> bare "hg add" and "hg revert" should just print
> a help message.

Just be carefull to not overcomplicate this. Instead of 'hg revert
--all' people might start using 'hg revert *' to save typing, then
notice that this doesn't revert hidden files (like .hgtags), so some
people will use 'hg revert .' (but not all).

Now we come to a point where people ask why 'hg status', 'hg diff'
and 'hg commit' don't have the same behaviour.

Sounds like a nightmare? Don't let it become reality! :)

Thomas

-- 
Email: thomas at intevation.de
http://intevation.de/~thomas/


More information about the Mercurial mailing list