merge with stable
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 19 Feb 2019 21:55:05 -0800
changeset 41742 3d5a73c8a417
parent 41741 a91615b71679 (current diff)
parent 41725 ffbf742bfe1f (diff)
child 41743 1c4d6ab2ecb8
merge with stable
--- a/tests/test-audit-subrepo.t	Fri Feb 15 15:49:17 2019 -0500
+++ b/tests/test-audit-subrepo.t	Tue Feb 19 21:55:05 2019 -0800
@@ -660,3 +660,44 @@
   $ cd ..
 
 #endif
+
+Test drive letter
+-----------------
+
+Windows has a weird relative path that can change the drive letter, which
+should also be prohibited on Windows.
+
+prepare tampered repo:
+
+  $ hg init driveletter
+  $ cd driveletter
+  $ hg import --bypass -qm 'add subrepo "X:"' - <<'EOF'
+  > diff --git a/.hgsub b/.hgsub
+  > new file mode 100644
+  > --- /dev/null
+  > +++ b/.hgsub
+  > @@ -0,0 +1,1 @@
+  > +X: = foo
+  > diff --git a/.hgsubstate b/.hgsubstate
+  > new file mode 100644
+  > --- /dev/null
+  > +++ b/.hgsubstate
+  > @@ -0,0 +1,1 @@
+  > +0000000000000000000000000000000000000000 X:
+  > EOF
+  $ cd ..
+
+on clone (and update):
+
+#if windows
+
+  $ hg clone -q driveletter driveletter2
+  abort: path contains illegal component: X:
+
+#else
+
+  $ hg clone -q driveletter driveletter2
+  $ ls driveletter2
+  X:
+
+#endif