unshelve: don't commit unknown files during unshelve (
issue4113)
Previously, unshelve would temporarily commit unknown files (via addremove) in
an attempt to allow unshelving into unknown files. This produced unexpected
results, like the file time stamp changing and a .i file being created.
This change makes it no longer use addremove. It ignores unknown files
completely. If an unshelve would overwrite an unknown file, the unknown file is
moved to *.orig
The shelve continue/abort format is changed, but it just removes stuff from the
end of the file, so it can still read the old format.
$ hg init
$ echo 123 > a
$ hg add a
$ hg commit -m "first" a
$ mkdir sub
$ echo 321 > sub/b
$ hg add sub/b
$ hg commit -m "second" sub/b
$ cat sub/b
321
$ hg co 0
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ cat sub/b 2>/dev/null || echo "sub/b not present"
sub/b not present
$ test -d sub || echo "sub not present"
sub not present