mercurial/debugcommands.py
changeset 51935 8d9767bf4adb
parent 51859 f4733654f144
child 51945 a8e1ff9ac257
equal deleted inserted replaced
51934:fa7059f031a9 51935:8d9767bf4adb
   141 
   141 
   142 
   142 
   143 @command(b'debugantivirusrunning', [])
   143 @command(b'debugantivirusrunning', [])
   144 def debugantivirusrunning(ui, repo):
   144 def debugantivirusrunning(ui, repo):
   145     """attempt to trigger an antivirus scanner to see if one is active"""
   145     """attempt to trigger an antivirus scanner to see if one is active"""
   146     with repo.cachevfs.open('eicar-test-file.com', b'wb') as f:
   146     with repo.cachevfs.open(b'eicar-test-file.com', b'wb') as f:
   147         f.write(
   147         f.write(
   148             util.b85decode(
   148             util.b85decode(
   149                 # This is a base85-armored version of the EICAR test file. See
   149                 # This is a base85-armored version of the EICAR test file. See
   150                 # https://en.wikipedia.org/wiki/EICAR_test_file for details.
   150                 # https://en.wikipedia.org/wiki/EICAR_test_file for details.
   151                 b'ST#=}P$fV?P+K%yP+C|uG$>GBDK|qyDK~v2MM*<JQY}+dK~6+LQba95P'
   151                 b'ST#=}P$fV?P+K%yP+C|uG$>GBDK|qyDK~v2MM*<JQY}+dK~6+LQba95P'
   152                 b'E<)&Nm5l)EmTEQR4qnHOhq9iNGnJx'
   152                 b'E<)&Nm5l)EmTEQR4qnHOhq9iNGnJx'
   153             )
   153             )
   154         )
   154         )
   155     # Give an AV engine time to scan the file.
   155     # Give an AV engine time to scan the file.
   156     time.sleep(2)
   156     time.sleep(2)
   157     util.unlink(repo.cachevfs.join('eicar-test-file.com'))
   157     util.unlink(repo.cachevfs.join(b'eicar-test-file.com'))
   158 
   158 
   159 
   159 
   160 @command(b'debugapplystreamclonebundle', [], b'FILE')
   160 @command(b'debugapplystreamclonebundle', [], b'FILE')
   161 def debugapplystreamclonebundle(ui, repo, fname):
   161 def debugapplystreamclonebundle(ui, repo, fname):
   162     """apply a stream clone bundle file"""
   162     """apply a stream clone bundle file"""