diff -r e4640ec346ac -r 08890706366e mercurial/cmdutil.py --- a/mercurial/cmdutil.py Thu Mar 22 22:58:31 2018 -0400 +++ b/mercurial/cmdutil.py Thu Mar 08 11:44:03 2018 -0800 @@ -1192,7 +1192,9 @@ os.rename(src, tmp) os.rename(tmp, target) else: - util.copyfile(src, target) + # Preserve stat info on renames, not on copies; this matches + # Linux CLI behavior. + util.copyfile(src, target, copystat=rename) srcexists = True except IOError as inst: if inst.errno == errno.ENOENT: