Patchwork [2,of,2] tests: remove glob lines which unnecessary match / for \ on windows

login
register
mail settings
Submitter Simon Heimberg
Date Feb. 23, 2013, 10:10 p.m.
Message ID <3312b3d481a6e61f9881.1361657451@deb64virt.virtual>
Download mbox | patch
Permalink /patch/1046/
State Accepted
Headers show

Comments

Simon Heimberg - Feb. 23, 2013, 10:10 p.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1361656497 -3600
# Branch stable
# Node ID 3312b3d481a6e61f988125d4472b53c7a0b00211
# Parent  3660cfb8b145e88b77228a1676d5c37113d93595
tests: remove glob lines which unnecessary match / for \ on windows

This lines were reported as unnecessary when running the tests on windows
because the path was already printed with a slash and not a backslash.
Matt Mackall - Feb. 25, 2013, 10:19 p.m.
On Sat, 2013-02-23 at 23:10 +0100, Simon Heimberg wrote:
> # HG changeset patch
> # User Simon Heimberg <simohe@besonet.ch>
> # Date 1361656497 -3600
> # Branch stable
> # Node ID 3312b3d481a6e61f988125d4472b53c7a0b00211
> # Parent  3660cfb8b145e88b77228a1676d5c37113d93595
> tests: remove glob lines which unnecessary match / for \ on windows
> 
> This lines were reported as unnecessary when running the tests on windows
> because the path was already printed with a slash and not a backslash.

I think I'm going to start insisting that such patches come with
check-code recipes. It's the only hope we have for not hitting these
issues constantly.
Simon Heimberg - Feb. 26, 2013, 8:42 a.m.
Having a check code recipe sounds good, but I have no idea how this could be done.
I do not know of any rule when an "os path" and when a "hg path" is printed. And also not when ui.slash is considered (when writing an "os path") and when it is not.
Sometimes it is unclear why some lines need no glob but similar ones do not. An example is mentioned in the introduction email.

I only see one possibility to avoid similar patches in the hg history. To run any modified test on windows before it's patch is pushed.
I fear that I am not the only developer who can not do this. So this would have to be done by a crew member (except when a developer mentions he has run the test on windows).

Some related threads:
locate command ignoring ui.slash: http://www.selenic.com/pipermail/mercurial-devel/2009-July/014187.html
mads about glob matching and ui.slash: http://www.selenic.com/pipermail/mercurial-devel/2012-October/045168.html

> -----Urspr√ľngliche Nachricht-----
> Von: Matt Mackall [mailto:mpm@selenic.com]
> Gesendet: Montag, 25. Februar 2013 23:19
> An: Simon Heimberg
> Cc: Mercurial-devel
> Betreff: Re: [PATCH 2 of 2] tests: remove glob lines which unnecessary match /
> for \ on windows
> 
> On Sat, 2013-02-23 at 23:10 +0100, Simon Heimberg wrote:
> > # HG changeset patch
> > # User Simon Heimberg <simohe@besonet.ch> # Date 1361656497 -3600 #
> > Branch stable # Node ID 3312b3d481a6e61f988125d4472b53c7a0b00211
> > # Parent  3660cfb8b145e88b77228a1676d5c37113d93595
> > tests: remove glob lines which unnecessary match / for \ on windows
> >
> > This lines were reported as unnecessary when running the tests on
> > windows because the path was already printed with a slash and not a
> backslash.
> 
> I think I'm going to start insisting that such patches come with check-code
> recipes. It's the only hope we have for not hitting these issues constantly.
> 
> --
> Mathematics is the supreme nostalgia of our time.
Matt Mackall - Feb. 26, 2013, 6:01 p.m.
On Tue, 2013-02-26 at 09:42 +0100, Simon He. wrote:
> Having a check code recipe sounds good, but I have no idea how this could be done.
> I do not know of any rule when an "os path" and when a "hg path" is printed.

$ grep 'pulling from .TESTTMP/' *.t
test-blackbox.t:  pulling from $TESTTMP/blackboxtest   <- FAILED
test-bookmarks-pushpull.t:  pulling from $TESTTMP/a (glob)
test-issue1502.t:  pulling from $TESTTMP/foo (glob)
test-issue1502.t:  pulling from $TESTTMP/foo (glob)
test-issue1802.t:  pulling from $TESTTMP/unix-repo
test-largefiles.t:  pulling from $TESTTMP/a (glob)
test-largefiles.t:  pulling from $TESTTMP/b (glob)
test-obsolete-checkheads.t:  pulling from $TESTTMP/remote (glob)
test-pull-r.t:  pulling from $TESTTMP/repo2 (glob)
test-rebase-pull.t:  pulling from $TESTTMP/a (glob)
test-rebase-pull.t:  pulling from $TESTTMP/a (glob)
test-rebase-pull.t:  pulling from $TESTTMP/a (glob)
test-rebase-pull.t:  pulling from $TESTTMP/a (glob)
test-rebase-pull.t:  pulling from $TESTTMP/a (glob)
test-rebase-pull.t:  pulling from $TESTTMP/a (glob)
test-subrepo-git.t:  pulling from $TESTTMP/t (glob)
test-subrepo.t:  pulling from $TESTTMP/t (glob)

This suggests the rule: "if it starts with '  pulling from $TESTTMP/',
it better end with (glob)".

The great bulk of the places where we use '\' on Windows can be covered
by maybe a dozen patterns.

Patch

diff -r 3660cfb8b145 -r 3312b3d481a6 tests/test-blackbox.t
--- a/tests/test-blackbox.t	Sat Feb 23 22:07:38 2013 +0100
+++ b/tests/test-blackbox.t	Sat Feb 23 22:54:57 2013 +0100
@@ -57,7 +57,7 @@ 
   (run 'hg update' to get a working copy)
   $ hg blackbox -l 3
   1970/01/01 00:00:00 bob> pull
-  1970/01/01 00:00:00 bob> 1 incoming changes - new heads: d02f48003e62 (glob)
+  1970/01/01 00:00:00 bob> 1 incoming changes - new heads: d02f48003e62
   1970/01/01 00:00:00 bob> pull exited None after * seconds (glob)
 
 extension and python hooks - use the eol extension for a pythonhook
diff -r 3660cfb8b145 -r 3312b3d481a6 tests/test-diff-color.t
--- a/tests/test-diff-color.t	Sat Feb 23 22:07:38 2013 +0100
+++ b/tests/test-diff-color.t	Sat Feb 23 22:54:57 2013 +0100
@@ -152,7 +152,7 @@ 
    c
    c
   \x1b[0;32m+aa\x1b[0m (esc)
-  \x1b[0;1mdiff --git a/sub/b b/sub/b\x1b[0m (glob) (esc)
+  \x1b[0;1mdiff --git a/sub/b b/sub/b\x1b[0m (esc)
   \x1b[0;31;1m--- a/sub/b\x1b[0m (esc)
   \x1b[0;32;1m+++ b/sub/b\x1b[0m (esc)
   \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
diff -r 3660cfb8b145 -r 3312b3d481a6 tests/test-subrepo.t
--- a/tests/test-subrepo.t	Sat Feb 23 22:07:38 2013 +0100
+++ b/tests/test-subrepo.t	Sat Feb 23 22:54:57 2013 +0100
@@ -269,9 +269,9 @@ 
   $ cd ..
   $ hg clone t tc
   updating to branch default
-  cloning subrepo s from $TESTTMP/t/s (glob)
+  cloning subrepo s from $TESTTMP/t/s
   cloning subrepo s/ss from $TESTTMP/t/s/ss (glob)
-  cloning subrepo t from $TESTTMP/t/t (glob)
+  cloning subrepo t from $TESTTMP/t/t
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd tc
   $ hg debugsub
@@ -292,10 +292,10 @@ 
   pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
   searching for changes
   no changes found
-  pushing subrepo s to $TESTTMP/t/s (glob)
+  pushing subrepo s to $TESTTMP/t/s
   searching for changes
   no changes found
-  pushing subrepo t to $TESTTMP/t/t (glob)
+  pushing subrepo t to $TESTTMP/t/t
   searching for changes
   adding changesets
   adding manifests
@@ -317,7 +317,7 @@ 
   pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
   searching for changes
   no changes found
-  pushing subrepo s to $TESTTMP/t/s (glob)
+  pushing subrepo s to $TESTTMP/t/s
   searching for changes
   abort: push creates new remote head 12a213df6fa9! (in subrepo s)
   (did you forget to merge? use push -f to force)
@@ -327,13 +327,13 @@ 
   pushing subrepo s/ss to $TESTTMP/t/s/ss (glob)
   searching for changes
   no changes found
-  pushing subrepo s to $TESTTMP/t/s (glob)
+  pushing subrepo s to $TESTTMP/t/s
   searching for changes
   adding changesets
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files (+1 heads)
-  pushing subrepo t to $TESTTMP/t/t (glob)
+  pushing subrepo t to $TESTTMP/t/t
   searching for changes
   no changes found
   searching for changes
@@ -366,7 +366,7 @@ 
 should pull t
 
   $ hg up
-  pulling subrepo t from $TESTTMP/t/t (glob)
+  pulling subrepo t from $TESTTMP/t/t
   searching for changes
   adding changesets
   adding manifests
@@ -572,7 +572,7 @@ 
   adding .hgsub
   $ hg clone repo repo2
   updating to branch default
-  cloning subrepo s from $TESTTMP/repo/s (glob)
+  cloning subrepo s from $TESTTMP/repo/s
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg -q -R repo2 pull -u
   $ echo 1 > repo2/s/a