changeset 44376:56f089e40c5a

tests: replace truncate(1) with inline python MSYS doesn't have truncate(1) installed by default, and FreeBSD looked unhappy with the arguments provided. Differential Revision: https://phab.mercurial-scm.org/D8147
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 24 Feb 2020 17:43:34 -0500
parents 35d2afc6966a
children ca82929e433d
files tests/test-tags.t
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-tags.t	Mon Feb 24 16:59:35 2020 -0500
+++ b/tests/test-tags.t	Mon Feb 24 17:43:34 2020 -0500
@@ -374,7 +374,11 @@
 On junk data + missing cache entries, hg also overwrites the junk.
 
   $ rm -f .hg/cache/tags2-visible
-  $ truncate .hg/cache/hgtagsfnodes1 -s -10
+  >>> import os
+  >>> with open(".hg/cache/hgtagsfnodes1", "ab+") as fp:
+  ...     fp.seek(-10, os.SEEK_END) and None
+  ...     fp.truncate() and None
+
   $ hg debugtagscache | tail -2
   4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d
   5 8dbfe60eff306a54259cfe007db9e330e7ecf866 missing/invalid