'Recovering old versions' section suggests using `revert`; should instead suggest `update`?
nxg opened this issue · comments
The 'Recovering old versions' section suggests using revert
to return to a historical revision. It first suggests using revert
to handle a mistaken change in the working directory, but then goes on to suggest revert
as a general mechanism for returning to an arbitrary earlier revision. I think this is not the intended use of revert
, and that recommending update
would be better.
Rationale:
- The mercurial documentation for
revert
starts with a Note saying ‘To check out earlier revisions, you should use "hg update REV". To cancel an uncommitted merge (and lose your changes), use "hg update --clean .".’ - The same documentation mentions the
-r
option only in the context of indicating which of two parents should be reverted to (as opposed to arbitrary older revisions). - The current snapshot of the Mercurial book seems to describe
revert
solely in the context of fixing mistakes.
Thus my impression is that revert
is a relatively ‘advanced’ Mercurial command, intended only for fixing mistakes. It's useful to mention it, but perhaps only for the special case of immediate fixing of a mistaken edit. It might usefully come as a final remark to a ‘Recovering old versions’ page which primarily discusses update
.
On the couple of occasions when I've taught this Mercurial lesson, I've told the class to use update
in this case, and specifically not to use revert
.
I could offer a pull request for redrafted the text if that would seem useful.