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

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Fri Apr 13 07:54:59 EDT 2018


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


More information about the Mercurial-devel mailing list