Patchwork [STABLE] test-fix: normalize precision of mtime copied by 'cp -p'

login
register
mail settings
Submitter Yuya Nishihara
Date April 23, 2018, 1:03 p.m.
Message ID <80695628adcbee8860f1.1524488591@mimosa>
Download mbox | patch
Permalink /patch/31209/
State Accepted
Headers show

Comments

Yuya Nishihara - April 23, 2018, 1:03 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1524485599 -32400
#      Mon Apr 23 21:13:19 2018 +0900
# Branch stable
# Node ID 80695628adcbee8860f19b9b8578fdf26ff4e701
# Parent  f73842ecedcda20f95367589fb03df39c5e21715
test-fix: normalize precision of mtime copied by 'cp -p'

Appears that MSYS cp only copies mtime in seconds.
Matt Harbison - April 23, 2018, 3:10 p.m.
> On Apr 23, 2018, at 9:03 AM, Yuya Nishihara <yuya@tcha.org> wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1524485599 -32400
> #      Mon Apr 23 21:13:19 2018 +0900
> # Branch stable
> # Node ID 80695628adcbee8860f19b9b8578fdf26ff4e701
> # Parent  f73842ecedcda20f95367589fb03df39c5e21715
> test-fix: normalize precision of mtime copied by 'cp -p'
> 
> Appears that MSYS cp only copies mtime in seconds.

Works for me, thanks.

Patch

diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -494,6 +494,7 @@  write back to the file, so for example t
   $ hg add
   adding foo.whole
   $ cp -p foo.whole foo.whole.orig
+  $ cp -p foo.whole.orig foo.whole
   $ sleep 2 # mtime has a resolution of one or two seconds.
   $ hg fix --working-dir
   $ f foo.whole.orig --newer foo.whole