# HG changeset patch # User Augie Fackler # Date 1585748520 18000 # Node ID 87047efbc6a60fbccde82a07939d3f236db5a2c3 # Parent a37f290a71240b851f5df900833f848efbab576a debugcommands: create new debugantivirusrunning command This writes the EICAR test file to .hg/cache, in an attempt to trigger an AV scanner's scanning engine. This should let us (in theory) detect some cases when a user's slowness is a result of AV scanning. Differential Revision: https://phab.mercurial-scm.org/D8353 diff -r a37f290a7124 -r 87047efbc6a6 mercurial/debugcommands.py --- a/mercurial/debugcommands.py Fri Jul 17 03:28:52 2020 +0200 +++ b/mercurial/debugcommands.py Wed Apr 01 08:42:00 2020 -0500 @@ -127,6 +127,23 @@ ui.write(b'%d:%s\n' % (r.rev(a), hex(a))) +@command(b'debugantivirusrunning', []) +def debugantivirusrunning(ui, repo): + """attempt to trigger an antivirus scanner to see if one is active""" + with repo.cachevfs.open('eicar-test-file.com', b'wb') as f: + f.write( + util.b85decode( + # This is a base85-armored version of the EICAR test file. See + # https://en.wikipedia.org/wiki/EICAR_test_file for details. + b'ST#=}P$fV?P+K%yP+C|uG$>GBDK|qyDK~v2MM*