# HG changeset patch # User Jason R. Coombs # Date 1682020618 14400 # Node ID e7ef11b75fdcacf7e3e1fa5494a35bb4718586d7 # Parent eb01d3a65ad8bcd6db62df882cace8889df170be library: incorporate demandimport into runpy invocation diff -r eb01d3a65ad8 -r e7ef11b75fdc mercurial/__main__.py --- a/mercurial/__main__.py Mon Apr 17 09:38:52 2023 -0400 +++ b/mercurial/__main__.py Thu Apr 20 15:56:58 2023 -0400 @@ -1,4 +1,12 @@ +def run(): + from . import demandimport + + with demandimport.tracing.log('hg script'): + demandimport.enable() + from . import dispatch + + dispatch.run() + + if __name__ == '__main__': - from . import dispatch - - dispatch.run() + run()