mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 23:07:18 +03:00
8fc51a190f
Summary:
D27144492 (48cd15ab14
) broke hg undo -i by changing the way integers are formatted
into revsets. This was done to do some rev validation, but undo used the integer
formatting for non-rev cases and this broke undo's usage. Let's just move to
normal python string formatting for undo's case.
The migration to Python 3 also broke hg undo -i by causing the repr() output to
change, which messes up the interactive ui handling. Let's fix that as well, and
drop the repr stuff.
Reviewed By: zzl0
Differential Revision: D39892760
fbshipit-source-id: 96655f743e4187f7345f7f3c6a2fe74fb326335e
48 lines
1.3 KiB
Perl
48 lines
1.3 KiB
Perl
#chg-compatible
|
|
|
|
$ configure modernclient
|
|
$ newclientrepo repo
|
|
$ enable undo
|
|
$ echo >> file
|
|
$ hg commit -Aqm "initial commit"
|
|
$ echo >> file
|
|
$ hg commit -Aqm "initial commit"
|
|
$ hg log -r 'olddraft(0)'
|
|
commit: 79344ac2ab8b
|
|
user: test
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
summary: initial commit
|
|
|
|
commit: f5a897cc70a1
|
|
user: test
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
summary: initial commit
|
|
|
|
$ hg log -r 'oldworkingcopyparent(0)'
|
|
commit: f5a897cc70a1
|
|
user: test
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
summary: initial commit
|
|
|
|
$ hg log -r . -T '{undonecommits(0)}\n'
|
|
|
|
$ hg log -r . -T '{donecommits(0)}\n'
|
|
f5a897cc70a18acf06b00febe9ad748ac761067d
|
|
$ hg log -r . -T '{oldworkingcopyparent(0)}\n'
|
|
f5a897cc70a18acf06b00febe9ad748ac761067d
|
|
$ hg undo --preview
|
|
@
|
|
│
|
|
o
|
|
|
|
undo to *, before commit -Aqm initial commit (glob)
|
|
|
|
$ hg undo
|
|
undone to *, before commit -Aqm initial commit (glob)
|
|
hint[undo-uncommit-unamend]: undoing commits discards their changes.
|
|
to restore the changes to the working copy, run 'hg revert -r f5a897cc70a1 --all'
|
|
in the future, you can use 'hg uncommit' instead of 'hg undo' to keep changes
|
|
hint[hint-ack]: use 'hg hint --ack undo-uncommit-unamend' to silence these hints
|
|
|
|
|