##// END OF EJS Templates
sslutil: require TLS 1.1+ when supported...
sslutil: require TLS 1.1+ when supported Currently, Mercurial will use TLS 1.0 or newer when connecting to remote servers, selecting the highest TLS version supported by both peers. On older Pythons, only TLS 1.0 is available. On newer Pythons, TLS 1.1 and 1.2 should be available. Security professionals recommend avoiding TLS 1.0 if possible. PCI DSS 3.1 "strongly encourages" the use of TLS 1.2. Known attacks like BEAST and POODLE exist against TLS 1.0 (although mitigations are available and properly configured servers aren't vulnerable). I asked Eric Rescorla - Mozilla's resident crypto expert - whether Mercurial should drop support for TLS 1.0. His response was "if you can get away with it." Essentially, a number of servers on the Internet don't support TLS 1.1+. This is why web browsers continue to support TLS 1.0 despite desires from security experts. This patch changes Mercurial's default behavior on modern Python versions to require TLS 1.1+, thus avoiding known security issues with TLS 1.0 and making Mercurial more secure by default. Rather than drop TLS 1.0 support wholesale, we still allow TLS 1.0 to be used if configured. This is a compromise solution - ideally we'd disallow TLS 1.0. However, since we're not sure how many Mercurial servers don't support TLS 1.1+ and we're not sure how much user inconvenience this change will bring, I think it is prudent to ship an escape hatch that still allows usage of TLS 1.0. In the default case our users get better security. In the worst case, they are no worse off than before this patch. This patch has no effect when running on Python versions that don't support TLS 1.1+. As the added test shows, connecting to a server that doesn't support TLS 1.1+ will display a warning message with a link to our wiki, where we can guide people to configure their client to allow less secure connections.

File last commit:

r23172:e955549c default
r29560:303e9300 default
Show More
test-mq-merge.t
177 lines | 3.5 KiB | text/troff | Tads3Lexer
Martin Geisler
mq: forbid commit of merge involving mq patches
r13520 Setup extension:
Yuya Nishihara
tests: write hgrc of more than two lines by using shell heredoc...
r23172 $ cat <<EOF >> $HGRCPATH
> [extensions]
> mq =
> [mq]
> git = keep
> EOF
Martin Geisler
mq: forbid commit of merge involving mq patches
r13520
Test merge with mq changeset as the second parent:
$ hg init m
$ cd m
$ touch a b c
$ hg add a
$ hg commit -m a
$ hg add b
$ hg qnew -d "0 0" b
$ hg update 0
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg add c
$ hg commit -m c
created new head
$ hg merge
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$ hg commit -m merge
abort: cannot commit over an applied mq patch
[255]
$ cd ..
Martin Geisler
tests: added a short description to issue numbers...
r12399 Issue529: mq aborts when merging patch deleting files
Adrian Buehlmann
tests: unify some of test-mq*
r12324
$ checkundo()
> {
> if [ -f .hg/store/undo ]; then
> echo ".hg/store/undo still exists"
> fi
> }
Commit two dummy files in "init" changeset:
$ hg init t
$ cd t
$ echo a > a
$ echo b > b
$ hg ci -Am init
adding a
adding b
$ hg tag -l init
Create a patch removing a:
$ hg qnew rm_a
$ hg rm a
$ hg qrefresh -m "rm a"
Save the patch queue so we can merge it later:
$ hg qsave -c -e
Mads Kiilerich
tests: make (glob) on windows accept \ instead of /...
r15447 copy $TESTTMP/t/.hg/patches to $TESTTMP/t/.hg/patches.1 (glob)
Adrian Buehlmann
tests: unify some of test-mq*
r12324 $ checkundo
Update b and commit in an "update" changeset:
$ hg up -C init
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo b >> b
$ hg st
M b
$ hg ci -m update
created new head
# Here, qpush used to abort with :
# The system cannot find the file specified => a
$ hg manifest
a
b
$ hg qpush -a -m
Mads Kiilerich
tests: make (glob) on windows accept \ instead of /...
r15447 merging with queue at: $TESTTMP/t/.hg/patches.1 (glob)
Adrian Buehlmann
tests: unify some of test-mq*
r12324 applying rm_a
now at: rm_a
$ checkundo
$ hg manifest
b
Ensure status is correct after merge:
$ hg qpop -a
popping rm_a
popping .hg.patches.merge.marker
patch queue now empty
$ cd ..
Classic MQ merge sequence *with an explicit named queue*:
$ hg init t2
$ cd t2
$ echo '[diff]' > .hg/hgrc
$ echo 'nodates = 1' >> .hg/hgrc
$ echo a > a
$ hg ci -Am init
adding a
$ echo b > a
$ hg ci -m changea
$ hg up -C 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg cp a aa
$ echo c >> a
$ hg qnew --git -f -e patcha
$ echo d >> a
$ hg qnew -d '0 0' -f -e patcha2
Create the reference queue:
$ hg qsave -c -e -n refqueue
Mads Kiilerich
tests: make (glob) on windows accept \ instead of /...
r15447 copy $TESTTMP/t2/.hg/patches to $TESTTMP/t2/.hg/refqueue (glob)
Adrian Buehlmann
tests: unify some of test-mq*
r12324 $ hg up -C 1
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
Merge:
$ HGMERGE=internal:other hg qpush -a -m -n refqueue
Mads Kiilerich
tests: make (glob) on windows accept \ instead of /...
r15447 merging with queue at: $TESTTMP/t2/.hg/refqueue (glob)
Adrian Buehlmann
tests: unify some of test-mq*
r12324 applying patcha
patching file a
Patrick Mezard
patch: fuzz more aggressively to match patch(1) behaviour...
r16124 Hunk #1 succeeded at 2 with fuzz 1 (offset 0 lines).
fuzz found when applying patch, stopping
Adrian Buehlmann
tests: unify some of test-mq*
r12324 patch didn't work out, merging patcha
Patrick Mezard
patch: fuzz more aggressively to match patch(1) behaviour...
r16124 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
Adrian Buehlmann
tests: unify some of test-mq*
r12324 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
applying patcha2
now at: patcha2
Check patcha is still a git patch:
$ cat .hg/patches/patcha
# HG changeset patch
Mads Kiilerich
mq: write '# Parent ' lines with two spaces like export does (BC)...
r22521 # Parent d3873e73d99ef67873dac33fbcc66268d5d2b6f4
Adrian Buehlmann
tests: unify some of test-mq*
r12324
diff --git a/a b/a
--- a/a
+++ b/a
@@ -1,1 +1,2 @@
-b
+a
+c
Mads Kiilerich
diff: search beyond ancestor when detecting renames...
r20294 diff --git a/a b/aa
copy from a
copy to aa
--- a/a
Adrian Buehlmann
tests: unify some of test-mq*
r12324 +++ b/aa
Mads Kiilerich
diff: search beyond ancestor when detecting renames...
r20294 @@ -1,1 +1,1 @@
-b
Adrian Buehlmann
tests: unify some of test-mq*
r12324 +a
Check patcha2 is still a regular patch:
$ cat .hg/patches/patcha2
# HG changeset patch
Mads Kiilerich
mq: write headers for new HG patches in the same order as export (BC)
r22520 # Date 0 0
Mads Kiilerich
mq: write '# Parent ' lines with two spaces like export does (BC)...
r22521 # Parent ???????????????????????????????????????? (glob)
Adrian Buehlmann
tests: unify some of test-mq*
r12324
Brodie Rao
tests: add glob matching for unified tests...
r12376 diff -r ???????????? -r ???????????? a (glob)
Adrian Buehlmann
tests: unify some of test-mq*
r12324 --- a/a
+++ b/a
@@ -1,2 +1,3 @@
a
c
+d
$ cd ..