# HG changeset patch
# User Pulkit Goyal
# Date 2019-02-04 17:35:21
# Node ID 311f563c8d447f285f9f5c4856b466e5ec41c292
# Parent 990aa150fd028d6ec84d3c703ab22995f016c38c
# Parent 8b2892d5a9f2c06c998c977015a9ad3e3a3c9b5f
merge with stable
diff --git a/.hgsigs b/.hgsigs
--- a/.hgsigs
+++ b/.hgsigs
@@ -175,3 +175,4 @@ a91a2837150bdcb27ae76b3646e6c93cd6a15904
1c8c54cf97256f4468da2eb4dbee24f7f3888e71 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAlwG+eIQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91YqSD/9IAwdaPrOeiT+DVBW2x33oFeY1X1f5CBG/vCJptalOd2QDIsD0ANEzQHmzV25RKD851v155Txt/BPlkuBfO/kg0BbOoqTpGZk+5CcoFWeyhJct2CxtCLdEpyZ/98/htMR4VfWprCX2GHXPjS813l9pebsN3WgBUOc2VaUdHNRoAGsMVgWC5BWwNP4XSA9oixFL/O4aGLQ6pPfP3vmMFySWXWnIN8gUZ4sm53eKaT0QCICAgzFh+GzRd81uACDfoJn1d8RS9GK+h6j8x0crLY5CpQQy8lRVkokvc0h6XK44ofc57p9GHAOfprHY3DbBhD9H6fLAf5raUsqPkLRYVGqhg8bOsBr3vJ56hiXJYOYPZSYXGjnHRcUrgfPVrY+6mPTeCIQMPmWBHwYH5Tc5TLrPuxxCL4wVywqGbfmIVP+WFUikkykAAwuPOZAswxJJOB0gsnnxcApmTeXRznBXyvzscMlWVZiMjzflKRRJ9V5RI4Fdc6n1wQ4vuLSO4AUnIypIsV6ZFAOBuFKH7x6nPG0tP3FYzcICaMOPbxEx3LStnuU+UuEs6TIxM6IiR3LPiiDGZ2BA2gjJhDxQFV8hAl8KDO3LsYuyUQCv3RTAP+YejH21bIXdnwDlNqy8Hrd53rq7jZsdb2pMVvOZZ3VmIu64f+jVkD/r5msDUkQL3M9jwg==
197f092b2cd9691e2a55d198f717b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MbpgbG2uBDhmEowAyhXtiuQAPCUra5o42a+E+tAgV5uNUAal8vk0DcPRmzc4UntQiQGwxL0fsTEpMQtG5ryxWRmOIBq6aKGuLVELllPCwOh8UIGLlpAoEynlNi9qJNT6kHpSmwquiU6TG6R1dA/ckBK2H90hewtb/jwLlenGugpylLQ2U/NsDdoWRyHNrdB4eUJiWD/BBPXktZQJVja97Js+Vn44ctCkNjui/53xcBQfIYdHGLttIEq56v/yZiSviCcTUhBPRSEdoUg==
diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -188,3 +188,4 @@ a91a2837150bdcb27ae76b3646e6c93cd6a15904
1c8c54cf97256f4468da2eb4dbee24f7f3888e71 4.8.1
197f092b2cd9691e2a55d198f717b231af9be6f9 4.8.2
593718ff5844cad7a27ee3eb5adad89ac8550949 4.9rc0
+83377b4b4ae0e9a6b8e579f7b0a693b8cf5c3b10 4.9
diff --git a/contrib/packaging/debian/copyright b/contrib/packaging/debian/copyright
--- a/contrib/packaging/debian/copyright
+++ b/contrib/packaging/debian/copyright
@@ -3,7 +3,7 @@ Upstream-Name: mercurial
Source: https://www.mercurial-scm.org/
Files: *
-Copyright: 2005-2018, Matt Mackall and others.
+Copyright: 2005-2019, Matt Mackall and others.
License: GPL-2+
This program is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public
diff --git a/contrib/win32/ReadMe.html b/contrib/win32/ReadMe.html
--- a/contrib/win32/ReadMe.html
+++ b/contrib/win32/ReadMe.html
@@ -140,7 +140,7 @@ editor = whatever
- Mercurial is Copyright 2005-2018 Matt Mackall and others. See
+ Mercurial is Copyright 2005-2019 Matt Mackall and others. See
the Contributors.txt file for a list of contributors.
diff --git a/contrib/win32/mercurial.iss b/contrib/win32/mercurial.iss
--- a/contrib/win32/mercurial.iss
+++ b/contrib/win32/mercurial.iss
@@ -21,7 +21,7 @@
#endif
[Setup]
-AppCopyright=Copyright 2005-2018 Matt Mackall and others
+AppCopyright=Copyright 2005-2019 Matt Mackall and others
AppName=Mercurial
AppVersion={#VERSION}
#if ARCH == "x64"
@@ -45,7 +45,7 @@ AppContact=mercurial@mercurial-scm.org
DefaultDirName={pf}\Mercurial
SourceDir=..\..
VersionInfoDescription=Mercurial distributed SCM (version {#VERSION})
-VersionInfoCopyright=Copyright 2005-2018 Matt Mackall and others
+VersionInfoCopyright=Copyright 2005-2019 Matt Mackall and others
VersionInfoCompany=Matt Mackall and others
InternalCompressLevel=max
SolidCompression=true
diff --git a/contrib/wix/COPYING.rtf b/contrib/wix/COPYING.rtf
index c62627912080d1b85e0da7fcec549da649aaa34e..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@> .hgsub
+ $ hg ci -qAm 'add subrepo "/sub"'
+ abort: path contains illegal component: /sub
+ [255]
+
+prepare tampered repo (including the commit above):
+
+ $ hg import --bypass -qm 'add subrepo "/sub"' - <<'EOF'
+ > diff --git a/.hgsub b/.hgsub
+ > new file mode 100644
+ > --- /dev/null
+ > +++ b/.hgsub
+ > @@ -0,0 +1,1 @@
+ > +/sub = sub
+ > diff --git a/.hgsubstate b/.hgsubstate
+ > new file mode 100644
+ > --- /dev/null
+ > +++ b/.hgsubstate
+ > @@ -0,0 +1,1 @@
+ > +0000000000000000000000000000000000000000 /sub
+ > EOF
+ $ cd ..
+
+on clone (and update):
+
+ $ hg clone -q absolutepath absolutepath2
+ abort: path contains illegal component: /sub
+ [255]
+
+Test root path
+--------------
+
+on commit:
+
+ $ hg init rootpath
+ $ cd rootpath
+ $ hg init sub
+ $ echo '/ = sub' >> .hgsub
+ $ hg ci -qAm 'add subrepo "/"'
+ abort: path ends in directory separator: /
+ [255]
+
+prepare tampered repo (including the commit above):
+
+ $ hg import --bypass -qm 'add subrepo "/"' - <<'EOF'
+ > diff --git a/.hgsub b/.hgsub
+ > new file mode 100644
+ > --- /dev/null
+ > +++ b/.hgsub
+ > @@ -0,0 +1,1 @@
+ > +/ = sub
+ > diff --git a/.hgsubstate b/.hgsubstate
+ > new file mode 100644
+ > --- /dev/null
+ > +++ b/.hgsubstate
+ > @@ -0,0 +1,1 @@
+ > +0000000000000000000000000000000000000000 /
+ > EOF
+ $ cd ..
+
+on clone (and update):
+
+ $ hg clone -q rootpath rootpath2
+ abort: path ends in directory separator: /
+ [255]
+
+Test empty path
+---------------
+
+on commit:
+
+ $ hg init emptypath
+ $ cd emptypath
+ $ hg init sub
+ $ echo '= sub' >> .hgsub
+ $ hg ci -qAm 'add subrepo ""'
+ hg: parse error at .hgsub:1: = sub
+ [255]
+
+prepare tampered repo (including the commit above):
+
+ $ hg import --bypass -qm 'add subrepo ""' - <<'EOF'
+ > diff --git a/.hgsub b/.hgsub
+ > new file mode 100644
+ > --- /dev/null
+ > +++ b/.hgsub
+ > @@ -0,0 +1,1 @@
+ > += sub
+ > diff --git a/.hgsubstate b/.hgsubstate
+ > new file mode 100644
+ > --- /dev/null
+ > +++ b/.hgsubstate
+ > @@ -0,0 +1,1 @@
+ > +0000000000000000000000000000000000000000
+ > EOF
+ $ cd ..
+
+on clone (and update):
+
+ $ hg clone -q emptypath emptypath2
+ hg: parse error at .hgsub:1: = sub
+ [255]
+
+Test current path
+-----------------
+
+on commit:
+
+ $ hg init currentpath
+ $ cd currentpath
+ $ hg init sub
+ $ echo '. = sub' >> .hgsub
+ $ hg ci -qAm 'add subrepo "."'
+ abort: subrepo path contains illegal component: .
+ [255]
+
+prepare tampered repo (including the commit above):
+
+ $ hg import --bypass -qm 'add subrepo "."' - <<'EOF'
+ > diff --git a/.hgsub b/.hgsub
+ > new file mode 100644
+ > --- /dev/null
+ > +++ b/.hgsub
+ > @@ -0,0 +1,1 @@
+ > +.= sub
+ > diff --git a/.hgsubstate b/.hgsubstate
+ > new file mode 100644
+ > --- /dev/null
+ > +++ b/.hgsubstate
+ > @@ -0,0 +1,1 @@
+ > +0000000000000000000000000000000000000000 .
+ > EOF
+ $ cd ..
+
+on clone (and update):
+
+ $ hg clone -q currentpath currentpath2
+ abort: subrepo path contains illegal component: .
+ [255]
+
+Test outer path
+---------------
+
+on commit:
+
+ $ mkdir outerpath
+ $ cd outerpath
+ $ hg init main
+ $ cd main
+ $ hg init ../sub
+ $ echo '../sub = ../sub' >> .hgsub
+ $ hg ci -qAm 'add subrepo "../sub"'
+ abort: path contains illegal component: ../sub
+ [255]
+
+prepare tampered repo (including the commit above):
+
+ $ hg import --bypass -qm 'add subrepo "../sub"' - <<'EOF'
+ > diff --git a/.hgsub b/.hgsub
+ > new file mode 100644
+ > --- /dev/null
+ > +++ b/.hgsub
+ > @@ -0,0 +1,1 @@
+ > +../sub = ../sub
+ > diff --git a/.hgsubstate b/.hgsubstate
+ > new file mode 100644
+ > --- /dev/null
+ > +++ b/.hgsubstate
+ > @@ -0,0 +1,1 @@
+ > +0000000000000000000000000000000000000000 ../sub
+ > EOF
+ $ cd ..
+
+on clone (and update):
+
+ $ hg clone -q main main2
+ abort: path contains illegal component: ../sub
+ [255]
+ $ cd ..
+
+Test variable expansion
+-----------------------
+
+Subrepository paths shouldn't be expanded, but we fail to handle them
+properly. Any local repository paths are expanded.
+
+on commit:
+
+ $ mkdir envvar
+ $ cd envvar
+ $ hg init main
+ $ cd main
+ $ hg init sub1
+ $ cat <<'EOF' > sub1/hgrc
+ > [hooks]
+ > log = echo pwned
+ > EOF
+ $ hg -R sub1 ci -qAm 'add sub1 files'
+ $ hg -R sub1 log -r. -T '{node}\n'
+ 39eb4b4d3e096527668784893a9280578a8f38b8
+ $ echo '$SUB = sub1' >> .hgsub
+ $ SUB=sub1 hg ci -qAm 'add subrepo "$SUB"'
+ abort: subrepo path contains illegal component: $SUB
+ [255]
+
+prepare tampered repo (including the changes above as two commits):
+
+ $ hg import --bypass -qm 'add subrepo "$SUB"' - <<'EOF'
+ > diff --git a/.hgsub b/.hgsub
+ > new file mode 100644
+ > --- /dev/null
+ > +++ b/.hgsub
+ > @@ -0,0 +1,1 @@
+ > +$SUB = sub1
+ > diff --git a/.hgsubstate b/.hgsubstate
+ > new file mode 100644
+ > --- /dev/null
+ > +++ b/.hgsubstate
+ > @@ -0,0 +1,1 @@
+ > +0000000000000000000000000000000000000000 $SUB
+ > EOF
+ $ hg debugsetparents 0
+ $ hg import --bypass -qm 'update subrepo "$SUB"' - <<'EOF'
+ > diff --git a/.hgsubstate b/.hgsubstate
+ > --- a/.hgsubstate
+ > +++ b/.hgsubstate
+ > @@ -1,1 +1,1 @@
+ > -0000000000000000000000000000000000000000 $SUB
+ > +39eb4b4d3e096527668784893a9280578a8f38b8 $SUB
+ > EOF
+ $ cd ..
+
+on clone (and update) with various substitutions:
+
+ $ hg clone -q main main2
+ abort: subrepo path contains illegal component: $SUB
+ [255]
+ $ ls main2
+
+ $ SUB=sub1 hg clone -q main main3
+ abort: subrepo path contains illegal component: $SUB
+ [255]
+ $ ls main3
+
+ $ SUB=sub2 hg clone -q main main4
+ abort: subrepo path contains illegal component: $SUB
+ [255]
+ $ ls main4
+
+on clone empty subrepo into .hg, then pull (and update), which at least fails:
+
+ $ SUB=.hg hg clone -qr0 main main5
+ abort: subrepo path contains illegal component: $SUB
+ [255]
+ $ ls main5
+ $ test -d main5/.hg/.hg
+ [1]
+ $ SUB=.hg hg -R main5 pull -u
+ pulling from $TESTTMP/envvar/main
+ searching for changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 1 changes to 1 files
+ new changesets 7a2f0e59146f
+ .hgsubstate: untracked file differs
+ abort: untracked files in working directory differ from files in requested revision
+ [255]
+ $ cat main5/.hg/hgrc | grep pwned
+ [1]
+
+on clone (and update) into .hg, which at least fails:
+
+ $ SUB=.hg hg clone -q main main6
+ abort: subrepo path contains illegal component: $SUB
+ [255]
+ $ ls main6
+ $ cat main6/.hg/hgrc | grep pwned
+ [1]
+
+on clone (and update) into .hg/* subdir:
+
+ $ SUB=.hg/foo hg clone -q main main7
+ abort: subrepo path contains illegal component: $SUB
+ [255]
+ $ ls main7
+ $ test -d main7/.hg/.hg
+ [1]
+
+on clone (and update) into outer tree:
+
+ $ SUB=../out-of-tree-write hg clone -q main main8
+ abort: subrepo path contains illegal component: $SUB
+ [255]
+ $ ls main8
+
+on clone (and update) into e.g. $HOME, which doesn't work since subrepo paths
+are concatenated prior to variable expansion:
+
+ $ SUB="$TESTTMP/envvar/fakehome" hg clone -q main main9
+ abort: subrepo path contains illegal component: $SUB
+ [255]
+ $ ls main9 | wc -l
+ \s*0 (re)
+
+ $ ls
+ main
+ main2
+ main3
+ main4
+ main5
+ main6
+ main7
+ main8
+ main9
+ $ cd ..
+
+Test tilde
+----------
+
+The leading tilde may be expanded to $HOME, but it can be a valid subrepo
+path in theory. However, we want to prohibit it as there might be unsafe
+handling of such paths.
+
+on commit:
+
+ $ hg init tilde
+ $ cd tilde
+ $ hg init './~'
+ $ echo '~ = ~' >> .hgsub
+ $ hg ci -qAm 'add subrepo "~"'
+ abort: subrepo path contains illegal component: ~
+ [255]
+
+prepare tampered repo (including the commit above):
+
+ $ hg import --bypass -qm 'add subrepo "~"' - <<'EOF'
+ > diff --git a/.hgsub b/.hgsub
+ > new file mode 100644
+ > --- /dev/null
+ > +++ b/.hgsub
+ > @@ -0,0 +1,1 @@
+ > +~ = ~
+ > diff --git a/.hgsubstate b/.hgsubstate
+ > new file mode 100644
+ > --- /dev/null
+ > +++ b/.hgsubstate
+ > @@ -0,0 +1,1 @@
+ > +0000000000000000000000000000000000000000 ~
+ > EOF
+ $ cd ..
+
+on clone (and update):
+
+ $ hg clone -q tilde tilde2
+ abort: subrepo path contains illegal component: ~
+ [255]
+
Test direct symlink traversal
-----------------------------
@@ -130,3 +496,167 @@ on clone (and update):
root
#endif
+
+Test symlink traversal by variable expansion
+--------------------------------------------
+
+#if symlink
+
+ $ FAKEHOME="$TESTTMP/envvarsym/fakehome"
+
+on commit:
+
+ $ mkdir envvarsym
+ $ cd envvarsym
+ $ hg init main
+ $ cd main
+ $ ln -s "`echo "$FAKEHOME" | sed 's|\(.\)/.*|\1|'`"
+ $ hg ci -qAm 'add symlink to top-level system directory'
+
+ $ hg init sub1
+ $ echo pwned > sub1/pwned
+ $ hg -R sub1 ci -qAm 'add sub1 files'
+ $ hg -R sub1 log -r. -T '{node}\n'
+ f40c9134ba1b6961e12f250868823f0092fb68a8
+ $ echo '$SUB = sub1' >> .hgsub
+ $ SUB="$FAKEHOME" hg ci -qAm 'add subrepo "$SUB"'
+ abort: subrepo path contains illegal component: $SUB
+ [255]
+
+prepare tampered repo (including the changes above as two commits):
+
+ $ hg import --bypass -qm 'add subrepo "$SUB"' - <<'EOF'
+ > diff --git a/.hgsub b/.hgsub
+ > new file mode 100644
+ > --- /dev/null
+ > +++ b/.hgsub
+ > @@ -0,0 +1,1 @@
+ > +$SUB = sub1
+ > diff --git a/.hgsubstate b/.hgsubstate
+ > new file mode 100644
+ > --- /dev/null
+ > +++ b/.hgsubstate
+ > @@ -0,0 +1,1 @@
+ > +0000000000000000000000000000000000000000 $SUB
+ > EOF
+ $ hg debugsetparents 1
+ $ hg import --bypass -qm 'update subrepo "$SUB"' - <<'EOF'
+ > diff --git a/.hgsubstate b/.hgsubstate
+ > --- a/.hgsubstate
+ > +++ b/.hgsubstate
+ > @@ -1,1 +1,1 @@
+ > -0000000000000000000000000000000000000000 $SUB
+ > +f40c9134ba1b6961e12f250868823f0092fb68a8 $SUB
+ > EOF
+ $ cd ..
+
+on clone (and update) without fakehome directory:
+
+ $ rm -fR "$FAKEHOME"
+ $ SUB="$FAKEHOME" hg clone -q main main2
+ abort: subrepo path contains illegal component: $SUB
+ [255]
+ $ test -d "$FAKEHOME"
+ [1]
+
+on clone (and update) with empty fakehome directory:
+
+ $ rm -fR "$FAKEHOME"
+ $ mkdir "$FAKEHOME"
+ $ SUB="$FAKEHOME" hg clone -q main main3
+ abort: subrepo path contains illegal component: $SUB
+ [255]
+ $ ls "$FAKEHOME"
+
+on clone (and update) with non-empty fakehome directory:
+
+ $ rm -fR "$FAKEHOME"
+ $ mkdir "$FAKEHOME"
+ $ touch "$FAKEHOME/a"
+ $ SUB="$FAKEHOME" hg clone -q main main4
+ abort: subrepo path contains illegal component: $SUB
+ [255]
+ $ ls "$FAKEHOME"
+ a
+
+on clone empty subrepo with non-empty fakehome directory,
+then pull (and update):
+
+ $ rm -fR "$FAKEHOME"
+ $ mkdir "$FAKEHOME"
+ $ touch "$FAKEHOME/a"
+ $ SUB="$FAKEHOME" hg clone -qr1 main main5
+ abort: subrepo path contains illegal component: $SUB
+ [255]
+ $ ls "$FAKEHOME"
+ a
+ $ test -d "$FAKEHOME/.hg"
+ [1]
+ $ SUB="$FAKEHOME" hg -R main5 pull -u
+ pulling from $TESTTMP/envvarsym/main
+ searching for changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 1 changes to 1 files
+ new changesets * (glob)
+ .hgsubstate: untracked file differs
+ abort: untracked files in working directory differ from files in requested revision
+ [255]
+ $ ls "$FAKEHOME"
+ a
+ $ test -d "$FAKEHOME/.hg"
+ [1]
+
+on clone empty subrepo with hg-managed fakehome directory,
+then pull (and update):
+
+ $ rm -fR "$FAKEHOME"
+ $ hg init "$FAKEHOME"
+ $ touch "$FAKEHOME/a"
+ $ hg -R "$FAKEHOME" ci -qAm 'add fakehome file'
+ $ SUB="$FAKEHOME" hg clone -qr1 main main6
+ abort: subrepo path contains illegal component: $SUB
+ [255]
+ $ ls "$FAKEHOME"
+ a
+ $ SUB="$FAKEHOME" hg -R main6 pull -u
+ pulling from $TESTTMP/envvarsym/main
+ searching for changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 1 changes to 1 files
+ new changesets * (glob)
+ .hgsubstate: untracked file differs
+ abort: untracked files in working directory differ from files in requested revision
+ [255]
+ $ ls "$FAKEHOME"
+ a
+
+on clone only symlink with hg-managed fakehome directory,
+then pull (and update):
+
+ $ rm -fR "$FAKEHOME"
+ $ hg init "$FAKEHOME"
+ $ touch "$FAKEHOME/a"
+ $ hg -R "$FAKEHOME" ci -qAm 'add fakehome file'
+ $ SUB="$FAKEHOME" hg clone -qr0 main main7
+ $ ls "$FAKEHOME"
+ a
+ $ SUB="$FAKEHOME" hg -R main7 pull -uf
+ pulling from $TESTTMP/envvarsym/main
+ searching for changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 2 changesets with 3 changes to 2 files
+ new changesets * (glob)
+ abort: subrepo path contains illegal component: $SUB
+ [255]
+ $ ls "$FAKEHOME"
+ a
+
+ $ cd ..
+
+#endif
diff --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -1504,6 +1504,8 @@ Separate sections from subsections
"usestore"
+ "sparse-revlog"
+
"profiling"
-----------
diff --git a/tests/test-init.t b/tests/test-init.t
--- a/tests/test-init.t
+++ b/tests/test-init.t
@@ -268,3 +268,25 @@ clone bookmarks
exporting bookmark test
$ hg -R remote-bookmarks bookmarks
test 0:08b9e9f63b32
+
+Check format constraint
+-----------------------
+
+ $ hg init issue6056 --config format.usegeneraldelta=0 --config format.sparse-revlog=0
+ $ cd issue6056
+ $ echo foo > 1
+ $ echo foo > 2
+ $ echo foo > 3
+ $ echo foo > 4
+ $ echo foo > 5
+ $ hg add *
+
+Build a bogus repository (sparserevlog without general delta)
+
+ $ hg commit -m 'initial changesets'
+ $ echo 'sparserevlog' >> .hg/requires
+ $ for x in `$TESTDIR/seq.py 100`; do
+ > echo $x >> `expr $x % 5 + 1`
+ > hg commit -m $x
+ > done
+ $ cd ..