tests/test-debugextensions.t
author Matt Harbison <matt_harbison@yahoo.com>
Tue, 06 Sep 2022 15:08:52 -0400
branchstable
changeset 49490 37debd850c16
parent 37342 4e6a6d0dccee
child 49835 4836705ab9ba
permissions -rw-r--r--
packaging: update dulwich to drop the certifi dependency on Windows The presence of `certifi` causes the system certificate store to be ignored, which was reported as a bug against TortoiseHg[1]. It was only pulled in on Windows because of `dulwich`, which was copied from the old TortoiseHg install scripts, in order to support `hg-git`. This version of `dulwich` raises the minimum `urllib3` to a version (1.25) that does certificate verification by default, without the help of `certifi`[2]. We already bundle a newer version of `urllib3`. Note that `certifi` can still be imported from the user site directory, if installed there. But the installer no longer disables the system certificates by default. [1] https://foss.heptapod.net/mercurial/tortoisehg/thg/-/issues/5825 [2] https://github.com/jelmer/dulwich/issues/1025

#if no-extraextensions
  $ hg debugextensions
#endif

  $ debugpath=`pwd`/extwithoutinfos.py

  $ cat > extwithoutinfos.py <<EOF
  > EOF
  $ cat > extwithinfos.py <<EOF
  > testedwith = b'3.0 3.1 3.2.1'
  > buglink = b'https://example.org/bts'
  > EOF

  $ cat >> $HGRCPATH <<EOF
  > [extensions]
  > histedit=
  > patchbomb=
  > rebase=
  > mq=
  > ext1 = $debugpath
  > ext2 = `pwd`/extwithinfos.py
  > EOF

  $ for extension in $HGTESTEXTRAEXTENSIONS; do
  >     echo "$extension=!" >> $HGRCPATH
  > done

  $ hg debugextensions
  ext1 (untested!)
  ext2 (3.2.1!)
  histedit
  mq
  patchbomb
  rebase

  $ hg debugextensions -v
  ext1
    location: */extwithoutinfos.py* (glob)
    bundled: no
  ext2
    location: */extwithinfos.py* (glob)
    bundled: no
    tested with: 3.0 3.1 3.2.1
    bug reporting: https://example.org/bts
  histedit
    location: */hgext/histedit.py* (glob)
    bundled: yes
  mq
    location: */hgext/mq.py* (glob)
    bundled: yes
  patchbomb
    location: */hgext/patchbomb.py* (glob)
    bundled: yes
  rebase
    location: */hgext/rebase.py* (glob)
    bundled: yes

  $ hg debugextensions -Tjson | sed 's|\\\\|/|g'
  [
   {
    "buglink": "",
    "bundled": false,
    "name": "ext1",
    "source": "*/extwithoutinfos.py*", (glob)
    "testedwith": []
   },
   {
    "buglink": "https://example.org/bts",
    "bundled": false,
    "name": "ext2",
    "source": "*/extwithinfos.py*", (glob)
    "testedwith": ["3.0", "3.1", "3.2.1"]
   },
   {
    "buglink": "",
    "bundled": true,
    "name": "histedit",
    "source": "*/hgext/histedit.py*", (glob)
    "testedwith": []
   },
   {
    "buglink": "",
    "bundled": true,
    "name": "mq",
    "source": "*/hgext/mq.py*", (glob)
    "testedwith": []
   },
   {
    "buglink": "",
    "bundled": true,
    "name": "patchbomb",
    "source": "*/hgext/patchbomb.py*", (glob)
    "testedwith": []
   },
   {
    "buglink": "",
    "bundled": true,
    "name": "rebase",
    "source": "*/hgext/rebase.py*", (glob)
    "testedwith": []
   }
  ]

  $ hg debugextensions -T '{ifcontains("3.1", testedwith, "{name}\n")}'
  ext2
  $ hg debugextensions \
  > -T '{ifcontains("3.2", testedwith, "no substring match: {name}\n")}'