changeset 39280:da459d426c20

tests: use inline Python for revlog test `hg debugdata` will soon stop accepting the raw path to a revlog file. Adjust a test accordingly. The changed test is for a security bug. So this should be reviewed with scrutiny. Differential Revision: https://phab.mercurial-scm.org/D4356
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 20 Aug 2018 23:06:47 +0000
parents cb9cf42c902f
children dd6bc2509bdc
files tests/test-revlog.t
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-revlog.t	Mon Aug 20 21:01:05 2018 +0000
+++ b/tests/test-revlog.t	Mon Aug 20 23:06:47 2018 +0000
@@ -43,5 +43,10 @@
      rev linkrev nodeid       p1           p2
        0       2 99e0332bd498 000000000000 000000000000
        1       3 6674f57a23d8 99e0332bd498 000000000000
-  $ hg debugdata a.i 1 2>&1 | egrep 'Error:.*decoded'
-  (mercurial\.\w+\.mpatch\.)?mpatchError: patch cannot be decoded (re)
+
+  >>> from mercurial import revlog, vfs
+  >>> tvfs = vfs.vfs(b'.')
+  >>> tvfs.options = {b'revlogv1': True}
+  >>> rl = revlog.revlog(tvfs, b'a.i')
+  >>> rl.revision(1)
+  mpatchError('patch cannot be decoded',)