amend: fix copy records handling (
issue3410)
Messing with the dirstate before the intermediate commit seems error prone.
Instead, commit and recompute the copies with copies.pathcopies(), then use
that with commitctx().
Since copies.pathcopies() does not support file replacement very well, the
whole .renamed() condition in samefile() is removed and the "file replacement
caused by differing copy source" effect is discarded.
Test shamelessly stolen from Idan Kamara <idankk86@gmail.com>
$ "$TESTDIR/hghave" inotify || exit 80
$ hg init
$ echo "[extensions]" >> $HGRCPATH
$ echo "inotify=" >> $HGRCPATH
inserve
$ hg inserve -d --pid-file=hg.pid
$ cat hg.pid >> "$DAEMON_PIDS"
let the daemon finish its stuff
$ sleep 1
empty
$ hg debuginotify
directories being watched:
/
.hg/
$ mkdir a
$ sleep 1
only 'a
$ hg debuginotify
directories being watched:
/
.hg/
a/
$ rmdir a
$ sleep 1
empty again
$ hg debuginotify
directories being watched:
/
.hg/
$ kill `cat hg.pid`