Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Recovering old versions' section suggests using revert; should instead suggest update? #41

Open
nxg opened this issue Mar 16, 2017 · 0 comments

Comments

@nxg
Copy link
Contributor

nxg commented Mar 16, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant