Patchwork D8147: tests: replace truncate(1) with inline python

login
register
mail settings
Submitter phabricator
Date Feb. 25, 2020, 2:53 p.m.
Message ID <bf857362e8eb1ddd9916920ff2899466@localhost.localdomain>
Download mbox | patch
Permalink /patch/45313/
State Not Applicable
Headers show

Comments

phabricator - Feb. 25, 2020, 2:53 p.m.
Closed by commit rHG56f089e40c5a: tests: replace truncate(1) with inline python (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8147?vs=20292&id=20297

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8147/new/

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

AFFECTED FILES
  tests/test-tags.t

CHANGE DETAILS




To: mharbison72, #hg-reviewers, marmoute, pulkit
Cc: marmoute, mercurial-devel

Patch

diff --git a/tests/test-tags.t b/tests/test-tags.t
--- a/tests/test-tags.t
+++ b/tests/test-tags.t
@@ -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