Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
mercurial-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
8
Issues
8
List
Boards
Labels
Service Desk
Milestones
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
octobus
mercurial-devel
Commits
26ce8e751503
Commit
8e204f73
authored
Apr 16, 2020
by
Pulkit Goyal
Browse files
Options
Browse Files
Download
Plain Diff
merge default into stable for 5.4 release
--HG-- branch : stable
parents
539490756a72
59ad165f6cdb
Pipeline
#5150
passed with stage
in 39 minutes and 56 seconds
Changes
402
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
402 changed files
with
32124 additions
and
5728 deletions
+32124
-5728
Makefile
Makefile
+1
-0
black.toml
black.toml
+0
-1
contrib/benchmarks/__init__.py
contrib/benchmarks/__init__.py
+1
-1
contrib/check-py3-compat.py
contrib/check-py3-compat.py
+1
-1
contrib/chg/chg.c
contrib/chg/chg.c
+17
-3
contrib/examples/fix.hgrc
contrib/examples/fix.hgrc
+1
-1
contrib/heptapod-ci.yml
contrib/heptapod-ci.yml
+4
-4
contrib/import-checker.py
contrib/import-checker.py
+2
-1
contrib/packaging/pyoxidizer.bzl
contrib/packaging/pyoxidizer.bzl
+60
-0
contrib/perf.py
contrib/perf.py
+3
-2
contrib/phab-clean.py
contrib/phab-clean.py
+93
-0
contrib/python-zstandard/make_cffi.py
contrib/python-zstandard/make_cffi.py
+5
-2
contrib/python-zstandard/setup.py
contrib/python-zstandard/setup.py
+3
-1
contrib/python-zstandard/setup_zstd.py
contrib/python-zstandard/setup_zstd.py
+6
-2
contrib/python-zstandard/tests/common.py
contrib/python-zstandard/tests/common.py
+9
-3
contrib/python-zstandard/tests/test_buffer_util.py
contrib/python-zstandard/tests/test_buffer_util.py
+11
-4
contrib/python-zstandard/tests/test_compressor.py
contrib/python-zstandard/tests/test_compressor.py
+51
-18
contrib/python-zstandard/tests/test_compressor_fuzzing.py
contrib/python-zstandard/tests/test_compressor_fuzzing.py
+71
-23
contrib/python-zstandard/tests/test_data_structures.py
contrib/python-zstandard/tests/test_data_structures.py
+21
-7
contrib/python-zstandard/tests/test_data_structures_fuzzing.py
...ib/python-zstandard/tests/test_data_structures_fuzzing.py
+19
-3
contrib/python-zstandard/tests/test_decompressor.py
contrib/python-zstandard/tests/test_decompressor.py
+67
-23
contrib/python-zstandard/tests/test_decompressor_fuzzing.py
contrib/python-zstandard/tests/test_decompressor_fuzzing.py
+26
-9
contrib/python-zstandard/tests/test_train_dictionary.py
contrib/python-zstandard/tests/test_train_dictionary.py
+15
-5
contrib/python-zstandard/zstandard/cffi.py
contrib/python-zstandard/zstandard/cffi.py
+232
-78
doc/Makefile
doc/Makefile
+1
-1
hgext/absorb.py
hgext/absorb.py
+5
-5
hgext/beautifygraph.py
hgext/beautifygraph.py
+2
-0
hgext/closehead.py
hgext/closehead.py
+1
-1
hgext/convert/hg.py
hgext/convert/hg.py
+3
-7
hgext/convert/subversion.py
hgext/convert/subversion.py
+3
-3
hgext/eol.py
hgext/eol.py
+1
-1
hgext/fastannotate/commands.py
hgext/fastannotate/commands.py
+1
-1
hgext/fastexport.py
hgext/fastexport.py
+219
-0
hgext/fetch.py
hgext/fetch.py
+3
-3
hgext/fix.py
hgext/fix.py
+33
-21
hgext/fsmonitor/__init__.py
hgext/fsmonitor/__init__.py
+10
-16
hgext/git/TODO.md
hgext/git/TODO.md
+30
-0
hgext/git/__init__.py
hgext/git/__init__.py
+318
-0
hgext/git/dirstate.py
hgext/git/dirstate.py
+307
-0
hgext/git/gitlog.py
hgext/git/gitlog.py
+466
-0
hgext/git/gitutil.py
hgext/git/gitutil.py
+40
-0
hgext/git/index.py
hgext/git/index.py
+350
-0
hgext/git/manifest.py
hgext/git/manifest.py
+297
-0
hgext/hgk.py
hgext/hgk.py
+1
-1
hgext/histedit.py
hgext/histedit.py
+17
-8
hgext/hooklib/__init__.py
hgext/hooklib/__init__.py
+26
-0
hgext/hooklib/changeset_obsoleted.py
hgext/hooklib/changeset_obsoleted.py
+131
-0
hgext/hooklib/changeset_published.py
hgext/hooklib/changeset_published.py
+131
-0
hgext/hooklib/enforce_draft_commits.py
hgext/hooklib/enforce_draft_commits.py
+45
-0
hgext/hooklib/reject_merge_commits.py
hgext/hooklib/reject_merge_commits.py
+45
-0
hgext/hooklib/reject_new_heads.py
hgext/hooklib/reject_new_heads.py
+41
-0
hgext/largefiles/basestore.py
hgext/largefiles/basestore.py
+1
-1
hgext/largefiles/lfutil.py
hgext/largefiles/lfutil.py
+22
-1
hgext/largefiles/overrides.py
hgext/largefiles/overrides.py
+2
-2
hgext/largefiles/remotestore.py
hgext/largefiles/remotestore.py
+3
-3
hgext/lfs/TODO.rst
hgext/lfs/TODO.rst
+0
-3
hgext/lfs/__init__.py
hgext/lfs/__init__.py
+1
-1
hgext/lfs/blobstore.py
hgext/lfs/blobstore.py
+31
-31
hgext/logtoprocess.py
hgext/logtoprocess.py
+7
-0
hgext/mq.py
hgext/mq.py
+3
-3
hgext/notify.py
hgext/notify.py
+43
-0
hgext/phabricator.py
hgext/phabricator.py
+667
-192
hgext/purge.py
hgext/purge.py
+11
-2
hgext/rebase.py
hgext/rebase.py
+77
-105
hgext/releasenotes.py
hgext/releasenotes.py
+1
-1
hgext/remotefilelog/__init__.py
hgext/remotefilelog/__init__.py
+1
-1
hgext/remotefilelog/basepack.py
hgext/remotefilelog/basepack.py
+2
-2
hgext/remotefilelog/contentstore.py
hgext/remotefilelog/contentstore.py
+1
-1
hgext/remotefilelog/datapack.py
hgext/remotefilelog/datapack.py
+2
-2
hgext/remotefilelog/historypack.py
hgext/remotefilelog/historypack.py
+4
-4
hgext/remotefilelog/remotefilelog.py
hgext/remotefilelog/remotefilelog.py
+6
-2
hgext/remotefilelog/repack.py
hgext/remotefilelog/repack.py
+1
-1
hgext/schemes.py
hgext/schemes.py
+1
-1
hgext/sparse.py
hgext/sparse.py
+1
-1
hgext/strip.py
hgext/strip.py
+1
-1
hgext/transplant.py
hgext/transplant.py
+4
-4
hgext/uncommit.py
hgext/uncommit.py
+4
-4
i18n/polib.py
i18n/polib.py
+5
-5
mercurial/ancestor.py
mercurial/ancestor.py
+1
-37
mercurial/archival.py
mercurial/archival.py
+1
-1
mercurial/bookmarks.py
mercurial/bookmarks.py
+9
-1
mercurial/branchmap.py
mercurial/branchmap.py
+4
-4
mercurial/bundle2.py
mercurial/bundle2.py
+5
-0
mercurial/cext/manifest.c
mercurial/cext/manifest.c
+28
-9
mercurial/cext/osutil.c
mercurial/cext/osutil.c
+3
-2
mercurial/cext/revlog.c
mercurial/cext/revlog.c
+6
-174
mercurial/cext/revlog.h
mercurial/cext/revlog.h
+0
-2
mercurial/changegroup.py
mercurial/changegroup.py
+4
-6
mercurial/changelog.py
mercurial/changelog.py
+13
-7
mercurial/chgserver.py
mercurial/chgserver.py
+14
-35
mercurial/cmdutil.py
mercurial/cmdutil.py
+154
-41
mercurial/color.py
mercurial/color.py
+1
-1
mercurial/commands.py
mercurial/commands.py
+53
-42
mercurial/commandserver.py
mercurial/commandserver.py
+4
-0
mercurial/configitems.py
mercurial/configitems.py
+26
-2
mercurial/context.py
mercurial/context.py
+13
-3
mercurial/copies.py
mercurial/copies.py
+116
-70
mercurial/crecord.py
mercurial/crecord.py
+2
-2
mercurial/dagop.py
mercurial/dagop.py
+241
-0
mercurial/debugcommands.py
mercurial/debugcommands.py
+334
-110
mercurial/dirstate.py
mercurial/dirstate.py
+57
-19
mercurial/discovery.py
mercurial/discovery.py
+4
-4
mercurial/dispatch.py
mercurial/dispatch.py
+47
-3
mercurial/encoding.py
mercurial/encoding.py
+6
-6
mercurial/exchange.py
mercurial/exchange.py
+44
-4
mercurial/extensions.py
mercurial/extensions.py
+5
-15
mercurial/fancyopts.py
mercurial/fancyopts.py
+1
-1
mercurial/graphmod.py
mercurial/graphmod.py
+3
-3
mercurial/hbisect.py
mercurial/hbisect.py
+1
-1
mercurial/help.py
mercurial/help.py
+29
-7
mercurial/helptext/config.txt
mercurial/helptext/config.txt
+6
-5
mercurial/hg.py
mercurial/hg.py
+15
-24
mercurial/hgweb/webutil.py
mercurial/hgweb/webutil.py
+1
-1
mercurial/hook.py
mercurial/hook.py
+35
-25
mercurial/httpconnection.py
mercurial/httpconnection.py
+4
-1
mercurial/interfaces/repository.py
mercurial/interfaces/repository.py
+5
-19
mercurial/localrepo.py
mercurial/localrepo.py
+60
-35
mercurial/logcmdutil.py
mercurial/logcmdutil.py
+3
-2
mercurial/manifest.py
mercurial/manifest.py
+82
-59
mercurial/match.py
mercurial/match.py
+6
-24
mercurial/mdiff.py
mercurial/mdiff.py
+1
-1
mercurial/merge.py
mercurial/merge.py
+178
-66
mercurial/namespaces.py
mercurial/namespaces.py
+3
-0
mercurial/narrowspec.py
mercurial/narrowspec.py
+0
-15
mercurial/obsolete.py
mercurial/obsolete.py
+2
-2
mercurial/obsutil.py
mercurial/obsutil.py
+7
-7
mercurial/patch.py
mercurial/patch.py
+1
-1
mercurial/pathutil.py
mercurial/pathutil.py
+10
-8
mercurial/phases.py
mercurial/phases.py
+97
-14
mercurial/posix.py
mercurial/posix.py
+2
-3
mercurial/profiling.py
mercurial/profiling.py
+8
-0
mercurial/pure/parsers.py
mercurial/pure/parsers.py
+50
-0
mercurial/pvec.py
mercurial/pvec.py
+1
-1
mercurial/pycompat.py
mercurial/pycompat.py
+32
-10
mercurial/repair.py
mercurial/repair.py
+1
-1
mercurial/revlog.py
mercurial/revlog.py
+81
-5
mercurial/revlogutils/nodemap.py
mercurial/revlogutils/nodemap.py
+614
-1
mercurial/revset.py
mercurial/revset.py
+80
-20
mercurial/scmutil.py
mercurial/scmutil.py
+26
-17
mercurial/shelve.py
mercurial/shelve.py
+6
-11
mercurial/store.py
mercurial/store.py
+2
-2
mercurial/subrepo.py
mercurial/subrepo.py
+1
-1
mercurial/tags.py
mercurial/tags.py
+11
-6
mercurial/templatefilters.py
mercurial/templatefilters.py
+9
-0
mercurial/templatefuncs.py
mercurial/templatefuncs.py
+46
-4
mercurial/templatekw.py
mercurial/templatekw.py
+24
-24
mercurial/templater.py
mercurial/templater.py
+3
-0
mercurial/templateutil.py
mercurial/templateutil.py
+74
-0
mercurial/transaction.py
mercurial/transaction.py
+34
-19
mercurial/ui.py
mercurial/ui.py
+1
-25
mercurial/upgrade.py
mercurial/upgrade.py
+9
-2
mercurial/url.py
mercurial/url.py
+8
-8
mercurial/util.py
mercurial/util.py
+13
-3
mercurial/utils/storageutil.py
mercurial/utils/storageutil.py
+1
-1
mercurial/vfs.py
mercurial/vfs.py
+1
-1
mercurial/windows.py
mercurial/windows.py
+5
-7
mercurial/wireprototypes.py
mercurial/wireprototypes.py
+2
-2
relnotes/next
relnotes/next
+79
-0
rust/Cargo.lock
rust/Cargo.lock
+414
-211
rust/Cargo.toml
rust/Cargo.toml
+1
-1
rust/README.rst
rust/README.rst
+87
-12
rust/chg/Cargo.lock
rust/chg/Cargo.lock
+323
-311
rust/chg/Cargo.toml
rust/chg/Cargo.toml
+2
-2
rust/chg/build.rs
rust/chg/build.rs
+0
-2
rust/chg/src/attachio.rs
rust/chg/src/attachio.rs
+3
-3
rust/chg/src/clientext.rs
rust/chg/src/clientext.rs
+74
-18
rust/chg/src/lib.rs
rust/chg/src/lib.rs
+0
-8
rust/chg/src/locator.rs
rust/chg/src/locator.rs
+362
-8
rust/chg/src/main.rs
rust/chg/src/main.rs
+12
-15
rust/chg/src/message.rs
rust/chg/src/message.rs
+185
-9
rust/chg/src/procutil.rs
rust/chg/src/procutil.rs
+13
-0
rust/chg/src/runcommand.rs
rust/chg/src/runcommand.rs
+29
-28
rust/chg/src/uihandler.rs
rust/chg/src/uihandler.rs
+2
-2
rust/hg-core/Cargo.toml
rust/hg-core/Cargo.toml
+28
-7
rust/hg-core/build.rs
rust/hg-core/build.rs
+61
-0
rust/hg-core/examples/nodemap/index.rs
rust/hg-core/examples/nodemap/index.rs
+95
-0
rust/hg-core/examples/nodemap/main.rs
rust/hg-core/examples/nodemap/main.rs
+146
-0
rust/hg-core/src/dirstate/dirs_multiset.rs
rust/hg-core/src/dirstate/dirs_multiset.rs
+77
-5
rust/hg-core/src/dirstate/dirstate_map.rs
rust/hg-core/src/dirstate/dirstate_map.rs
+29
-38
rust/hg-core/src/dirstate/parsers.rs
rust/hg-core/src/dirstate/parsers.rs
+2
-0
rust/hg-core/src/dirstate/status.rs
rust/hg-core/src/dirstate/status.rs
+708
-103
rust/hg-core/src/discovery.rs
rust/hg-core/src/discovery.rs
+2
-2
rust/hg-core/src/filepatterns.rs
rust/hg-core/src/filepatterns.rs
+343
-58
rust/hg-core/src/lib.rs
rust/hg-core/src/lib.rs
+64
-17
rust/hg-core/src/matchers.rs
rust/hg-core/src/matchers.rs
+753
-6
rust/hg-core/src/re2/mod.rs
rust/hg-core/src/re2/mod.rs
+21
-0
rust/hg-core/src/re2/re2.rs
rust/hg-core/src/re2/re2.rs
+66
-0
rust/hg-core/src/re2/rust_re2.cpp
rust/hg-core/src/re2/rust_re2.cpp
+49
-0
rust/hg-core/src/revlog.rs
rust/hg-core/src/revlog.rs
+18
-0
rust/hg-core/src/revlog/node.rs
rust/hg-core/src/revlog/node.rs
+429
-0
rust/hg-core/src/revlog/nodemap.rs
rust/hg-core/src/revlog/nodemap.rs
+1122
-0
rust/hg-core/src/utils.rs
rust/hg-core/src/utils.rs
+55
-0
rust/hg-core/src/utils/files.rs
rust/hg-core/src/utils/files.rs
+252
-4
rust/hg-core/src/utils/hg_path.rs
rust/hg-core/src/utils/hg_path.rs
+313
-21
rust/hg-core/src/utils/path_auditor.rs
rust/hg-core/src/utils/path_auditor.rs
+232
-0
rust/hg-core/tests/test_missing_ancestors.rs
rust/hg-core/tests/test_missing_ancestors.rs
+3
-2
rust/hg-cpython/Cargo.toml
rust/hg-cpython/Cargo.toml
+5
-2
rust/hg-cpython/src/cindex.rs
rust/hg-cpython/src/cindex.rs
+48
-2
rust/hg-cpython/src/debug.rs
rust/hg-cpython/src/debug.rs
+26
-0
rust/hg-cpython/src/dirstate.rs
rust/hg-cpython/src/dirstate.rs
+19
-6
rust/hg-cpython/src/dirstate/copymap.rs
rust/hg-cpython/src/dirstate/copymap.rs
+5
-4
rust/hg-cpython/src/dirstate/dirs_multiset.rs
rust/hg-cpython/src/dirstate/dirs_multiset.rs
+9
-15
rust/hg-cpython/src/dirstate/dirstate_map.rs
rust/hg-cpython/src/dirstate/dirstate_map.rs
+71
-67
rust/hg-cpython/src/dirstate/non_normal_entries.rs
rust/hg-cpython/src/dirstate/non_normal_entries.rs
+26
-2
rust/hg-cpython/src/dirstate/status.rs
rust/hg-cpython/src/dirstate/status.rs
+203
-35
rust/hg-cpython/src/exceptions.rs
rust/hg-cpython/src/exceptions.rs
+2
-30
rust/hg-cpython/src/filepatterns.rs
rust/hg-cpython/src/filepatterns.rs
+0
-133
rust/hg-cpython/src/lib.rs
rust/hg-cpython/src/lib.rs
+2
-16
rust/hg-cpython/src/ref_sharing.rs
rust/hg-cpython/src/ref_sharing.rs
+11
-526
rust/hg-cpython/src/revlog.rs
rust/hg-cpython/src/revlog.rs
+304
-43
rust/hg-cpython/src/utils.rs
rust/hg-cpython/src/utils.rs
+35
-1
rust/hg-direct-ffi/Cargo.toml
rust/hg-direct-ffi/Cargo.toml
+0
-12
rust/hg-direct-ffi/rustfmt.toml
rust/hg-direct-ffi/rustfmt.toml
+0
-3
rust/hg-direct-ffi/src/ancestors.rs
rust/hg-direct-ffi/src/ancestors.rs
+0
-282
rust/hg-direct-ffi/src/lib.rs
rust/hg-direct-ffi/src/lib.rs
+0
-19
rust/hgcli/.cargo/config
rust/hgcli/.cargo/config
+13
-0
rust/hgcli/Cargo.lock
rust/hgcli/Cargo.lock
+281
-58
rust/hgcli/Cargo.toml
rust/hgcli/Cargo.toml
+12
-23
rust/hgcli/README.md
rust/hgcli/README.md
+50
-0
rust/hgcli/README.rst
rust/hgcli/README.rst
+0
-58
rust/hgcli/build.rs
rust/hgcli/build.rs
+11
-121
rust/hgcli/pyoxidizer.bzl
rust/hgcli/pyoxidizer.bzl
+59
-0
rust/hgcli/src/main.rs
rust/hgcli/src/main.rs
+31
-212
setup.py
setup.py
+78
-54
tests/common-pattern.py
tests/common-pattern.py
+4
-0
tests/drawdag.py
tests/drawdag.py
+3
-3
tests/filtertraceback.py
tests/filtertraceback.py
+11
-0
tests/fsmonitor-run-tests.py
tests/fsmonitor-run-tests.py
+4
-4
tests/hghave.py
tests/hghave.py
+49
-14
tests/phabricator/phabimport-multi-drev.json
tests/phabricator/phabimport-multi-drev.json
+277
-0
tests/phabricator/phabimport-stack.json
tests/phabricator/phabimport-stack.json
+277
-0
tests/phabricator/phabread-empty-drev.json
tests/phabricator/phabread-empty-drev.json
+73
-0
tests/phabricator/phabread-multi-drev.json
tests/phabricator/phabread-multi-drev.json
+345
-0
tests/phabricator/phabsend-add-parent-setup.json
tests/phabricator/phabsend-add-parent-setup.json
+617
-0
tests/phabricator/phabsend-add-parent.json
tests/phabricator/phabsend-add-parent.json
+1093
-0
tests/phabricator/phabsend-fold-extend-end.json
tests/phabricator/phabsend-fold-extend-end.json
+889
-0
tests/phabricator/phabsend-fold-extend-front.json
tests/phabricator/phabsend-fold-extend-front.json
+960
-0
tests/phabricator/phabsend-fold-fold-end.json
tests/phabricator/phabsend-fold-fold-end.json
+957
-0
tests/phabricator/phabsend-fold-immutable.json
tests/phabricator/phabsend-fold-immutable.json
+617
-0
tests/phabricator/phabsend-fold-initial.json
tests/phabricator/phabsend-fold-initial.json
+753
-0
tests/phabricator/phabsend-fold-no-changes.json
tests/phabricator/phabsend-fold-no-changes.json
+685
-0
tests/phabricator/phabsend-fold-split-end.json
tests/phabricator/phabsend-fold-split-end.json
+1028
-0
tests/phabricator/phabsend-fold-updated.json
tests/phabricator/phabsend-fold-updated.json
+824
-0
tests/phabricator/phabsend-no-restack-orphan.json
tests/phabricator/phabsend-no-restack-orphan.json
+1229
-0
tests/run-tests.py
tests/run-tests.py
+126
-103
tests/simplestorerepo.py
tests/simplestorerepo.py
+1
-1
tests/test-acl.t
tests/test-acl.t
+163
-125
tests/test-archive.t
tests/test-archive.t
+8
-4
tests/test-audit-subrepo.t
tests/test-audit-subrepo.t
+42
-14
tests/test-backout.t
tests/test-backout.t
+55
-10
tests/test-backwards-remove.t
tests/test-backwards-remove.t
+4
-2
tests/test-bad-extension.t
tests/test-bad-extension.t
+1
-0
tests/test-bisect.t
tests/test-bisect.t
+1
-1
tests/test-bookmarks-pushpull.t
tests/test-bookmarks-pushpull.t
+19
-8
tests/test-check-format.t
tests/test-check-format.t
+1
-1
tests/test-check-interfaces.py
tests/test-check-interfaces.py
+1
-1
tests/test-check-module-imports.t
tests/test-check-module-imports.t
+1
-0
tests/test-check-pyflakes.t
tests/test-check-pyflakes.t
+1
-1
tests/test-chg.t
tests/test-chg.t
+17
-4
tests/test-clone-uncompressed.t
tests/test-clone-uncompressed.t
+4
-0
tests/test-clone.t
tests/test-clone.t
+2
-1
tests/test-clonebundles.t
tests/test-clonebundles.t
+14
-1
tests/test-commit-unresolved.t
tests/test-commit-unresolved.t
+2
-2
tests/test-completion.t
tests/test-completion.t
+9
-3
tests/test-convert-cvs-branch.t
tests/test-convert-cvs-branch.t
+1
-1
tests/test-convert-cvs-detectmerge.t
tests/test-convert-cvs-detectmerge.t
+1
-1
tests/test-convert-cvs-synthetic.t
tests/test-convert-cvs-synthetic.t
+1
-1
tests/test-convert-cvs.t
tests/test-convert-cvs.t
+1
-1
tests/test-convert-cvsnt-mergepoints.t
tests/test-convert-cvsnt-mergepoints.t
+1
-1
tests/test-convert-hg-source.t
tests/test-convert-hg-source.t
+7
-7
tests/test-copies-chain-merge.t
tests/test-copies-chain-merge.t
+798
-0
tests/test-copies-unrelated.t
tests/test-copies-unrelated.t
+6
-6
tests/test-copy-move-merge.t
tests/test-copy-move-merge.t
+89
-5
tests/test-copy.t
tests/test-copy.t
+108
-0
tests/test-copytrace-heuristics.t
tests/test-copytrace-heuristics.t
+12
-6
tests/test-debugbackupbundle.t
tests/test-debugbackupbundle.t
+39
-0
tests/test-debugcommands.t
tests/test-debugcommands.t
+9
-7
tests/test-devel-warnings.t
tests/test-devel-warnings.t
+3
-0
tests/test-doctest.py
tests/test-doctest.py
+121
-44
tests/test-double-merge.t
tests/test-double-merge.t
+2
-1
tests/test-extension-timing.t
tests/test-extension-timing.t
+2
-0
tests/test-fastannotate-revmap.py
tests/test-fastannotate-revmap.py
+1
-1
tests/test-fastexport.t
tests/test-fastexport.t
+865
-0
tests/test-fetch.t
tests/test-fetch.t
+2
-1
tests/test-fix-topology.t
tests/test-fix-topology.t
+110
-5
tests/test-fix.t
tests/test-fix.t
+6
-6
tests/test-fncache.t
tests/test-fncache.t
+1
-1
tests/test-git-interop.t
tests/test-git-interop.t
+250
-0
tests/test-graft-interrupted.t
tests/test-graft-interrupted.t
+17
-17
tests/test-graft.t
tests/test-graft.t
+21
-13
tests/test-help.t
tests/test-help.t
+12
-0
tests/test-hgrc.t
tests/test-hgrc.t
+1
-1
tests/test-hgweb-auth.py
tests/test-hgweb-auth.py
+1
-1
tests/test-histedit-non-commute-abort.t
tests/test-histedit-non-commute-abort.t
+9
-23
tests/test-histedit-non-commute.t
tests/test-histedit-non-commute.t
+3
-0
tests/test-hooklib-changeset_obsoleted.t
tests/test-hooklib-changeset_obsoleted.t
+84
-0
tests/test-hooklib-changeset_published.t
tests/test-hooklib-changeset_published.t
+84
-0
tests/test-hooklib-enforce_draft_commits.t
tests/test-hooklib-enforce_draft_commits.t
+45
-0
tests/test-hooklib-reject_merge_commits.t
tests/test-hooklib-reject_merge_commits.t
+78
-0
tests/test-hooklib-reject_new_heads.t
tests/test-hooklib-reject_new_heads.t
+53
-0
tests/test-http-bad-server.t
tests/test-http-bad-server.t
+2
-0
tests/test-http-protocol.t
tests/test-http-protocol.t
+4
-4
tests/test-http.t
tests/test-http.t
+5
-5
tests/test-import.t
tests/test-import.t
+6
-3
tests/test-infinitepush-ci.t
tests/test-infinitepush-ci.t
+26
-26
tests/test-install.t
tests/test-install.t
+19
-0
tests/test-issue1175.t
tests/test-issue1175.t
+1
-1
tests/test-issue1802.t
tests/test-issue1802.t
+0
-2
tests/test-issue522.t
tests/test-issue522.t
+0
-2
tests/test-issue672.t
tests/test-issue672.t
+6
-3
tests/test-journal-exists.t
tests/test-journal-exists.t
+1
-5
tests/test-largefiles.t
tests/test-largefiles.t
+5
-2
tests/test-lfs-bundle.t
tests/test-lfs-bundle.t
+29
-0
tests/test-lfs-serve-access.t
tests/test-lfs-serve-access.t
+6
-5
tests/test-lfs-serve.t
tests/test-lfs-serve.t
+1
-0
tests/test-lfs-test-server.t
tests/test-lfs-test-server.t
+4
-2
tests/test-log.t
tests/test-log.t
+14
-0
tests/test-mactext.t
tests/test-mactext.t
+6
-8
tests/test-manifest.py
tests/test-manifest.py
+15
-11
tests/test-merge-changedelete.t
tests/test-merge-changedelete.t
+174
-238
tests/test-merge-criss-cross.t
tests/test-merge-criss-cross.t
+2
-6
tests/test-merge2.t
tests/test-merge2.t
+4
-0
tests/test-merge4.t
tests/test-merge4.t
+34
-0
tests/test-mq-merge.t
tests/test-mq-merge.t
+0
-1
tests/test-narrow-acl.t
tests/test-narrow-acl.t
+2
-1
tests/test-narrow-clone-stream.t
tests/test-narrow-clone-stream.t
+2
-1
tests/test-narrow-clone.t
tests/test-narrow-clone.t
+2
-1
tests/test-narrow-pull.t
tests/test-narrow-pull.t
+2
-1
tests/test-narrow-trackedcmd.t
tests/test-narrow-trackedcmd.t
+2
-1
tests/test-narrow-widen-no-ellipsis.t
tests/test-narrow-widen-no-ellipsis.t
+2
-1
tests/test-narrow-widen.t
tests/test-narrow-widen.t
+2
-1
tests/test-notify.t
tests/test-notify.t
+117
-19
tests/test-obsolete-distributed.t
tests/test-obsolete-distributed.t
+26
-1
tests/test-obsolete-divergent.t
tests/test-obsolete-divergent.t
+3
-0
tests/test-obsolete.t
tests/test-obsolete.t
+45
-2
tests/test-pathconflicts-merge.t
tests/test-pathconflicts-merge.t
+12
-0
tests/test-persistent-nodemap.t
tests/test-persistent-nodemap.t
+413
-0
tests/test-phabricator.t
tests/test-phabricator.t
+657
-7
tests/test-phases-exchange.t
tests/test-phases-exchange.t
+7
-1
tests/test-phases.t
tests/test-phases.t
+4
-2
tests/test-pull-r.t
tests/test-pull-r.t
+48
-1
tests/test-purge.t
tests/test-purge.t
+55
-14
tests/test-push-race.t
tests/test-push-race.t
+2
-2
tests/test-rebase-abort.t
tests/test-rebase-abort.t
+9
-23
tests/test-rebase-collapse.t
tests/test-rebase-collapse.t
+19
-74
tests/test-rebase-conflicts.t
tests/test-rebase-conflicts.t
+69
-0
tests/test-rebase-dest.t
tests/test-rebase-dest.t
+3
-3
tests/test-rebase-interruptions.t
tests/test-rebase-interruptions.t
+63
-3
tests/test-rebase-newancestor.t
tests/test-rebase-newancestor.t
+4
-45
tests/test-rebase-obsolete.t
tests/test-rebase-obsolete.t
+2
-6
tests/test-rebase-parameters.t
tests/test-rebase-parameters.t
+14
-4
tests/test-rebase-rename.t
tests/test-rebase-rename.t
+56
-0
tests/test-rebase-transaction.t
tests/test-rebase-transaction.t
+2
-2
tests/test-remotefilelog-hgweb.t
tests/test-remotefilelog-hgweb.t
+38
-0
tests/test-remotefilelog-local.t
tests/test-remotefilelog-local.t
+2
-1
tests/test-rename-after-merge.t
tests/test-rename-after-merge.t
+10
-0
tests/test-rename-dir-merge.t
tests/test-rename-dir-merge.t
+6
-4
tests/test-rename-merge1.t
tests/test-rename-merge1.t
+54
-4
tests/test-rename-merge2.t
tests/test-rename-merge2.t
+73
-80
tests/test-rename-rev.t
tests/test-rename-rev.t
+56
-0
tests/test-repair-strip.t
tests/test-repair-strip.t
+3
-1
tests/test-repo-compengines.t
tests/test-repo-compengines.t
+6
-1
tests/test-repo-filters-tiptoe.t
tests/test-repo-filters-tiptoe.t
+6
-0
tests/test-resolve.t
tests/test-resolve.t
+22
-30
tests/test-revert-interactive.t
tests/test-revert-interactive.t
+4
-2
tests/test-revert-unknown.t
tests/test-revert-unknown.t
+2
-1
tests/test-revert.t
tests/test-revert.t
+2
-1
tests/test-revlog-ancestry.py
tests/test-revlog-ancestry.py
+2
-2
tests/test-revlog-raw.py
tests/test-revlog-raw.py
+1
-1
tests/test-revset.t
tests/test-revset.t
+30
-0
tests/test-rollback.t
tests/test-rollback.t
+1
-1
tests/test-shelve.t
tests/test-shelve.t
+25
-4
tests/test-sparse-clear.t
tests/test-sparse-clear.t
+14
-7
tests/test-sparse-clone.t
tests/test-sparse-clone.t
+8
-4
tests/test-sparse-import.t
tests/test-sparse-import.t
+6
-3
tests/test-sparse-merges.t
tests/test-sparse-merges.t
+10
-4
tests/test-sparse-profiles.t
tests/test-sparse-profiles.t
+30
-15
tests/test-sparse-requirement.t
tests/test-sparse-requirement.t
+2
-1
tests/test-sparse.t
tests/test-sparse.t
+18
-9
tests/test-ssh-bundle1.t
tests/test-ssh-bundle1.t
+1
-1
tests/test-ssh-proto-unbundle.t
tests/test-ssh-proto-unbundle.t
+60
-60
tests/test-ssh-proto.t
tests/test-ssh-proto.t
+101
-99
tests/test-ssh.t
tests/test-ssh.t
+3
-3
tests/test-strip.t
tests/test-strip.t
+12
-0
tests/test-subrepo-deep-nested-change.t
tests/test-subrepo-deep-nested-change.t
+5
-0
tests/test-subrepo-missing.t
tests/test-subrepo-missing.t
+8
-3
tests/test-subrepo.t
tests/test-subrepo.t
+16
-4
tests/test-tags.t
tests/test-tags.t
+21
-0
tests/test-template-functions.t
tests/test-template-functions.t
+70
-0
tests/test-template-graph.t
tests/test-template-graph.t
+440
-0
tests/test-uncommit.t
tests/test-uncommit.t
+5
-4
tests/test-up-local-change.t
tests/test-up-local-change.t
+0
-4
tests/test-update-atomic.t
tests/test-update-atomic.t
+1
-1
tests/test-update-branches.t
tests/test-update-branches.t
+31
-3
tests/test-update-reverse.t
tests/test-update-reverse.t
+6
-3
tests/test-wireproto-command-capabilities.t
tests/test-wireproto-command-capabilities.t
+4
-4
tests/test-wireproto-content-redirects.t
tests/test-wireproto-content-redirects.t
+8
-8
tests/testlib/crash_transaction_late.py
tests/testlib/crash_transaction_late.py
+32
-0
tests/testlib/ext-phase-report.py
tests/testlib/ext-phase-report.py
+14
-13
tests/testlib/wait-on-file
tests/testlib/wait-on-file
+38
-0
tests/unwrap-message-id.py
tests/unwrap-message-id.py
+4
-2
tests/wireprotosimplecache.py
tests/wireprotosimplecache.py
+1
-1
No files found.
Makefile
View file @
26ce8e751503
...
...
@@ -64,6 +64,7 @@ doc:
$(MAKE)
-C
doc
cleanbutpackages
:
rm
-f
hg.exe
-
$(PYTHON)
setup.py clean
--all
# ignore errors from this command
find contrib doc hgext hgext3rd i18n mercurial tests hgdemandimport
\
\(
-name
'*.py[cdo]'
-o
-name
'*.so'
\)
-exec
rm
-f
'{}'
';'
...
...
black.toml
View file @
26ce8e751503
...
...
@@ -9,7 +9,6 @@ build/
| \.mypy_cache/
| \.venv/
| mercurial/thirdparty/
| contrib/python-zstandard/
'''
skip-string-normalization
=
true
quiet
=
true
contrib/benchmarks/__init__.py
View file @
26ce8e751503
...
...
@@ -81,7 +81,7 @@ def runperfcommand(reponame, command, *args, **kwargs):
output
=
ui
.
popbuffer
()
match
=
outputre
.
search
(
output
)
if
not
match
:
raise
ValueError
(
"Invalid output {
0
}"
.
format
(
output
))
raise
ValueError
(
"Invalid output {}"
.
format
(
output
))
return
float
(
match
.
group
(
1
))
...
...
contrib/check-py3-compat.py
View file @
26ce8e751503
...
...
@@ -32,7 +32,7 @@ def check_compat_py2(f):
for
node
in
ast
.
walk
(
root
):
if
isinstance
(
node
,
ast
.
ImportFrom
):
if
node
.
module
==
'__future__'
:
futures
|=
set
(
n
.
name
for
n
in
node
.
names
)
futures
|=
{
n
.
name
for
n
in
node
.
names
}
elif
isinstance
(
node
,
ast
.
Print
):
haveprint
=
True
...
...
contrib/chg/chg.c
View file @
26ce8e751503
...
...
@@ -226,6 +226,16 @@ static void execcmdserver(const struct cmdserveropts *opts)
}
argv
[
argsize
-
1
]
=
NULL
;
const
char
*
lc_ctype_env
=
getenv
(
"LC_CTYPE"
);
if
(
lc_ctype_env
==
NULL
)
{
if
(
putenv
(
"CHG_CLEAR_LC_CTYPE="
)
!=
0
)
abortmsgerrno
(
"failed to putenv CHG_CLEAR_LC_CTYPE"
);
}
else
{
if
(
setenv
(
"CHGORIG_LC_CTYPE"
,
lc_ctype_env
,
1
)
!=
0
)
{
abortmsgerrno
(
"failed to setenv CHGORIG_LC_CTYYPE"
);
}
}
if
(
putenv
(
"CHGINTERNALMARK="
)
!=
0
)
abortmsgerrno
(
"failed to putenv"
);
if
(
execvp
(
hgcmd
,
(
char
**
)
argv
)
<
0
)
...
...
@@ -364,8 +374,7 @@ static int runinstructions(struct cmdserveropts *opts, const char **insts)
/*
* Test whether the command is unsupported or not. This is not designed to
* cover all cases. But it's fast, does not depend on the server and does
* not return false positives.
* cover all cases. But it's fast, does not depend on the server.
*/
static
int
isunsupported
(
int
argc
,
const
char
*
argv
[])
{
...
...
@@ -378,7 +387,12 @@ static int isunsupported(int argc, const char *argv[])
for
(
i
=
0
;
i
<
argc
;
++
i
)
{
if
(
strcmp
(
argv
[
i
],
"--"
)
==
0
)
break
;
if
(
i
==
0
&&
strcmp
(
"serve"
,
argv
[
i
])
==
0
)
/*
* there can be false positives but no false negative
* we cannot assume `serve` will always be first argument
* because global options can be passed before the command name
*/
if
(
strcmp
(
"serve"
,
argv
[
i
])
==
0
)
state
|=
SERVE
;
else
if
(
strcmp
(
"-d"
,
argv
[
i
])
==
0
||
strcmp
(
"--daemon"
,
argv
[
i
])
==
0
)
...
...
contrib/examples/fix.hgrc
View file @
26ce8e751503
...
...
@@ -6,7 +6,7 @@ rustfmt:command = rustfmt +nightly
rustfmt:pattern = set:**.rs
black:command = black --config=black.toml -
black:pattern = set:**.py - mercurial/thirdparty/**
- "contrib/python-zstandard/**"
black:pattern = set:**.py - mercurial/thirdparty/**
# Mercurial doesn't have any Go code, but if we did this is how we
# would configure `hg fix` for Go:
...
...
contrib/heptapod-ci.yml
View file @
26ce8e751503
...
...
@@ -42,13 +42,13 @@ rust-cargo-test-py3:
test-py2
:
<<
:
*runtests
variables
:
RUNTEST_ARGS
:
"
--blacklist
/tmp/check-tests.txt"
RUNTEST_ARGS
:
"
--no-rust
--blacklist
/tmp/check-tests.txt"
TEST_HGMODULEPOLICY
:
"
c"
test-py3
:
<<
:
*runtests
variables
:
RUNTEST_ARGS
:
"
--blacklist
/tmp/check-tests.txt"
RUNTEST_ARGS
:
"
--no-rust
--blacklist
/tmp/check-tests.txt"
PYTHON
:
python3
TEST_HGMODULEPOLICY
:
"
c"
...
...
@@ -69,13 +69,13 @@ test-py2-rust:
<<
:
*runtests
variables
:
HGWITHRUSTEXT
:
cpython
RUNTEST_ARGS
:
"
--blacklist
/tmp/check-tests.txt"
RUNTEST_ARGS
:
"
--
rust
--
blacklist
/tmp/check-tests.txt"
TEST_HGMODULEPOLICY
:
"
rust+c"
test-py3-rust
:
<<
:
*runtests
variables
:
HGWITHRUSTEXT
:
cpython
RUNTEST_ARGS
:
"
--blacklist
/tmp/check-tests.txt"
RUNTEST_ARGS
:
"
--
rust
--
blacklist
/tmp/check-tests.txt"
PYTHON
:
python3
TEST_HGMODULEPOLICY
:
"
rust+c"
contrib/import-checker.py
View file @
26ce8e751503
...
...
@@ -392,9 +392,10 @@ def imported_modules(source, modulename, f, localmods, ignore_nested=False):
modnotfound
=
True
continue
yield
found
[
1
]
if
modnotfound
:
if
modnotfound
and
dottedpath
!=
modulename
:
# "dottedpath" is a package, but imported because of non-module
# lookup
# specifically allow "from . import foo" from __init__.py
yield
dottedpath
...
...
contrib/packaging/pyoxidizer.bzl
0 → 100644
View file @
26ce8e751503
# Instructions:
#
# 1. cargo install --version 0.5.0 pyoxidizer
# 2. cd /path/to/hg
# 3. pyoxidizer build --path contrib/packaging [--release]
# 4. Run build/pyoxidizer/<arch>/<debug|release>/app/hg
#
# If you need to build again, you need to remove the build/lib.* and
# build/temp.* directories, otherwise PyOxidizer fails to pick up C
# extensions. This is a bug in PyOxidizer.
ROOT
=
CWD
+
"/../.."
set_build_path
(
ROOT
+
"/build/pyoxidizer"
)
def
make_exe
():
dist
=
default_python_distribution
()
code
=
"import hgdemandimport; hgdemandimport.enable(); from mercurial import dispatch; dispatch.run()"
config
=
PythonInterpreterConfig
(
raw_allocator
=
"system"
,
run_eval
=
code
,
# We want to let the user load extensions from the file system
filesystem_importer
=
True
,
# We need this to make resourceutil happy, since it looks for sys.frozen.
sys_frozen
=
True
,
legacy_windows_stdio
=
True
,
)
exe
=
dist
.
to_python_executable
(
name
=
"hg"
,
config
=
config
,
)
# Use setup.py install to build Mercurial and collect Python resources to
# embed in the executable.
resources
=
dist
.
setup_py_install
(
ROOT
)
exe
.
add_python_resources
(
resources
)
return
exe
def
make_install
(
exe
):
m
=
FileManifest
()
# `hg` goes in root directory.
m
.
add_python_resource
(
"."
,
exe
)
templates
=
glob
(
include
=
[
ROOT
+
"/mercurial/templates/**/*"
],
strip_prefix
=
ROOT
+
"/mercurial/"
,
)
m
.
add_manifest
(
templates
)
return
m
register_target
(
"exe"
,
make_exe
)
register_target
(
"app"
,
make_install
,
depends
=
[
"exe"
],
default
=
True
)
resolve_targets
()
contrib/perf.py
View file @
26ce8e751503
...
...
@@ -1536,6 +1536,7 @@ def perfindex(ui, repo, **opts):
matters.
Example of useful set to test:
* tip
* 0
* -10:
...
...
@@ -2522,7 +2523,7 @@ def perfdiffwd(ui, repo, **opts):
}
for
diffopt
in
(
''
,
'w'
,
'b'
,
'B'
,
'wB'
):
opts
=
dict
((
options
[
c
],
b
'1'
)
for
c
in
diffopt
)
opts
=
{
options
[
c
]:
b
'1'
for
c
in
diffopt
}
def
d
():
ui
.
pushbuffer
()
...
...
@@ -3047,7 +3048,7 @@ def perfrevlogchunks(ui, repo, file_=None, engines=None, startrev=0, **opts):
# Verify engines argument.
if
engines
:
engines
=
set
(
e
.
strip
()
for
e
in
engines
.
split
(
b
','
))
engines
=
{
e
.
strip
()
for
e
in
engines
.
split
(
b
','
)}
for
engine
in
engines
:
try
:
util
.
compressionengines
[
engine
]
...
...
contrib/phab-clean.py
0 → 100755
View file @
26ce8e751503
#!/usr/bin/env python
#
# A small script to automatically reject idle Diffs
#
# you need to set the PHABBOT_USER and PHABBOT_TOKEN environment variable for authentication
from
__future__
import
absolute_import
,
print_function
import
datetime
import
os
import
sys
import
phabricator
MESSAGE
=
"""There seems to have been no activities on this Diff for the past 3 Months.
By policy, we are automatically moving it out of the `need-review` state.
Please, move it back to `need-review` without hesitation if this diff should still be discussed.
:baymax:need-review-idle:
"""
PHAB_URL
=
"https://phab.mercurial-scm.org/api/"
USER
=
os
.
environ
.
get
(
"PHABBOT_USER"
,
"baymax"
)
TOKEN
=
os
.
environ
.
get
(
"PHABBOT_TOKEN"
)
NOW
=
datetime
.
datetime
.
now
()
# 3 months in seconds
DELAY
=
60
*
60
*
24
*
30
*
3
def
get_all_diff
(
phab
):
"""Fetch all the diff that the need review"""
return
phab
.
differential
.
query
(
status
=
"status-needs-review"
,
order
=
"order-modified"
,
paths
=
[(
'HG'
,
None
)],
)
def
filter_diffs
(
diffs
,
older_than
):
"""filter diffs to only keep the one unmodified sin <older_than> seconds"""
olds
=
[]
for
d
in
diffs
:
modified
=
int
(
d
[
'dateModified'
])
modified
=
datetime
.
datetime
.
fromtimestamp
(
modified
)
d
[
"idleFor"
]
=
idle_for
=
NOW
-
modified
if
idle_for
.
total_seconds
()
>
older_than
:
olds
.
append
(
d
)
return
olds
def
nudge_diff
(
phab
,
diff
):
"""Comment on the idle diff and reject it"""
diff_id
=
int
(
d
[
'id'
])
phab
.
differential
.
createcomment
(
revision_id
=
diff_id
,
message
=
MESSAGE
,
action
=
"reject"
)
if
not
USER
:
print
(
"not user specified please set PHABBOT_USER and PHABBOT_TOKEN"
,
file
=
sys
.
stderr
,
)
elif
not
TOKEN
:
print
(
"not api-token specified please set PHABBOT_USER and PHABBOT_TOKEN"
,
file
=
sys
.
stderr
,
)
sys
.
exit
(
1
)
phab
=
phabricator
.
Phabricator
(
USER
,
host
=
PHAB_URL
,
token
=
TOKEN
)
phab
.
connect
()
phab
.
update_interfaces
()
print
(
'Hello "%s".'
%
phab
.
user
.
whoami
()[
'realName'
])
diffs
=
get_all_diff
(
phab
)
print
(
"Found %d Diffs"
%
len
(
diffs
))
olds
=
filter_diffs
(
diffs
,
DELAY
)
print
(
"Found %d old Diffs"
%
len
(
olds
))
for
d
in
olds
:
diff_id
=
d
[
'id'
]
status
=
d
[
'statusName'
]
modified
=
int
(
d
[
'dateModified'
])
idle_for
=
d
[
"idleFor"
]
msg
=
'nudging D%s in "%s" state for %s'
print
(
msg
%
(
diff_id
,
status
,
idle_for
))
# uncomment to actually affect phab
nudge_diff
(
phab
,
d
)
contrib/python-zstandard/make_cffi.py
View file @
26ce8e751503
...
...
@@ -52,7 +52,8 @@ SOURCES = [
# Headers whose preprocessed output will be fed into cdef().
HEADERS
=
[
os
.
path
.
join
(
HERE
,
"zstd"
,
*
p
)
for
p
in
((
"zstd.h"
,),
(
"dictBuilder"
,
"zdict.h"
),)
os
.
path
.
join
(
HERE
,
"zstd"
,
*
p
)
for
p
in
((
"zstd.h"
,),
(
"dictBuilder"
,
"zdict.h"
),)
]
INCLUDE_DIRS
=
[
...
...
@@ -139,7 +140,9 @@ def preprocess(path):
env
=
dict
(
os
.
environ
)
if
getattr
(
compiler
,
"_paths"
,
None
):
env
[
"PATH"
]
=
compiler
.
_paths
process
=
subprocess
.
Popen
(
args
+
[
input_file
],
stdout
=
subprocess
.
PIPE
,
env
=
env
)
process
=
subprocess
.
Popen
(
args
+
[
input_file
],
stdout
=
subprocess
.
PIPE
,
env
=
env
)
output
=
process
.
communicate
()[
0
]
ret
=
process
.
poll
()
if
ret
:
...
...
contrib/python-zstandard/setup.py
View file @
26ce8e751503
...
...
@@ -87,7 +87,9 @@ with open("c-ext/python-zstandard.h", "r") as fh:
break
if
not
version
:
raise
Exception
(
"could not resolve package version; "
"this should never happen"
)
raise
Exception
(
"could not resolve package version; "
"this should never happen"
)
setup
(
name
=
"zstandard"
,
...
...
contrib/python-zstandard/setup_zstd.py
View file @
26ce8e751503
...
...
@@ -138,12 +138,16 @@ def get_c_extension(
if
not
system_zstd
:
sources
.
update
([
os
.
path
.
join
(
actual_root
,
p
)
for
p
in
zstd_sources
])
if
support_legacy
:
sources
.
update
([
os
.
path
.
join
(
actual_root
,
p
)
for
p
in
zstd_sources_legacy
])
sources
.
update
(
[
os
.
path
.
join
(
actual_root
,
p
)
for
p
in
zstd_sources_legacy
]
)
sources
=
list
(
sources
)
include_dirs
=
set
([
os
.
path
.
join
(
actual_root
,
d
)
for
d
in
ext_includes
])
if
not
system_zstd
:
include_dirs
.
update
([
os
.
path
.
join
(
actual_root
,
d
)
for
d
in
zstd_includes
])
include_dirs
.
update
(
[
os
.
path
.
join
(
actual_root
,
d
)
for
d
in
zstd_includes
]
)
if
support_legacy
:
include_dirs
.
update
(
[
os
.
path
.
join
(
actual_root
,
d
)
for
d
in
zstd_includes_legacy
]
...
...
contrib/python-zstandard/tests/common.py
View file @
26ce8e751503
...
...
@@ -50,7 +50,9 @@ def make_cffi(cls):
os
.
environ
.
update
(
old_env
)
if
mod
.
backend
!=
"cffi"
:
raise
Exception
(
"got the zstandard %s backend instead of cffi"
%
mod
.
backend
)
raise
Exception
(
"got the zstandard %s backend instead of cffi"
%
mod
.
backend
)
# If CFFI version is available, dynamically construct test methods
# that use it.
...
...
@@ -84,7 +86,9 @@ def make_cffi(cls):
fn
.
__func__
.
func_defaults
,
fn
.
__func__
.
func_closure
,
)
new_method
=
types
.
UnboundMethodType
(
new_fn
,
fn
.
im_self
,
fn
.
im_class
)
new_method
=
types
.
UnboundMethodType
(
new_fn
,
fn
.
im_self
,
fn
.
im_class
)
setattr
(
cls
,
name
,
new_method
)
...
...
@@ -194,4 +198,6 @@ if hypothesis:
expensive_settings
=
hypothesis
.
settings
(
deadline
=
None
,
max_examples
=
10000
)
hypothesis
.
settings
.
register_profile
(
"expensive"
,
expensive_settings
)
hypothesis
.
settings
.
load_profile
(
os
.
environ
.
get
(
"HYPOTHESIS_PROFILE"
,
"default"
))
hypothesis
.
settings
.
load_profile
(
os
.
environ
.
get
(
"HYPOTHESIS_PROFILE"
,
"default"
)
)
contrib/python-zstandard/tests/test_buffer_util.py
View file @
26ce8e751503
...
...
@@ -67,7 +67,8 @@ class TestBufferWithSegments(TestCase):
self
.
skipTest
(
"BufferWithSegments not available"
)
b
=
zstd
.
BufferWithSegments
(
b
"foofooxfooxy"
,
b
""
.
join
([
ss
.
pack
(
0
,
3
),
ss
.
pack
(
3
,
4
),
ss
.
pack
(
7
,
5
)])
b
"foofooxfooxy"
,
b
""
.
join
([
ss
.
pack
(
0
,
3
),
ss
.
pack
(
3
,
4
),
ss
.
pack
(
7
,
5
)]),
)
self
.
assertEqual
(
len
(
b
),
3
)
self
.
assertEqual
(
b
.
size
,
12
)
...
...
@@ -83,17 +84,23 @@ class TestBufferWithSegmentsCollection(TestCase):
if
not
hasattr
(
zstd
,
"BufferWithSegmentsCollection"
):
self
.
skipTest
(
"BufferWithSegmentsCollection not available"
)
with
self
.
assertRaisesRegex
(
ValueError
,
"must pass at least 1 argument"
):
with
self
.
assertRaisesRegex
(
ValueError
,
"must pass at least 1 argument"
):
zstd
.
BufferWithSegmentsCollection
()
def
test_argument_validation
(
self
):
if
not
hasattr
(
zstd
,
"BufferWithSegmentsCollection"
):
self
.
skipTest
(
"BufferWithSegmentsCollection not available"
)
with
self
.
assertRaisesRegex
(
TypeError
,
"arguments must be BufferWithSegments"
):
with
self
.
assertRaisesRegex
(
TypeError
,
"arguments must be BufferWithSegments"
):
zstd
.
BufferWithSegmentsCollection
(
None
)
with
self
.
assertRaisesRegex
(
TypeError
,
"arguments must be BufferWithSegments"
):
with
self
.
assertRaisesRegex
(
TypeError
,
"arguments must be BufferWithSegments"
):
zstd
.
BufferWithSegmentsCollection
(
zstd
.
BufferWithSegments
(
b
"foo"
,
ss
.
pack
(
0
,
3
)),
None
)
...
...
contrib/python-zstandard/tests/test_compressor.py
View file @
26ce8e751503
...
...
@@ -24,7 +24,9 @@ else:
def
multithreaded_chunk_size
(
level
,
source_size
=
0
):
params
=
zstd
.
ZstdCompressionParameters
.
from_level
(
level
,
source_size
=
source_size
)
params
=
zstd
.
ZstdCompressionParameters
.
from_level
(
level
,
source_size
=
source_size
)
return
1
<<
(
params
.
window_log
+
2
)
...
...
@@ -86,7 +88,9 @@ class TestCompressor_compress(TestCase):
# This matches the test for read_to_iter() below.
cctx
=
zstd
.
ZstdCompressor
(
level
=
1
,
write_content_size
=
False
)
result
=
cctx
.
compress
(
b
"f"
*
zstd
.
COMPRESSION_RECOMMENDED_INPUT_SIZE
+
b
"o"
)
result
=
cctx
.
compress
(
b
"f"
*
zstd
.
COMPRESSION_RECOMMENDED_INPUT_SIZE
+
b
"o"
)
self
.
assertEqual
(
result
,
b
"
\x28\xb5\x2f\xfd\x00\x40\x54\x00\x00
"
...
...
@@ -99,7 +103,9 @@ class TestCompressor_compress(TestCase):
result
=
cctx
.
compress
(
b
"foo"
*
256
)
def
test_no_magic
(
self
):
params
=
zstd
.
ZstdCompressionParameters
.
from_level
(
1
,
format
=
zstd
.
FORMAT_ZSTD1
)
params
=
zstd
.
ZstdCompressionParameters
.
from_level
(
1
,
format
=
zstd
.
FORMAT_ZSTD1
)
cctx
=
zstd
.
ZstdCompressor
(
compression_params
=
params
)
magic
=
cctx
.
compress
(
b
"foobar"
)
...
...
@@ -223,7 +229,8 @@ class TestCompressor_compress(TestCase):
self
.
assertEqual
(
result
,
b
"
\x28\xb5\x2f\xfd\x23\x8f\x55\x0f\x70\x03\x19\x00\x00
"
b
"
\x66\x6f\x6f
"
,