##// END OF EJS Templates
rollback: avoid unsafe rollback when not at tip (issue2998)...
rollback: avoid unsafe rollback when not at tip (issue2998) You can get into trouble if you commit, update back to an older changeset, and then rollback. The update removes your valuable changes from the working dir, then rollback removes them history. Oops: you've just irretrievably lost data running nothing but core Mercurial commands. (More subtly: rollback from a shared clone that was already at an older changeset -- no update required, just rollback from the wrong directory.) The fix assumes that only "commit" transactions have irreplaceable data, and allows rolling back non-commit transactions as always. But when rolling back a commit, check that the working dir is checked out to tip, i.e. the changeset we're about to destroy. If not, abort. You can get back the old (dangerous) behaviour with --force.

File last commit:

r9999:f91e5630 default
r15183:59e8bc22 default
Show More
revisions.txt
29 lines | 1.2 KiB | text/plain | TextLexer
Mercurial supports several ways to specify individual revisions.
A plain integer is treated as a revision number. Negative integers are
treated as sequential offsets from the tip, with -1 denoting the tip,
-2 denoting the revision prior to the tip, and so forth.
A 40-digit hexadecimal string is treated as a unique revision
identifier.
A hexadecimal string less than 40 characters long is treated as a
unique revision identifier and is referred to as a short-form
identifier. A short-form identifier is only valid if it is the prefix
of exactly one full-length identifier.
Any other string is treated as a tag or branch name. A tag name is a
symbolic name associated with a revision identifier. A branch name
denotes the tipmost revision of that branch. Tag and branch names must
not contain the ":" character.
The reserved name "tip" is a special tag that always identifies the
most recent revision.
The reserved name "null" indicates the null revision. This is the
revision of an empty repository, and the parent of revision 0.
The reserved name "." indicates the working directory parent. If no
working directory is checked out, it is equivalent to null. If an
uncommitted merge is in progress, "." is the revision of the first
parent.