D3252: tests: use `f --newer` instead of `stat -c` in test-fix.t

2018-04-13 Thread yuja (Yuya Nishihara)
yuja added inline comments.

INLINE COMMENTS

> test-fix.t:495
>adding foo.whole
> -  $ OLD_MTIME=`stat -c %Y foo.whole`
> -  $ sleep 1 # mtime has a resolution of one second.
> +  $ cp foo.whole foo.whole.orig
> +  $ sleep 2 # mtime has a resolution of one or two seconds.

Maybe `cp -p` to not increment a few microseconds?

> test-fix.t:499
> +  $ f foo.whole --newer foo.whole.orig
> +  foo.whole: older than foo.whole.orig
>  

This means `mtime(foo.whole) < mtime(foo.whole.orig)`, but we
need to assert `mtime(foo.whole.orig) >= mtime(foo.whole)`.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3252

To: durin42, #hg-reviewers, indygreg
Cc: yuja, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3252: tests: use `f --newer` instead of `stat -c` in test-fix.t

2018-04-12 Thread durin42 (Augie Fackler)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG314f39e5fa86: tests: use `f --newer` instead of `stat -c` 
in test-fix.t (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3252?vs=8018=8071

REVISION DETAIL
  https://phab.mercurial-scm.org/D3252

AFFECTED FILES
  tests/test-fix.t

CHANGE DETAILS

diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -492,11 +492,11 @@
   $ printf "NO FIX NEEDED\n" > foo.whole
   $ hg add
   adding foo.whole
-  $ OLD_MTIME=`stat -c %Y foo.whole`
-  $ sleep 1 # mtime has a resolution of one second.
+  $ cp foo.whole foo.whole.orig
+  $ sleep 2 # mtime has a resolution of one or two seconds.
   $ hg fix --working-dir
-  $ NEW_MTIME=`stat -c %Y foo.whole`
-  $ test $OLD_MTIME = $NEW_MTIME
+  $ f foo.whole --newer foo.whole.orig
+  foo.whole: older than foo.whole.orig
 
   $ cd ..
 



To: durin42, #hg-reviewers, indygreg
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3252: tests: use `f --newer` instead of `stat -c` in test-fix.t

2018-04-11 Thread durin42 (Augie Fackler)
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Also increase sleep to two seconds so this test will likely pass on FAT32.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3252

AFFECTED FILES
  tests/test-fix.t

CHANGE DETAILS

diff --git a/tests/test-fix.t b/tests/test-fix.t
--- a/tests/test-fix.t
+++ b/tests/test-fix.t
@@ -492,11 +492,11 @@
   $ printf "NO FIX NEEDED\n" > foo.whole
   $ hg add
   adding foo.whole
-  $ OLD_MTIME=`stat -c %Y foo.whole`
-  $ sleep 1 # mtime has a resolution of one second.
+  $ cp foo.whole foo.whole.orig
+  $ sleep 2 # mtime has a resolution of one or two seconds.
   $ hg fix --working-dir
-  $ NEW_MTIME=`stat -c %Y foo.whole`
-  $ test $OLD_MTIME = $NEW_MTIME
+  $ f foo.whole --newer foo.whole.orig
+  foo.whole: older than foo.whole.orig
 
   $ cd ..
 



To: durin42, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel