[PATCH STABLE] subrepo: add test for Windows relative-ish path with drive letter

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH STABLE] subrepo: add test for Windows relative-ish path with drive letter

Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara <[hidden email]>
# Date 1549540241 -32400
#      Thu Feb 07 20:50:41 2019 +0900
# Branch stable
# Node ID adf01cdceea20b5ad6dacb11dbb1d94e5055e39c
# Parent  87a6e3c953e045d92147925fc71aad7c327fdbfd
subrepo: add test for Windows relative-ish path with drive letter

Matt Harbison pointed out that Windows had some weird path syntax.
Fortunately it's rejected appropriately by pathauditor, so we're safe.
Let's test the behavior as we have a special handling for Windows drive
letters.

This patch includes a basic example. Maybe we'll need to extend the test
case further, but writing such tests on Linux isn't easy.

diff --git a/tests/test-audit-subrepo.t b/tests/test-audit-subrepo.t
--- a/tests/test-audit-subrepo.t
+++ b/tests/test-audit-subrepo.t
@@ -660,3 +660,44 @@ then pull (and update):
   $ 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
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH STABLE] subrepo: add test for Windows relative-ish path with drive letter

Martin von Zweigbergk via Mercurial-devel


On Fri, Feb 8, 2019 at 6:42 AM Yuya Nishihara <[hidden email]> wrote:
# HG changeset patch
# User Yuya Nishihara <[hidden email]>
# Date 1549540241 -32400
#      Thu Feb 07 20:50:41 2019 +0900
# Branch stable
# Node ID adf01cdceea20b5ad6dacb11dbb1d94e5055e39c
# Parent  87a6e3c953e045d92147925fc71aad7c327fdbfd
subrepo: add test for Windows relative-ish path with drive letter

Queued for stable, thanks. Sorry about the delay.

_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH STABLE] subrepo: add test for Windows relative-ish path with drive letter

Matt Harbison-2
On Wed, 20 Feb 2019 00:56:42 -0500, Martin von Zweigbergk  
<[hidden email]> wrote:

> On Fri, Feb 8, 2019 at 6:42 AM Yuya Nishihara <[hidden email]> wrote:
>
>> # HG changeset patch
>> # User Yuya Nishihara <[hidden email]>
>> # Date 1549540241 -32400
>> #      Thu Feb 07 20:50:41 2019 +0900
>> # Branch stable
>> # Node ID adf01cdceea20b5ad6dacb11dbb1d94e5055e39c
>> # Parent  87a6e3c953e045d92147925fc71aad7c327fdbfd
>> subrepo: add test for Windows relative-ish path with drive letter
>>
>
> Queued for stable, thanks. Sorry about the delay.

Not sure what happened, but it looks like the abort is missing its exit  
code.  Do you want a followup, or can you amend it in place?

https://buildbot.mercurial-scm.org/builders/Win7%20x86_64%20hg%20tests%20%28stable%29/builds/244/steps/run-tests.py%20%28python%202.7.13%29/logs/stdio
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH STABLE] subrepo: add test for Windows relative-ish path with drive letter

Yuya Nishihara
On Wed, 20 Feb 2019 20:00:48 -0500, Matt Harbison wrote:

> On Wed, 20 Feb 2019 00:56:42 -0500, Martin von Zweigbergk  
> <[hidden email]> wrote:
>
> > On Fri, Feb 8, 2019 at 6:42 AM Yuya Nishihara <[hidden email]> wrote:
> >
> >> # HG changeset patch
> >> # User Yuya Nishihara <[hidden email]>
> >> # Date 1549540241 -32400
> >> #      Thu Feb 07 20:50:41 2019 +0900
> >> # Branch stable
> >> # Node ID adf01cdceea20b5ad6dacb11dbb1d94e5055e39c
> >> # Parent  87a6e3c953e045d92147925fc71aad7c327fdbfd
> >> subrepo: add test for Windows relative-ish path with drive letter
> >>
> >
> > Queued for stable, thanks. Sorry about the delay.
>
> Not sure what happened, but it looks like the abort is missing its exit  
> code.

Oops. Appears that I didn't simulate Windows result properly in my brain.

>  Do you want a followup, or can you amend it in place?

Can you send a follow up? It's behind a merge commit, so better to not
rewrite it.
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH STABLE] subrepo: add test for Windows relative-ish path with drive letter

Pulkit Goyal


On Thu, Feb 21, 2019 at 4:16 AM Yuya Nishihara <[hidden email]> wrote:
On Wed, 20 Feb 2019 20:00:48 -0500, Matt Harbison wrote:
> On Wed, 20 Feb 2019 00:56:42 -0500, Martin von Zweigbergk 
> <[hidden email]> wrote:
>
> > On Fri, Feb 8, 2019 at 6:42 AM Yuya Nishihara <[hidden email]> wrote:
> >
> >> # HG changeset patch
> >> # User Yuya Nishihara <[hidden email]>
> >> # Date 1549540241 -32400
> >> #      Thu Feb 07 20:50:41 2019 +0900
> >> # Branch stable
> >> # Node ID adf01cdceea20b5ad6dacb11dbb1d94e5055e39c
> >> # Parent  87a6e3c953e045d92147925fc71aad7c327fdbfd
> >> subrepo: add test for Windows relative-ish path with drive letter
> >>
> >
> > Queued for stable, thanks. Sorry about the delay.
>
> Not sure what happened, but it looks like the abort is missing its exit 
> code.

Oops. Appears that I didn't simulate Windows result properly in my brain.

>  Do you want a followup, or can you amend it in place?

Can you send a follow up? It's behind a merge commit, so better to not
rewrite it.

(You can now evolve merge commits using `hg evolve`)

_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel