hg
author Mads Kiilerich <mads@kiilerich.com>
Mon, 11 Jul 2022 22:47:56 +0200
branchstable
changeset 49417 1bad05cfc818
parent 48957 edab75a4c1da
child 50534 057639af827c
permissions -rwxr-xr-x
rust: bump to memmap2 0.5.3, micro-timer 0.4.0, and crossbeam-channel 0.5.0 The merge in 12adf8c695ed had conflicts in rust/Cargo.lock and rust/hg-core/Cargo.toml . Let's ignore rust/Cargo.lock - it is regenerated. For rust/hg-core/Cargo.toml, stable had dd6b67d5c256 "rust: fix unsound `OwningDirstateMap`" which introduced ouroboros (and dropped stable_deref_trait). Default had ec8d9b5a5e7c "rust-hg-core: upgrade dependencies" which had a lot of churn bumping minimum versions - also patch versions. It is indeed a good idea to bump to *allow* use of latest package. That means that major versions should be bumped for packages after 1.0, and for packages below 1.0 minor versions should be bumped too. But it doesn't work to try enforce a policy of using latest patch by bumping versions at arbitrary times. For good or bad, the merge doesn't seem to have resolved the conflicts correctly, and many of the minor "upgrade dependencies" were lost again. Unfortunately, it also lost the bump of memmap2 to 0.5.3, which is needed for Fedora packaging where 0.4 isn't available. Same with micro-timer bump to 0.4 (which already is used in rhg). crossbeam-channel bump was also lost. This change fixes that regression by redoing these "important" lines of the merge "correctly". I propose this for stable, even though dependency changes on stable branches are annoying.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
45830
c102b704edb5 global: use python3 in shebangs
Gregory Szorc <gregory.szorc@gmail.com>
parents: 43659
diff changeset
     1
#!/usr/bin/env python3
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
     2
#
1698
ad4a2eefe4d7 Update copyright notice
Matt Mackall <mpm@selenic.com>
parents: 515
diff changeset
     3
# mercurial - scalable distributed SCM
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
     4
#
46819
d4ba4d51f85f contributor: change mentions of mpm to olivia
Raphaël Gomès <rgomes@octobus.net>
parents: 46055
diff changeset
     5
# Copyright 2005-2007 Olivia Mackall <olivia@selenic.com>
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
     6
#
8225
46293a0c7e9f updated license to be explicit about GPL version 2
Martin Geisler <mg@lazybytes.net>
parents: 7672
diff changeset
     7
# This software may be used and distributed according to the terms of the
10263
25e572394f5c Update license to GPLv2+
Matt Mackall <mpm@selenic.com>
parents: 8225
diff changeset
     8
# GNU General Public License version 2 or any later version.
0
9117c6561b0b Add back links from file revisions to changeset revisions
mpm@selenic.com
parents:
diff changeset
     9
12661
10da5a1f25dd setup/hg: always load Mercurial from where it was installed.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 10263
diff changeset
    10
import os
10da5a1f25dd setup/hg: always load Mercurial from where it was installed.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 10263
diff changeset
    11
import sys
10da5a1f25dd setup/hg: always load Mercurial from where it was installed.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 10263
diff changeset
    12
10da5a1f25dd setup/hg: always load Mercurial from where it was installed.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 10263
diff changeset
    13
libdir = '@LIBDIR@'
10da5a1f25dd setup/hg: always load Mercurial from where it was installed.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 10263
diff changeset
    14
10da5a1f25dd setup/hg: always load Mercurial from where it was installed.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 10263
diff changeset
    15
if libdir != '@' 'LIBDIR' '@':
10da5a1f25dd setup/hg: always load Mercurial from where it was installed.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 10263
diff changeset
    16
    if not os.path.isabs(libdir):
43659
99e231afc29c black: blacken scripts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 43073
diff changeset
    17
        libdir = os.path.join(
99e231afc29c black: blacken scripts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 43073
diff changeset
    18
            os.path.dirname(os.path.realpath(__file__)), libdir
99e231afc29c black: blacken scripts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 43073
diff changeset
    19
        )
12661
10da5a1f25dd setup/hg: always load Mercurial from where it was installed.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 10263
diff changeset
    20
        libdir = os.path.abspath(libdir)
10da5a1f25dd setup/hg: always load Mercurial from where it was installed.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 10263
diff changeset
    21
    sys.path.insert(0, libdir)
10da5a1f25dd setup/hg: always load Mercurial from where it was installed.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 10263
diff changeset
    22
46055
7740d5102760 hg: add user-site to `sys.path` on Windows to allow pip-installed extensions
Matt Harbison <matt_harbison@yahoo.com>
parents: 45830
diff changeset
    23
# Make `pip install --user ...` packages available to the official Windows
7740d5102760 hg: add user-site to `sys.path` on Windows to allow pip-installed extensions
Matt Harbison <matt_harbison@yahoo.com>
parents: 45830
diff changeset
    24
# build.  Most py2 packaging installs directly into the system python
7740d5102760 hg: add user-site to `sys.path` on Windows to allow pip-installed extensions
Matt Harbison <matt_harbison@yahoo.com>
parents: 45830
diff changeset
    25
# environment, so no changes are necessary for other platforms.  The Windows
7740d5102760 hg: add user-site to `sys.path` on Windows to allow pip-installed extensions
Matt Harbison <matt_harbison@yahoo.com>
parents: 45830
diff changeset
    26
# py2 package uses py2exe, which lacks a `site` module.  Hardcode it according
7740d5102760 hg: add user-site to `sys.path` on Windows to allow pip-installed extensions
Matt Harbison <matt_harbison@yahoo.com>
parents: 45830
diff changeset
    27
# to the documentation.
7740d5102760 hg: add user-site to `sys.path` on Windows to allow pip-installed extensions
Matt Harbison <matt_harbison@yahoo.com>
parents: 45830
diff changeset
    28
if getattr(sys, 'frozen', None) == 'console_exe':
7740d5102760 hg: add user-site to `sys.path` on Windows to allow pip-installed extensions
Matt Harbison <matt_harbison@yahoo.com>
parents: 45830
diff changeset
    29
    vi = sys.version_info
47880
769cd5703b2c hg: don't attempt to extend `sys.path` with the user site without `APPDATA`
Matt Harbison <matt_harbison@yahoo.com>
parents: 46819
diff changeset
    30
    appdata = os.environ.get('APPDATA')
769cd5703b2c hg: don't attempt to extend `sys.path` with the user site without `APPDATA`
Matt Harbison <matt_harbison@yahoo.com>
parents: 46819
diff changeset
    31
    if appdata:
769cd5703b2c hg: don't attempt to extend `sys.path` with the user site without `APPDATA`
Matt Harbison <matt_harbison@yahoo.com>
parents: 46819
diff changeset
    32
        sys.path.append(
769cd5703b2c hg: don't attempt to extend `sys.path` with the user site without `APPDATA`
Matt Harbison <matt_harbison@yahoo.com>
parents: 46819
diff changeset
    33
            os.path.join(
769cd5703b2c hg: don't attempt to extend `sys.path` with the user site without `APPDATA`
Matt Harbison <matt_harbison@yahoo.com>
parents: 46819
diff changeset
    34
                appdata,
769cd5703b2c hg: don't attempt to extend `sys.path` with the user site without `APPDATA`
Matt Harbison <matt_harbison@yahoo.com>
parents: 46819
diff changeset
    35
                'Python',
769cd5703b2c hg: don't attempt to extend `sys.path` with the user site without `APPDATA`
Matt Harbison <matt_harbison@yahoo.com>
parents: 46819
diff changeset
    36
                'Python%d%d' % (vi[0], vi[1]),
769cd5703b2c hg: don't attempt to extend `sys.path` with the user site without `APPDATA`
Matt Harbison <matt_harbison@yahoo.com>
parents: 46819
diff changeset
    37
                'site-packages',
769cd5703b2c hg: don't attempt to extend `sys.path` with the user site without `APPDATA`
Matt Harbison <matt_harbison@yahoo.com>
parents: 46819
diff changeset
    38
            )
46055
7740d5102760 hg: add user-site to `sys.path` on Windows to allow pip-installed extensions
Matt Harbison <matt_harbison@yahoo.com>
parents: 45830
diff changeset
    39
        )
7740d5102760 hg: add user-site to `sys.path` on Windows to allow pip-installed extensions
Matt Harbison <matt_harbison@yahoo.com>
parents: 45830
diff changeset
    40
39592
5e78c100a215 hg: wrap the highest layer in the `hg` script possible in trace event
Augie Fackler <augie@google.com>
parents: 34533
diff changeset
    41
from hgdemandimport import tracing
43659
99e231afc29c black: blacken scripts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 43073
diff changeset
    42
39592
5e78c100a215 hg: wrap the highest layer in the `hg` script possible in trace event
Augie Fackler <augie@google.com>
parents: 34533
diff changeset
    43
with tracing.log('hg script'):
5e78c100a215 hg: wrap the highest layer in the `hg` script possible in trace event
Augie Fackler <augie@google.com>
parents: 34533
diff changeset
    44
    # enable importing on demand to reduce startup time
5e78c100a215 hg: wrap the highest layer in the `hg` script possible in trace event
Augie Fackler <augie@google.com>
parents: 34533
diff changeset
    45
    try:
48957
edab75a4c1da hg: always import hgdemandimport
Gregory Szorc <gregory.szorc@gmail.com>
parents: 48875
diff changeset
    46
        import hgdemandimport
43659
99e231afc29c black: blacken scripts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 43073
diff changeset
    47
48957
edab75a4c1da hg: always import hgdemandimport
Gregory Szorc <gregory.szorc@gmail.com>
parents: 48875
diff changeset
    48
        hgdemandimport.enable()
39592
5e78c100a215 hg: wrap the highest layer in the `hg` script possible in trace event
Augie Fackler <augie@google.com>
parents: 34533
diff changeset
    49
    except ImportError:
43659
99e231afc29c black: blacken scripts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 43073
diff changeset
    50
        sys.stderr.write(
99e231afc29c black: blacken scripts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 43073
diff changeset
    51
            "abort: couldn't find mercurial libraries in [%s]\n"
99e231afc29c black: blacken scripts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 43073
diff changeset
    52
            % ' '.join(sys.path)
99e231afc29c black: blacken scripts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 43073
diff changeset
    53
        )
39592
5e78c100a215 hg: wrap the highest layer in the `hg` script possible in trace event
Augie Fackler <augie@google.com>
parents: 34533
diff changeset
    54
        sys.stderr.write("(check your install and PYTHONPATH)\n")
5e78c100a215 hg: wrap the highest layer in the `hg` script possible in trace event
Augie Fackler <augie@google.com>
parents: 34533
diff changeset
    55
        sys.exit(-1)
5197
55860a45bbf2 Enable demandimport only in scripts, not in importable modules (issue605)
Thomas Arendsen Hein <thomas@intevation.de>
parents: 5178
diff changeset
    56
39592
5e78c100a215 hg: wrap the highest layer in the `hg` script possible in trace event
Augie Fackler <augie@google.com>
parents: 34533
diff changeset
    57
    from mercurial import dispatch
43659
99e231afc29c black: blacken scripts
Gregory Szorc <gregory.szorc@gmail.com>
parents: 43073
diff changeset
    58
39592
5e78c100a215 hg: wrap the highest layer in the `hg` script possible in trace event
Augie Fackler <augie@google.com>
parents: 34533
diff changeset
    59
    dispatch.run()