[issue2998] hg rollback should warn if on wrong revision

nqudex bugs at mercurial.selenic.com
Sun Sep 11 14:19:26 CDT 2011


New submission from nqudex <nqudex at gmail.com>:

File 'two' is lost forever:

$ hg init
$ echo "one" > one
$ hg commit -A
adding one
$ echo "two" > two
$ hg commit -A
adding two
$ hg checkout 0
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg rollback -n
rolling back to revision 0 (undo commit)
$ hg rollback
rolling back to revision 0 (undo commit)
$ hg status
! two
$

A warning is a must here. It would be even better if hg rollback would also 
dump what it changes somewhere, so at least the rollback undo could be done 
manually. Or require a --force flag if the initial result of the action to 
be rolled back is not consistent with the current state.
Otherwise people lose work:
http://stackoverflow.com/questions/7376915/recover-lost-files-after-commit-
and-rollback-in-mercurial-equivalent-of-git-ref

----------
messages: 17348
nosy: nqudex
priority: urgent
status: unread
title: hg rollback should warn if on wrong revision

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2998>
____________________________________________________


More information about the Mercurial-devel mailing list