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
19
Merge Requests
19
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
28163c5de797
Commit
08a7faae
authored
Jul 20, 2020
by
Pulkit Goyal
Browse files
Options
Browse Files
Download
Plain Diff
merge default into stable for 5.5rc0
--HG-- branch : stable
parents
e699cebc3ae9
a6fde9d789d9
Pipeline
#8173
failed with stage
in 29 minutes and 7 seconds
Changes
267
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
267 changed files
with
8136 additions
and
5602 deletions
+8136
-5602
.hgignore
.hgignore
+1
-0
contrib/chg/chg.c
contrib/chg/chg.c
+1
-1
contrib/dumprevlog
contrib/dumprevlog
+1
-1
contrib/fuzz/Makefile
contrib/fuzz/Makefile
+8
-7
contrib/fuzz/manifest.cc
contrib/fuzz/manifest.cc
+6
-1
contrib/fuzz/manifest_corpus.py
contrib/fuzz/manifest_corpus.py
+8
-3
contrib/fuzz/pyutil.cc
contrib/fuzz/pyutil.cc
+1
-1
contrib/heptapod-ci.yml
contrib/heptapod-ci.yml
+8
-0
contrib/packaging/debian/rules
contrib/packaging/debian/rules
+46
-2
contrib/perf.py
contrib/perf.py
+35
-7
contrib/simplemerge
contrib/simplemerge
+6
-6
contrib/undumprevlog
contrib/undumprevlog
+1
-2
hgext/absorb.py
hgext/absorb.py
+19
-3
hgext/convert/cvs.py
hgext/convert/cvs.py
+1
-2
hgext/convert/gnuarch.py
hgext/convert/gnuarch.py
+1
-1
hgext/convert/subversion.py
hgext/convert/subversion.py
+1
-1
hgext/extdiff.py
hgext/extdiff.py
+201
-160
hgext/fix.py
hgext/fix.py
+56
-6
hgext/git/__init__.py
hgext/git/__init__.py
+12
-1
hgext/git/dirstate.py
hgext/git/dirstate.py
+4
-0
hgext/git/gitlog.py
hgext/git/gitlog.py
+59
-2
hgext/git/index.py
hgext/git/index.py
+15
-4
hgext/git/manifest.py
hgext/git/manifest.py
+79
-9
hgext/githelp.py
hgext/githelp.py
+9
-0
hgext/histedit.py
hgext/histedit.py
+2
-1
hgext/hooklib/changeset_obsoleted.py
hgext/hooklib/changeset_obsoleted.py
+11
-3
hgext/infinitepush/__init__.py
hgext/infinitepush/__init__.py
+1
-1
hgext/largefiles/lfcommands.py
hgext/largefiles/lfcommands.py
+1
-1
hgext/largefiles/overrides.py
hgext/largefiles/overrides.py
+2
-1
hgext/largefiles/reposetup.py
hgext/largefiles/reposetup.py
+1
-1
hgext/lfs/__init__.py
hgext/lfs/__init__.py
+1
-1
hgext/lfs/wrapper.py
hgext/lfs/wrapper.py
+3
-3
hgext/mq.py
hgext/mq.py
+9
-1
hgext/narrow/narrowbundle2.py
hgext/narrow/narrowbundle2.py
+3
-2
hgext/phabricator.py
hgext/phabricator.py
+26
-8
hgext/purge.py
hgext/purge.py
+1
-1
hgext/rebase.py
hgext/rebase.py
+23
-18
hgext/releasenotes.py
hgext/releasenotes.py
+5
-2
hgext/remotefilelog/__init__.py
hgext/remotefilelog/__init__.py
+6
-6
hgext/strip.py
hgext/strip.py
+2
-2
mercurial/archival.py
mercurial/archival.py
+1
-1
mercurial/bundle2.py
mercurial/bundle2.py
+5
-4
mercurial/cext/manifest.c
mercurial/cext/manifest.c
+41
-36
mercurial/cext/osutil.c
mercurial/cext/osutil.c
+4
-7
mercurial/cext/parsers.c
mercurial/cext/parsers.c
+1
-1
mercurial/cext/revlog.c
mercurial/cext/revlog.c
+137
-101
mercurial/changegroup.py
mercurial/changegroup.py
+1
-1
mercurial/changelog.py
mercurial/changelog.py
+10
-12
mercurial/chgserver.py
mercurial/chgserver.py
+15
-2
mercurial/cmdutil.py
mercurial/cmdutil.py
+37
-21
mercurial/commands.py
mercurial/commands.py
+137
-135
mercurial/commandserver.py
mercurial/commandserver.py
+45
-5
mercurial/configitems.py
mercurial/configitems.py
+28
-22
mercurial/context.py
mercurial/context.py
+31
-45
mercurial/copies.py
mercurial/copies.py
+94
-268
mercurial/crecord.py
mercurial/crecord.py
+10
-10
mercurial/debugcommands.py
mercurial/debugcommands.py
+34
-17
mercurial/diffhelper.py
mercurial/diffhelper.py
+3
-1
mercurial/dirstate.py
mercurial/dirstate.py
+9
-4
mercurial/discovery.py
mercurial/discovery.py
+43
-25
mercurial/dispatch.py
mercurial/dispatch.py
+34
-29
mercurial/error.py
mercurial/error.py
+16
-0
mercurial/exchange.py
mercurial/exchange.py
+56
-34
mercurial/exchangev2.py
mercurial/exchangev2.py
+3
-6
mercurial/extensions.py
mercurial/extensions.py
+11
-6
mercurial/filemerge.py
mercurial/filemerge.py
+3
-0
mercurial/fileset.py
mercurial/fileset.py
+3
-3
mercurial/help.py
mercurial/help.py
+5
-0
mercurial/helptext/config.txt
mercurial/helptext/config.txt
+29
-0
mercurial/helptext/flags.txt
mercurial/helptext/flags.txt
+3
-1
mercurial/helptext/internals/bid-merge.txt
mercurial/helptext/internals/bid-merge.txt
+115
-0
mercurial/helptext/internals/requirements.txt
mercurial/helptext/internals/requirements.txt
+13
-0
mercurial/helptext/internals/revlogs.txt
mercurial/helptext/internals/revlogs.txt
+1
-1
mercurial/hg.py
mercurial/hg.py
+3
-2
mercurial/hgweb/server.py
mercurial/hgweb/server.py
+1
-1
mercurial/hook.py
mercurial/hook.py
+4
-0
mercurial/interfaces/repository.py
mercurial/interfaces/repository.py
+3
-0
mercurial/localrepo.py
mercurial/localrepo.py
+59
-70
mercurial/logcmdutil.py
mercurial/logcmdutil.py
+6
-10
mercurial/manifest.py
mercurial/manifest.py
+63
-30
mercurial/mdiff.py
mercurial/mdiff.py
+5
-6
mercurial/merge.py
mercurial/merge.py
+294
-1014
mercurial/mergestate.py
mercurial/mergestate.py
+879
-0
mercurial/metadata.py
mercurial/metadata.py
+327
-0
mercurial/narrowspec.py
mercurial/narrowspec.py
+2
-1
mercurial/obsutil.py
mercurial/obsutil.py
+14
-4
mercurial/patch.py
mercurial/patch.py
+80
-47
mercurial/pathutil.py
mercurial/pathutil.py
+14
-0
mercurial/phases.py
mercurial/phases.py
+89
-55
mercurial/policy.py
mercurial/policy.py
+1
-1
mercurial/posix.py
mercurial/posix.py
+0
-4
mercurial/pycompat.py
mercurial/pycompat.py
+5
-38
mercurial/repair.py
mercurial/repair.py
+1
-1
mercurial/repoview.py
mercurial/repoview.py
+5
-7
mercurial/revlog.py
mercurial/revlog.py
+3
-3
mercurial/revlogutils/nodemap.py
mercurial/revlogutils/nodemap.py
+15
-4
mercurial/revset.py
mercurial/revset.py
+4
-4
mercurial/rewriteutil.py
mercurial/rewriteutil.py
+17
-0
mercurial/scmutil.py
mercurial/scmutil.py
+34
-15
mercurial/shelve.py
mercurial/shelve.py
+4
-8
mercurial/simplemerge.py
mercurial/simplemerge.py
+8
-15
mercurial/sparse.py
mercurial/sparse.py
+5
-4
mercurial/sshpeer.py
mercurial/sshpeer.py
+11
-7
mercurial/sslutil.py
mercurial/sslutil.py
+65
-252
mercurial/state.py
mercurial/state.py
+93
-0
mercurial/streamclone.py
mercurial/streamclone.py
+3
-2
mercurial/subrepo.py
mercurial/subrepo.py
+3
-3
mercurial/templatekw.py
mercurial/templatekw.py
+2
-2
mercurial/ui.py
mercurial/ui.py
+34
-1
mercurial/upgrade.py
mercurial/upgrade.py
+74
-41
mercurial/util.py
mercurial/util.py
+48
-37
mercurial/utils/procutil.py
mercurial/utils/procutil.py
+99
-24
mercurial/windows.py
mercurial/windows.py
+18
-10
mercurial/wireprotov1server.py
mercurial/wireprotov1server.py
+2
-2
relnotes/next
relnotes/next
+34
-0
rust/Cargo.lock
rust/Cargo.lock
+25
-25
rust/Cargo.toml
rust/Cargo.toml
+1
-1
rust/README.rst
rust/README.rst
+15
-43
rust/chg/Cargo.lock
rust/chg/Cargo.lock
+152
-371
rust/chg/Cargo.toml
rust/chg/Cargo.toml
+8
-6
rust/chg/src/attachio.rs
rust/chg/src/attachio.rs
+39
-85
rust/chg/src/clientext.rs
rust/chg/src/clientext.rs
+80
-87
rust/chg/src/lib.rs
rust/chg/src/lib.rs
+1
-1
rust/chg/src/locator.rs
rust/chg/src/locator.rs
+97
-150
rust/chg/src/main.rs
rust/chg/src/main.rs
+19
-28
rust/chg/src/runcommand.rs
rust/chg/src/runcommand.rs
+32
-140
rust/chg/src/uihandler.rs
rust/chg/src/uihandler.rs
+32
-33
rust/hg-core/Cargo.toml
rust/hg-core/Cargo.toml
+2
-11
rust/hg-core/build.rs
rust/hg-core/build.rs
+0
-61
rust/hg-core/src/ancestors.rs
rust/hg-core/src/ancestors.rs
+11
-11
rust/hg-core/src/dagops.rs
rust/hg-core/src/dagops.rs
+8
-7
rust/hg-core/src/dirstate/dirs_multiset.rs
rust/hg-core/src/dirstate/dirs_multiset.rs
+6
-2
rust/hg-core/src/dirstate/dirstate_map.rs
rust/hg-core/src/dirstate/dirstate_map.rs
+1
-1
rust/hg-core/src/dirstate/parsers.rs
rust/hg-core/src/dirstate/parsers.rs
+1
-1
rust/hg-core/src/dirstate/status.rs
rust/hg-core/src/dirstate/status.rs
+586
-592
rust/hg-core/src/discovery.rs
rust/hg-core/src/discovery.rs
+5
-5
rust/hg-core/src/filepatterns.rs
rust/hg-core/src/filepatterns.rs
+30
-25
rust/hg-core/src/lib.rs
rust/hg-core/src/lib.rs
+1
-9
rust/hg-core/src/matchers.rs
rust/hg-core/src/matchers.rs
+62
-55
rust/hg-core/src/operations/dirstate_status.rs
rust/hg-core/src/operations/dirstate_status.rs
+76
-0
rust/hg-core/src/operations/find_root.rs
rust/hg-core/src/operations/find_root.rs
+124
-0
rust/hg-core/src/operations/mod.rs
rust/hg-core/src/operations/mod.rs
+13
-0
rust/hg-core/src/re2/mod.rs
rust/hg-core/src/re2/mod.rs
+0
-21
rust/hg-core/src/re2/re2.rs
rust/hg-core/src/re2/re2.rs
+0
-66
rust/hg-core/src/re2/rust_re2.cpp
rust/hg-core/src/re2/rust_re2.cpp
+0
-49
rust/hg-core/src/revlog.rs
rust/hg-core/src/revlog.rs
+5
-0
rust/hg-core/src/revlog/node.rs
rust/hg-core/src/revlog/node.rs
+10
-6
rust/hg-core/src/revlog/nodemap.rs
rust/hg-core/src/revlog/nodemap.rs
+8
-12
rust/hg-core/src/utils.rs
rust/hg-core/src/utils.rs
+3
-2
rust/hg-core/src/utils/files.rs
rust/hg-core/src/utils/files.rs
+4
-6
rust/hg-core/src/utils/hg_path.rs
rust/hg-core/src/utils/hg_path.rs
+4
-7
rust/hg-core/src/utils/path_auditor.rs
rust/hg-core/src/utils/path_auditor.rs
+1
-1
rust/hg-cpython/Cargo.toml
rust/hg-cpython/Cargo.toml
+0
-1
rust/hg-cpython/src/cindex.rs
rust/hg-cpython/src/cindex.rs
+2
-5
rust/hg-cpython/src/debug.rs
rust/hg-cpython/src/debug.rs
+0
-2
rust/hg-cpython/src/dirstate.rs
rust/hg-cpython/src/dirstate.rs
+2
-1
rust/hg-cpython/src/dirstate/copymap.rs
rust/hg-cpython/src/dirstate/copymap.rs
+3
-3
rust/hg-cpython/src/dirstate/dirs_multiset.rs
rust/hg-cpython/src/dirstate/dirs_multiset.rs
+1
-1
rust/hg-cpython/src/dirstate/dirstate_map.rs
rust/hg-cpython/src/dirstate/dirstate_map.rs
+12
-8
rust/hg-cpython/src/dirstate/non_normal_entries.rs
rust/hg-cpython/src/dirstate/non_normal_entries.rs
+1
-1
rust/hg-cpython/src/dirstate/status.rs
rust/hg-cpython/src/dirstate/status.rs
+13
-9
rust/hg-cpython/src/parsers.rs
rust/hg-cpython/src/parsers.rs
+4
-4
rust/hg-cpython/src/utils.rs
rust/hg-cpython/src/utils.rs
+2
-5
rust/hgcli/pyoxidizer.bzl
rust/hgcli/pyoxidizer.bzl
+3
-9
rust/rhg/Cargo.toml
rust/rhg/Cargo.toml
+10
-0
rust/rhg/README.md
rust/rhg/README.md
+4
-0
rust/rhg/rustfmt.toml
rust/rhg/rustfmt.toml
+3
-0
rust/rhg/src/commands.rs
rust/rhg/src/commands.rs
+9
-0
rust/rhg/src/commands/root.rs
rust/rhg/src/commands/root.rs
+76
-0
rust/rhg/src/error.rs
rust/rhg/src/error.rs
+60
-0
rust/rhg/src/exitcode.rs
rust/rhg/src/exitcode.rs
+10
-0
rust/rhg/src/main.rs
rust/rhg/src/main.rs
+42
-0
rust/rhg/src/ui.rs
rust/rhg/src/ui.rs
+54
-0
setup.py
setup.py
+41
-1
tests/fakemergerecord.py
tests/fakemergerecord.py
+2
-2
tests/hghave.py
tests/hghave.py
+12
-25
tests/phabricator/phabupdate-change-6876.json
tests/phabricator/phabupdate-change-6876.json
+141
-0
tests/run-tests.py
tests/run-tests.py
+2
-2
tests/test-absorb-unfinished.t
tests/test-absorb-unfinished.t
+1
-1
tests/test-absorb.t
tests/test-absorb.t
+150
-1
tests/test-alias.t
tests/test-alias.t
+1
-1
tests/test-bookmarks-rebase.t
tests/test-bookmarks-rebase.t
+2
-2
tests/test-bundle2-format.t
tests/test-bundle2-format.t
+5
-5
tests/test-check-rust-format.t
tests/test-check-rust-format.t
+1
-1
tests/test-chg.t
tests/test-chg.t
+4
-4
tests/test-clone-uncompressed.t
tests/test-clone-uncompressed.t
+1
-1
tests/test-clonebundles.t
tests/test-clonebundles.t
+87
-18
tests/test-commandserver.t
tests/test-commandserver.t
+45
-0
tests/test-completion.t
tests/test-completion.t
+4
-0
tests/test-contrib-perf.t
tests/test-contrib-perf.t
+1
-1
tests/test-copies-chain-merge.t
tests/test-copies-chain-merge.t
+61
-4
tests/test-copies-in-changeset.t
tests/test-copies-in-changeset.t
+55
-50
tests/test-copytrace-heuristics.t
tests/test-copytrace-heuristics.t
+3
-3
tests/test-debugcommands.t
tests/test-debugcommands.t
+10
-8
tests/test-devel-warnings.t
tests/test-devel-warnings.t
+3
-0
tests/test-dirstate.t
tests/test-dirstate.t
+3
-2
tests/test-extension.t
tests/test-extension.t
+11
-19
tests/test-fix.t
tests/test-fix.t
+1
-1
tests/test-git-interop.t
tests/test-git-interop.t
+24
-2
tests/test-githelp.t
tests/test-githelp.t
+7
-0
tests/test-graft-interrupted.t
tests/test-graft-interrupted.t
+11
-11
tests/test-grep.t
tests/test-grep.t
+28
-16
tests/test-help.t
tests/test-help.t
+17
-5
tests/test-hgweb-non-interactive.t
tests/test-hgweb-non-interactive.t
+5
-3
tests/test-histedit-edit.t
tests/test-histedit-edit.t
+2
-0
tests/test-hook.t
tests/test-hook.t
+1
-1
tests/test-hooklib-changeset_obsoleted.t
tests/test-hooklib-changeset_obsoleted.t
+31
-1
tests/test-https.t
tests/test-https.t
+2
-129
tests/test-import-context.t
tests/test-import-context.t
+2
-3
tests/test-install.t
tests/test-install.t
+0
-6
tests/test-largefiles-update.t
tests/test-largefiles-update.t
+1
-1
tests/test-lfs-serve.t
tests/test-lfs-serve.t
+0
-24
tests/test-lfs.t
tests/test-lfs.t
+2
-1
tests/test-manifest.py
tests/test-manifest.py
+0
-33
tests/test-merge-halt.t
tests/test-merge-halt.t
+1
-1
tests/test-mq-qfold.t
tests/test-mq-qfold.t
+1
-0
tests/test-mq-qnew.t
tests/test-mq-qnew.t
+1
-0
tests/test-mq-qrefresh-replace-log-message.t
tests/test-mq-qrefresh-replace-log-message.t
+2
-0
tests/test-narrow-rebase.t
tests/test-narrow-rebase.t
+1
-1
tests/test-obsolete-divergent.t
tests/test-obsolete-divergent.t
+3
-1
tests/test-obsolete.t
tests/test-obsolete.t
+56
-3
tests/test-parseindex.t
tests/test-parseindex.t
+1
-1
tests/test-patchbomb-tls.t
tests/test-patchbomb-tls.t
+1
-28
tests/test-persistent-nodemap.t
tests/test-persistent-nodemap.t
+255
-131
tests/test-phabricator.t
tests/test-phabricator.t
+7
-3
tests/test-progress.t
tests/test-progress.t
+41
-1
tests/test-pull.t
tests/test-pull.t
+3
-3
tests/test-rebase-abort.t
tests/test-rebase-abort.t
+7
-7
tests/test-rebase-backup.t
tests/test-rebase-backup.t
+2
-2
tests/test-rebase-bookmarks.t
tests/test-rebase-bookmarks.t
+1
-1
tests/test-rebase-check-restore.t
tests/test-rebase-check-restore.t
+2
-2
tests/test-rebase-collapse.t
tests/test-rebase-collapse.t
+4
-4
tests/test-rebase-conflicts.t
tests/test-rebase-conflicts.t
+5
-5
tests/test-rebase-dest.t
tests/test-rebase-dest.t
+1
-1
tests/test-rebase-detach.t
tests/test-rebase-detach.t
+1
-1
tests/test-rebase-empty-successor.t
tests/test-rebase-empty-successor.t
+44
-0
tests/test-rebase-emptycommit.t
tests/test-rebase-emptycommit.t
+11
-1
tests/test-rebase-inmemory.t
tests/test-rebase-inmemory.t
+46
-3
tests/test-rebase-interruptions.t
tests/test-rebase-interruptions.t
+7
-7
tests/test-rebase-legacy.t
tests/test-rebase-legacy.t
+13
-9
tests/test-rebase-mq-skip.t
tests/test-rebase-mq-skip.t
+1
-1
tests/test-rebase-mq.t
tests/test-rebase-mq.t
+2
-2
tests/test-rebase-obsolete.t
tests/test-rebase-obsolete.t
+8
-8
tests/test-rebase-parameters.t
tests/test-rebase-parameters.t
+1
-1
tests/test-rebase-partial.t
tests/test-rebase-partial.t
+1
-1
tests/test-rebase-transaction.t
tests/test-rebase-transaction.t
+1
-1
tests/test-requires.t
tests/test-requires.t
+8
-0
tests/test-resolve.t
tests/test-resolve.t
+3
-3
tests/test-revert-interactive-curses.t
tests/test-revert-interactive-curses.t
+55
-0
tests/test-revset.t
tests/test-revset.t
+4
-4
tests/test-rhg.t
tests/test-rhg.t
+26
-0
tests/test-rollback.t
tests/test-rollback.t
+1
-0
tests/test-run-tests.t
tests/test-run-tests.t
+6
-6
tests/test-serve.t
tests/test-serve.t
+5
-2
tests/test-setdiscovery.t
tests/test-setdiscovery.t
+37
-0
tests/test-sidedata.t
tests/test-sidedata.t
+44
-40
tests/test-sparse-profiles.t
tests/test-sparse-profiles.t
+1
-1
tests/test-sparse.t
tests/test-sparse.t
+1
-1
tests/test-ssh.t
tests/test-ssh.t
+5
-0
tests/test-state-extension.t
tests/test-state-extension.t
+136
-0
tests/test-stdio.py
tests/test-stdio.py
+365
-0
tests/test-tag.t
tests/test-tag.t
+1
-0
tests/test-template-functions.t
tests/test-template-functions.t
+3
-3
tests/test-template-map.t
tests/test-template-map.t
+3
-3
tests/test-upgrade-repo.t
tests/test-upgrade-repo.t
+259
-155
tests/test-wireproto-command-lookup.t
tests/test-wireproto-command-lookup.t
+2
-1
tests/test-wireproto-exchangev2-shallow.t
tests/test-wireproto-exchangev2-shallow.t
+2
-1
No files found.
.hgignore
View file @
28163c5de797
...
...
@@ -52,6 +52,7 @@ cscope.*
.idea/*
.asv/*
.pytype/*
.mypy_cache
i18n/hg.pot
locale/*/LC_MESSAGES/hg.mo
hgext/__index__.py
...
...
contrib/chg/chg.c
View file @
28163c5de797
...
...
@@ -232,7 +232,7 @@ static void execcmdserver(const struct cmdserveropts *opts)
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_CTY
Y
PE"
);
abortmsgerrno
(
"failed to setenv CHGORIG_LC_CTYPE"
);
}
}
...
...
contrib/dumprevlog
View file @
28163c5de797
...
...
@@ -28,7 +28,7 @@ binopen.options = {}
def
printb
(
data
,
end
=
b
'
\n
'
):
sys
.
stdout
.
flush
()
p
ycompat
.
stdout
.
write
(
data
+
end
)
p
rocutil
.
stdout
.
write
(
data
+
end
)
for
f
in
sys
.
argv
[
1
:]:
...
...
contrib/fuzz/Makefile
View file @
28163c5de797
...
...
@@ -11,6 +11,7 @@ CXX = clang++
LIB_FUZZING_ENGINE
?=
standalone_fuzz_target_runner.o
PYTHON_CONFIG
?=
$$
OUT/sanpy/bin/python-config
PYTHON_CONFIG_FLAGS
?=
--ldflags
CXXFLAGS
+=
-Wno-deprecated-register
...
...
@@ -67,7 +68,7 @@ dirs_fuzzer: dirs.cc pyutil.o $(PARSERS_OBJS) $$OUT/dirs_fuzzer_seed_corpus.zip
-Wno-register
-Wno-macro-redefined
\
-I
../../mercurial dirs.cc
\
pyutil.o
$(PARSERS_OBJS)
\
$(LIB_FUZZING_ENGINE)
`
$(PYTHON_CONFIG)
--ldflags
`
\
$(LIB_FUZZING_ENGINE)
`
$(PYTHON_CONFIG)
$(PYTHON_CONFIG_FLAGS)
`
\
-o
$$
OUT/dirs_fuzzer
fncache_fuzzer
:
fncache.cc
...
...
@@ -75,7 +76,7 @@ fncache_fuzzer: fncache.cc
-Wno-register
-Wno-macro-redefined
\
-I
../../mercurial fncache.cc
\
pyutil.o
$(PARSERS_OBJS)
\
$(LIB_FUZZING_ENGINE)
`
$(PYTHON_CONFIG)
--ldflags
`
\
$(LIB_FUZZING_ENGINE)
`
$(PYTHON_CONFIG)
$(PYTHON_CONFIG_FLAGS)
`
\
-o
$$
OUT/fncache_fuzzer
jsonescapeu8fast_fuzzer
:
jsonescapeu8fast.cc pyutil.o $(PARSERS_OBJS)
...
...
@@ -83,7 +84,7 @@ jsonescapeu8fast_fuzzer: jsonescapeu8fast.cc pyutil.o $(PARSERS_OBJS)
-Wno-register
-Wno-macro-redefined
\
-I
../../mercurial jsonescapeu8fast.cc
\
pyutil.o
$(PARSERS_OBJS)
\
$(LIB_FUZZING_ENGINE)
`
$(PYTHON_CONFIG)
--ldflags
`
\
$(LIB_FUZZING_ENGINE)
`
$(PYTHON_CONFIG)
$(PYTHON_CONFIG_FLAGS)
`
\
-o
$$
OUT/jsonescapeu8fast_fuzzer
manifest_fuzzer
:
manifest.cc pyutil.o $(PARSERS_OBJS) $$OUT/manifest_fuzzer_seed_corpus.zip
...
...
@@ -91,7 +92,7 @@ manifest_fuzzer: manifest.cc pyutil.o $(PARSERS_OBJS) $$OUT/manifest_fuzzer_seed
-Wno-register
-Wno-macro-redefined
\
-I
../../mercurial manifest.cc
\
pyutil.o
$(PARSERS_OBJS)
\
$(LIB_FUZZING_ENGINE)
`
$(PYTHON_CONFIG)
--ldflags
`
\
$(LIB_FUZZING_ENGINE)
`
$(PYTHON_CONFIG)
$(PYTHON_CONFIG_FLAGS)
`
\
-o
$$
OUT/manifest_fuzzer
revlog_fuzzer
:
revlog.cc pyutil.o $(PARSERS_OBJS) $$OUT/revlog_fuzzer_seed_corpus.zip
...
...
@@ -99,7 +100,7 @@ revlog_fuzzer: revlog.cc pyutil.o $(PARSERS_OBJS) $$OUT/revlog_fuzzer_seed_corpu
-Wno-register
-Wno-macro-redefined
\
-I
../../mercurial revlog.cc
\
pyutil.o
$(PARSERS_OBJS)
\
$(LIB_FUZZING_ENGINE)
`
$(PYTHON_CONFIG)
--ldflags
`
\
$(LIB_FUZZING_ENGINE)
`
$(PYTHON_CONFIG)
$(PYTHON_CONFIG_FLAGS)
`
\
-o
$$
OUT/revlog_fuzzer
dirstate_fuzzer
:
dirstate.cc pyutil.o $(PARSERS_OBJS) $$OUT/dirstate_fuzzer_seed_corpus.zip
...
...
@@ -107,7 +108,7 @@ dirstate_fuzzer: dirstate.cc pyutil.o $(PARSERS_OBJS) $$OUT/dirstate_fuzzer_seed
-Wno-register
-Wno-macro-redefined
\
-I
../../mercurial dirstate.cc
\
pyutil.o
$(PARSERS_OBJS)
\
$(LIB_FUZZING_ENGINE)
`
$(PYTHON_CONFIG)
--ldflags
`
\
$(LIB_FUZZING_ENGINE)
`
$(PYTHON_CONFIG)
$(PYTHON_CONFIG_FLAGS)
`
\
-o
$$
OUT/dirstate_fuzzer
fm1readmarkers_fuzzer
:
fm1readmarkers.cc pyutil.o $(PARSERS_OBJS) $$OUT/fm1readmarkers_fuzzer_seed_corpus.zip
...
...
@@ -115,7 +116,7 @@ fm1readmarkers_fuzzer: fm1readmarkers.cc pyutil.o $(PARSERS_OBJS) $$OUT/fm1readm
-Wno-register
-Wno-macro-redefined
\
-I
../../mercurial fm1readmarkers.cc
\
pyutil.o
$(PARSERS_OBJS)
\
$(LIB_FUZZING_ENGINE)
`
$(PYTHON_CONFIG)
--ldflags
`
\
$(LIB_FUZZING_ENGINE)
`
$(PYTHON_CONFIG)
$(PYTHON_CONFIG_FLAGS)
`
\
-o
$$
OUT/fm1readmarkers_fuzzer
clean
:
...
...
contrib/fuzz/manifest.cc
View file @
28163c5de797
...
...
@@ -3,6 +3,7 @@
#include <stdlib.h>
#include <unistd.h>
#include "FuzzedDataProvider.h"
#include "pyutil.h"
#include <string>
...
...
@@ -24,7 +25,7 @@ try:
lm[e]
e in lm
(e + 'nope') in lm
lm[b'xyzzy'] = (b'\0' *
20
, 'x')
lm[b'xyzzy'] = (b'\0' *
nlen
, 'x')
# do an insert, text should change
assert lm.text() != mdata, "insert should change text and didn't: %r %r" % (lm.text(), mdata)
cloned = lm.filtercopy(lambda x: x != 'xyzzy')
...
...
@@ -51,10 +52,14 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
if
(
Size
>
100000
)
{
return
0
;
}
FuzzedDataProvider
provider
(
Data
,
Size
);
Py_ssize_t
nodelength
=
provider
.
ConsumeBool
()
?
20
:
32
;
PyObject
*
nlen
=
PyLong_FromSsize_t
(
nodelength
);
PyObject
*
mtext
=
PyBytes_FromStringAndSize
((
const
char
*
)
Data
,
(
Py_ssize_t
)
Size
);
PyObject
*
locals
=
PyDict_New
();
PyDict_SetItemString
(
locals
,
"mdata"
,
mtext
);
PyDict_SetItemString
(
locals
,
"nlen"
,
nlen
);
PyObject
*
res
=
PyEval_EvalCode
(
code
,
contrib
::
pyglobals
(),
locals
);
if
(
!
res
)
{
PyErr_Print
();
...
...
contrib/fuzz/manifest_corpus.py
View file @
28163c5de797
...
...
@@ -10,7 +10,7 @@ args = ap.parse_args()
with
zipfile
.
ZipFile
(
args
.
out
[
0
],
"w"
,
zipfile
.
ZIP_STORED
)
as
zf
:
zf
.
writestr
(
"manifest_zero"
,
'''PKG-INFO
\0
9b3ed8f2b81095a13064402e930565f083346e9a
'''
\0
PKG-INFO
\0
9b3ed8f2b81095a13064402e930565f083346e9a
README
\0
80b6e76643dcb44d4bc729e932fc464b3e36dbe3
hg
\0
b6444347c629cc058d478023905cfb83b7f5bb9d
mercurial/__init__.py
\0
b80de5d138758541c5f05265ad144ab9fa86d1db
...
...
@@ -25,9 +25,14 @@ setup.py\0ccf3f6daf0f13101ca73631f7a1769e328b472c9
tkmerge
\03
c922edb43a9c143682f7bc7b00f98b3c756ebe7
'''
,
)
zf
.
writestr
(
"badmanifest_shorthashes"
,
"narf
\0
aa
\n
narf2
\0
aaa
\n
"
)
zf
.
writestr
(
"badmanifest_shorthashes"
,
"
\0
narf
\0
aa
\n
narf2
\0
aaa
\n
"
)
zf
.
writestr
(
"badmanifest_nonull"
,
"narf
\0
cccccccccccccccccccccccccccccccccccccccc
\n
"
"
\0
narf
\0
cccccccccccccccccccccccccccccccccccccccc
\n
"
"narf2aaaaaaaaaaaaaaaaaaaa
\n
"
,
)
zf
.
writestr
(
"manifest_long_nodes"
,
"
\1
a
\0
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
\n
"
,
)
contrib/fuzz/pyutil.cc
View file @
28163c5de797
...
...
@@ -21,7 +21,7 @@ static PyObject *globals;
void
initpy
(
const
char
*
cselfpath
)
{
#ifdef HG_FUZZER_PY3
const
std
::
string
subdir
=
"/sanpy/lib/python3.
7
"
;
const
std
::
string
subdir
=
"/sanpy/lib/python3.
8
"
;
#else
const
std
::
string
subdir
=
"/sanpy/lib/python2.7"
;
#endif
...
...
contrib/heptapod-ci.yml
View file @
28163c5de797
...
...
@@ -5,6 +5,8 @@ image: octobus/ci-mercurial-core
before_script
:
-
hg clone . /tmp/mercurial-ci/ --noupdate
-
hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
-
cd /tmp/mercurial-ci/rust/rhg
-
cargo build
-
cd /tmp/mercurial-ci/
-
ls -1 tests/test-check-*.* > /tmp/check-tests.txt
...
...
@@ -79,3 +81,9 @@ test-py3-rust:
RUNTEST_ARGS
:
"
--rust
--blacklist
/tmp/check-tests.txt"
PYTHON
:
python3
TEST_HGMODULEPOLICY
:
"
rust+c"
test-py2-chg
:
<<
:
*runtests
variables
:
RUNTEST_ARGS
:
"
--blacklist
/tmp/check-tests.txt
--chg"
TEST_HGMODULEPOLICY
:
"
c"
contrib/packaging/debian/rules
View file @
28163c5de797
...
...
@@ -2,14 +2,51 @@
# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1
# By default we build a .deb where the native components are built with the
# current "default" version of py3 on the build machine. If you wish to build a
# .deb that has native components built for multiple versions of py3:
#
# 1. install python3.x and python3.x-dev for each version you want
# 2. set DEB_HG_MULTI_VERSION=1 or DEB_HG_PYTHON_VERSIONS in your environment
# (if both are set, DEB_HG_PYTHON_VERSIONS has precedence)
#
# If you choose `DEB_HG_MULTI_VERSION=1`, it will build for every "supported"
# version of py3 that's installed on the build machine. This may not be equal to
# the actual versions that are installed, see the comment above where we set
# DEB_HG_PYTHON_VERSIONS below. If you choose to set `DEB_HG_PYTHON_VERSIONS`
# yourself, set it to a space-separated string of python version numbers, like:
# DEB_HG_PYTHON_VERSIONS="3.7 3.8" make deb
DEB_HG_MULTI_VERSION?=0
CPUS=$(shell cat /proc/cpuinfo | grep -E ^processor | wc -l)
# By default, only build for the version of python3 that the system considers
# the 'default' (which should be the one invoked by just running 'python3'
# without a minor version). If DEB_HG_PYTHON_VERSIONS is set, this is ignored.
ifeq ($(DEB_HG_MULTI_VERSION), 1)
# If we're building for multiple versions, use all of the "supported" versions
# on the build machine. Note: the mechanism in use here (`py3versions`) is the
# recommended one, but it relies on a file written by the python3-minimal
# package, and this file is not dynamic and does not account for manual
# installations, just the ones that would be installed by `python3-all`. This
# includes the `-i` flag, which claims it's to list all "installed" versions,
# but it doesn't. This was quite confusing, hence this tale of woe. :)
DEB_HG_PYTHON_VERSIONS?=$(shell py3versions -vs)
else
# If we're building for only one version, identify the "default" version on
# the build machine and use that when building; this is just so that we don't
# have to duplicate the rules below for multi-version vs. single-version. The
# shebang line will still be /usr/bin/python3 (no minor version).
DEB_HG_PYTHON_VERSIONS?=$(shell py3versions -vd)
endif
export HGPYTHON3=1
export PYTHON=python3
%:
dh $@ --with python3
# Note: testing can be disabled using the standard `DEB_BUILD_OPTIONS=nocheck`
override_dh_auto_test:
http_proxy='' dh_auto_test -- TESTFLAGS="-j$(CPUS)"
...
...
@@ -24,8 +61,15 @@ override_dh_auto_build:
$(MAKE) all
$(MAKE) -C contrib/chg all
override_dh_auto_install:
python3 setup.py install --root "$(CURDIR)"/debian/mercurial --install-layout=deb
# Build the native extensions for a specfic python3 version (which must be
# installed on the build machine).
install-python%:
python$* setup.py install --root "$(CURDIR)"/debian/mercurial --install-layout=deb
# Build the final package. This rule has a dependencies section that causes the
# native extensions to be compiled for every version of python3 listed in
# DEB_HG_PYTHON_VERSIONS.
override_dh_auto_install: $(DEB_HG_PYTHON_VERSIONS:%=install-python%)
# chg
make -C contrib/chg \
DESTDIR="$(CURDIR)"/debian/mercurial \
...
...
contrib/perf.py
View file @
28163c5de797
...
...
@@ -3794,19 +3794,47 @@ def perflrucache(
fm
.
end
()
@
command
(
b
'perfwrite'
,
formatteropts
)
@
command
(
b
'perfwrite'
,
formatteropts
+
[
(
b
''
,
b
'write-method'
,
b
'write'
,
b
'ui write method'
),
(
b
''
,
b
'nlines'
,
100
,
b
'number of lines'
),
(
b
''
,
b
'nitems'
,
100
,
b
'number of items (per line)'
),
(
b
''
,
b
'item'
,
b
'x'
,
b
'item that is written'
),
(
b
''
,
b
'batch-line'
,
None
,
b
'pass whole line to write method at once'
),
(
b
''
,
b
'flush-line'
,
None
,
b
'flush after each line'
),
],
)
def
perfwrite
(
ui
,
repo
,
**
opts
):
"""microbenchmark ui.write
"""microbenchmark ui.write
(and others)
"""
opts
=
_byteskwargs
(
opts
)
timer
,
fm
=
gettimer
(
ui
,
opts
)
write
=
getattr
(
ui
,
_sysstr
(
opts
[
b
'write_method'
]))
nlines
=
int
(
opts
[
b
'nlines'
])
nitems
=
int
(
opts
[
b
'nitems'
])
item
=
opts
[
b
'item'
]
batch_line
=
opts
.
get
(
b
'batch_line'
)
flush_line
=
opts
.
get
(
b
'flush_line'
)
if
batch_line
:
line
=
item
*
nitems
+
b
'
\n
'
def
write
():
for
i
in
range
(
100000
):
ui
.
writenoi18n
(
b
'Testing write performance
\n
'
)
def
benchmark
():
for
i
in
pycompat
.
xrange
(
nlines
):
if
batch_line
:
write
(
line
)
else
:
for
i
in
pycompat
.
xrange
(
nitems
):
write
(
item
)
write
(
b
'
\n
'
)
if
flush_line
:
ui
.
flush
()
ui
.
flush
()
timer
(
write
)
timer
,
fm
=
gettimer
(
ui
,
opts
)
timer
(
benchmark
)
fm
.
end
()
...
...
contrib/simplemerge
View file @
28163c5de797
...
...
@@ -45,8 +45,8 @@ class ParseError(Exception):
def
showhelp
():
p
ycompat
.
stdout
.
write
(
usage
)
p
ycompat
.
stdout
.
write
(
b
'
\n
options:
\n
'
)
p
rocutil
.
stdout
.
write
(
usage
)
p
rocutil
.
stdout
.
write
(
b
'
\n
options:
\n
'
)
out_opts
=
[]
for
shortopt
,
longopt
,
default
,
desc
in
options
:
...
...
@@ -62,11 +62,11 @@ def showhelp():
)
opts_len
=
max
([
len
(
opt
[
0
])
for
opt
in
out_opts
])
for
first
,
second
in
out_opts
:
p
ycompat
.
stdout
.
write
(
b
' %-*s %s
\n
'
%
(
opts_len
,
first
,
second
))
p
rocutil
.
stdout
.
write
(
b
' %-*s %s
\n
'
%
(
opts_len
,
first
,
second
))
try
:
for
fp
in
(
sys
.
stdin
,
p
ycompat
.
stdout
,
sys
.
stderr
):
for
fp
in
(
sys
.
stdin
,
p
rocutil
.
stdout
,
sys
.
stderr
):
procutil
.
setbinary
(
fp
)
opts
=
{}
...
...
@@ -92,11 +92,11 @@ try:
)
except
ParseError
as
e
:
e
=
stringutil
.
forcebytestr
(
e
)
p
ycompat
.
stdout
.
write
(
b
"%s: %s
\n
"
%
(
sys
.
argv
[
0
].
encode
(
'utf8'
),
e
))
p
rocutil
.
stdout
.
write
(
b
"%s: %s
\n
"
%
(
sys
.
argv
[
0
].
encode
(
'utf8'
),
e
))
showhelp
()
sys
.
exit
(
1
)
except
error
.
Abort
as
e
:
p
ycompat
.
stderr
.
write
(
b
"abort: %s
\n
"
%
e
)
p
rocutil
.
stderr
.
write
(
b
"abort: %s
\n
"
%
e
)
sys
.
exit
(
255
)
except
KeyboardInterrupt
:
sys
.
exit
(
255
)
contrib/undumprevlog
View file @
28163c5de797
...
...
@@ -9,7 +9,6 @@ import sys
from
mercurial
import
(
encoding
,
node
,
pycompat
,
revlog
,
transaction
,
vfs
as
vfsmod
,
...
...
@@ -30,7 +29,7 @@ while True:
if
l
.
startswith
(
"file:"
):
f
=
encoding
.
strtolocal
(
l
[
6
:
-
1
])
r
=
revlog
.
revlog
(
opener
,
f
)
p
ycompat
.
stdout
.
write
(
b
'%s
\n
'
%
f
)
p
rocutil
.
stdout
.
write
(
b
'%s
\n
'
%
f
)
elif
l
.
startswith
(
"node:"
):
n
=
node
.
bin
(
l
[
6
:
-
1
])
elif
l
.
startswith
(
"linkrev:"
):
...
...
hgext/absorb.py
View file @
28163c5de797
...
...
@@ -50,6 +50,7 @@ from mercurial import (
phases
,
pycompat
,
registrar
,
rewriteutil
,
scmutil
,
util
,
)
...
...
@@ -782,7 +783,10 @@ class fixupstate(object):
# nothing changed, nothing commited
nextp1
=
ctx
continue
if
self
.
_willbecomenoop
(
memworkingcopy
,
ctx
,
nextp1
):
willbecomenoop
=
ctx
.
files
()
and
self
.
_willbecomenoop
(
memworkingcopy
,
ctx
,
nextp1
)
if
self
.
skip_empty_successor
and
willbecomenoop
:
# changeset is no longer necessary
self
.
replacemap
[
ctx
.
node
()]
=
None
msg
=
_
(
b
'became empty and was dropped'
)
...
...
@@ -793,7 +797,11 @@ class fixupstate(object):
nextp1
=
lastcommitted
self
.
replacemap
[
ctx
.
node
()]
=
lastcommitted
.
node
()
if
memworkingcopy
:
msg
=
_
(
b
'%d file(s) changed, became %s'
)
%
(
if
willbecomenoop
:
msg
=
_
(
b
'%d file(s) changed, became empty as %s'
)
else
:
msg
=
_
(
b
'%d file(s) changed, became %s'
)
msg
=
msg
%
(
len
(
memworkingcopy
),
self
.
_ctx2str
(
lastcommitted
),
)
...
...
@@ -887,6 +895,10 @@ class fixupstate(object):
if
len
(
parents
)
!=
1
:
return
False
pctx
=
parents
[
0
]
if
ctx
.
branch
()
!=
pctx
.
branch
():
return
False
if
ctx
.
extra
().
get
(
b
'close'
):
return
False
# ctx changes more files (not a subset of memworkingcopy)
if
not
set
(
ctx
.
files
()).
issubset
(
set
(
memworkingcopy
)):
return
False
...
...
@@ -929,6 +941,10 @@ class fixupstate(object):
self
.
repo
,
replacements
,
operation
=
b
'absorb'
,
fixphase
=
True
)
@
util
.
propertycache
def
skip_empty_successor
(
self
):
return
rewriteutil
.
skip_empty_successor
(
self
.
ui
,
b
'absorb'
)
def
_parsechunk
(
hunk
):
"""(crecord.uihunk or patch.recordhunk) -> (path, (a1, a2, [bline]))"""
...
...
@@ -1045,7 +1061,7 @@ def absorb(ui, repo, stack=None, targetctx=None, pats=None, opts=None):
not
opts
.
get
(
b
'apply_changes'
)
and
state
.
ctxaffected
and
ui
.
promptchoice
(
b
"apply changes (y
n
)? $$ &Yes $$ &No"
,
default
=
1
b
"apply changes (y
/N
)? $$ &Yes $$ &No"
,
default
=
1
)
):
raise
error
.
Abort
(
_
(
b
'absorb cancelled
\n
'
))
...
...
hgext/convert/cvs.py
View file @
28163c5de797
...
...
@@ -226,8 +226,7 @@ class convert_cvs(converter_source):
cmd
=
[
rsh
,
host
]
+
cmd
# popen2 does not support argument lists under Windows
cmd
=
[
procutil
.
shellquote
(
arg
)
for
arg
in
cmd
]
cmd
=
procutil
.
quotecommand
(
b
' '
.
join
(
cmd
))
cmd
=
b
' '
.
join
(
procutil
.
shellquote
(
arg
)
for
arg
in
cmd
)
self
.
writep
,
self
.
readp
=
procutil
.
popen2
(
cmd
)
self
.
realroot
=
root
...
...
hgext/convert/gnuarch.py
View file @
28163c5de797
...
...
@@ -217,7 +217,7 @@ class gnuarch_source(common.converter_source, common.commandline):
cmdline
=
[
procutil
.
shellquote
(
arg
)
for
arg
in
cmdline
]
bdevnull
=
pycompat
.
bytestr
(
os
.
devnull
)
cmdline
+=
[
b
'>'
,
bdevnull
,
b
'2>'
,
bdevnull
]
cmdline
=
procutil
.
quotecommand
(
b
' '
.
join
(
cmdline
)
)
cmdline
=
b
' '
.
join
(
cmdline
)
self
.
ui
.
debug
(
cmdline
,
b
'
\n
'
)
return
os
.
system
(
pycompat
.
rapply
(
procutil
.
tonativestr
,
cmdline
))
...
...
hgext/convert/subversion.py
View file @
28163c5de797
...
...
@@ -1366,7 +1366,7 @@ class svn_source(converter_source):
arg
=
encodeargs
(
args
)
hgexe
=
procutil
.
hgexecutable
()
cmd
=
b
'%s debugsvnlog'
%
procutil
.
shellquote
(
hgexe
)
stdin
,
stdout
=
procutil
.
popen2
(
procutil
.
quotecommand
(
cmd
)
)
stdin
,
stdout
=
procutil
.
popen2
(
cmd
)
stdin
.
write
(
arg
)
try
:
stdin
.
close
()
...
...
hgext/extdiff.py
View file @
28163c5de797
...
...
@@ -233,7 +233,6 @@ def _systembackground(cmd, environ=None, cwd=None):
''' like 'procutil.system', but returns the Popen object directly
so we don't have to wait on it.
'''
cmd
=
procutil
.
quotecommand
(
cmd
)
env
=
procutil
.
shellenviron
(
environ
)
proc
=
subprocess
.
Popen
(
procutil
.
tonativestr
(
cmd
),
...
...
@@ -351,6 +350,187 @@ def _runperfilediff(
proc
.
wait
()
def
diffpatch
(
ui
,
repo
,
node1
,
node2
,
tmproot
,
matcher
,
cmdline
):
template
=
b
'hg-%h.patch'
# write patches to temporary files
with
formatter
.
nullformatter
(
ui
,
b
'extdiff'
,
{})
as
fm
:
cmdutil
.
export
(
repo
,
[
repo
[
node1
].
rev
(),
repo
[
node2
].
rev
()],
fm
,
fntemplate
=
repo
.
vfs
.
reljoin
(
tmproot
,
template
),
match
=
matcher
,
)
label1
=
cmdutil
.
makefilename
(
repo
[
node1
],
template
)
label2
=
cmdutil
.
makefilename
(
repo
[
node2
],
template
)
file1
=
repo
.
vfs
.
reljoin
(
tmproot
,
label1
)
file2
=
repo
.
vfs
.
reljoin
(
tmproot
,
label2
)
cmdline
=
formatcmdline
(
cmdline
,
repo
.
root
,
# no 3way while comparing patches
do3way
=
False
,
parent1
=
file1
,
plabel1
=
label1
,
# while comparing patches, there is no second parent
parent2
=
None
,
plabel2
=
None
,
child
=
file2
,
clabel
=
label2
,
)
ui
.
debug
(
b
'running %r in %s
\n
'
%
(
pycompat
.
bytestr
(
cmdline
),
tmproot
))
ui
.
system
(
cmdline
,
cwd
=
tmproot
,
blockedtag
=
b
'extdiff'
)
return
1
def
diffrevs
(
ui
,
repo
,
node1a
,
node1b
,
node2
,
matcher
,
tmproot
,
cmdline
,
do3way
,
guitool
,
opts
,
):
subrepos
=
opts
.
get
(
b
'subrepos'
)
# calculate list of files changed between both revs
st
=
repo
.
status
(
node1a
,
node2
,
matcher
,
listsubrepos
=
subrepos
)
mod_a
,
add_a
,
rem_a
=
set
(
st
.
modified
),
set
(
st
.
added
),
set
(
st
.
removed
)
if
do3way
:
stb
=
repo
.
status
(
node1b
,
node2
,
matcher
,
listsubrepos
=
subrepos
)
mod_b
,
add_b
,
rem_b
=
(
set
(
stb
.
modified
),
set
(
stb
.
added
),
set
(
stb
.
removed
),
)
else
:
mod_b
,
add_b
,
rem_b
=
set
(),
set
(),
set
()
modadd
=
mod_a
|
add_a
|
mod_b
|
add_b
common
=
modadd
|
rem_a
|
rem_b
if
not
common
:
return
0
# Always make a copy of node1a (and node1b, if applicable)
# dir1a should contain files which are: