update, revert and switch

Thomas Arendsen Hein thomas at intevation.de
Wed May 17 05:00:08 CDT 2006


* Sébastien Pierre <sebastien at xprima.com> [20060516 22:12]:
> For instance, "revert" and "update" could be variants of a more generic
> "switch" operation :
> 
> - revert would only switch files to a previous revision
> - update would only switch files to a newer revision
> - switch would switch with any revision
> 
> There could be an option that would "reparent" to the given revision as
> well (what update currently does).
> 
> Does this seems like a good idea ?

In short: No

"reparenting" has to be the default operation.

update and update -C behave like in CVS, if you don't like the
connotation of "to a newer revision", just use "hg checkout" or "hg co"
(I do it, too) which are official aliases to update.

Without a given target revision update/up/checkout/co go to a newer
revision (i.e. tip), so here the connotation is ok.

revert has the working directory's parent as default target
revision, so when not specifying a revision to revert to, you throw
away what you just have done. So this is the correct term here, too.
If you specify a revision, you throw away what you've done between
your working directory and the specified revision, and you can even
throw away the removal of a file, so it appears again.

Thomas

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


More information about the Mercurial mailing list