mercurial/__main__.py
author Georges Racinet <georges.racinet@octobus.net>
Fri, 27 Oct 2023 22:11:05 +0200
changeset 51239 7eea2e4109ae
parent 50697 e7ef11b75fdc
permissions -rw-r--r--
rust-index: using the `hg::index::Index` in ancestors iterator and lazy set Since there is no Rust implementation for REVLOGV2/CHANGELOGv2, we declare them to be incompatible with Rust, hence indexes in these formats will use the implementations from Python `mercurial.ancestor`. If this is an unacceptable performance hit for current users of these formats, we can later on add Rust implementations based on the C index for them or implement these formats for the Rust indexes. Among the challenges that we had to meet, we wanted to avoid taking the GIL each time the inner (vcsgraph) iterator has to call the parents function. This would probably still be acceptable in terms of performance with `AncestorsIterator`, but not with `LazyAncestors` nor for the upcoming change in `MissingAncestors`. Hence we enclose the reference to the index in a `PySharedRef`, leading to more rigourous checking of mutations, which does pass now that there no logically immutable methods of `hg::index::Index` that take a mutable reference as input.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50697
e7ef11b75fdc library: incorporate demandimport into runpy invocation
Jason R. Coombs <jaraco@jaraco.com>
parents: 50696
diff changeset
     1
def run():
e7ef11b75fdc library: incorporate demandimport into runpy invocation
Jason R. Coombs <jaraco@jaraco.com>
parents: 50696
diff changeset
     2
    from . import demandimport
e7ef11b75fdc library: incorporate demandimport into runpy invocation
Jason R. Coombs <jaraco@jaraco.com>
parents: 50696
diff changeset
     3
e7ef11b75fdc library: incorporate demandimport into runpy invocation
Jason R. Coombs <jaraco@jaraco.com>
parents: 50696
diff changeset
     4
    with demandimport.tracing.log('hg script'):
e7ef11b75fdc library: incorporate demandimport into runpy invocation
Jason R. Coombs <jaraco@jaraco.com>
parents: 50696
diff changeset
     5
        demandimport.enable()
e7ef11b75fdc library: incorporate demandimport into runpy invocation
Jason R. Coombs <jaraco@jaraco.com>
parents: 50696
diff changeset
     6
        from . import dispatch
e7ef11b75fdc library: incorporate demandimport into runpy invocation
Jason R. Coombs <jaraco@jaraco.com>
parents: 50696
diff changeset
     7
e7ef11b75fdc library: incorporate demandimport into runpy invocation
Jason R. Coombs <jaraco@jaraco.com>
parents: 50696
diff changeset
     8
        dispatch.run()
e7ef11b75fdc library: incorporate demandimport into runpy invocation
Jason R. Coombs <jaraco@jaraco.com>
parents: 50696
diff changeset
     9
e7ef11b75fdc library: incorporate demandimport into runpy invocation
Jason R. Coombs <jaraco@jaraco.com>
parents: 50696
diff changeset
    10
50696
eb01d3a65ad8 library: enable runpy invocation on mercurial package
Jason R. Coombs <jaraco@jaraco.com>
parents:
diff changeset
    11
if __name__ == '__main__':
50697
e7ef11b75fdc library: incorporate demandimport into runpy invocation
Jason R. Coombs <jaraco@jaraco.com>
parents: 50696
diff changeset
    12
    run()