Patchwork [1,of,2] tests: add unix-permissions guards

login
register
mail settings
Submitter timeless@mozdev.org
Date Jan. 12, 2016, 5:54 a.m.
Message ID <c561f00fa2ffc7b2967a.1452578069@waste.org>
Download mbox | patch
Permalink /patch/12678/
State Changes Requested
Headers show

Comments

timeless@mozdev.org - Jan. 12, 2016, 5:54 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1452576441 18000
#      Tue Jan 12 00:27:21 2016 -0500
# Node ID c561f00fa2ffc7b2967ad8231b052c74084df367
# Parent  4571c0b383378f5eec5189e3a39c672a169ce566
tests: add unix-permissions guards
Augie Fackler - Jan. 12, 2016, 3:22 p.m.
On Mon, Jan 11, 2016 at 11:54:29PM -0600, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1452576441 18000
> #      Tue Jan 12 00:27:21 2016 -0500
> # Node ID c561f00fa2ffc7b2967ad8231b052c74084df367
> # Parent  4571c0b383378f5eec5189e3a39c672a169ce566
> tests: add unix-permissions guards

This seems a little weird to me - can you provide some more
explanation of why in the log message?

(I have a guess, but I definitely won't have a guess in 3 months or so
when I'm trying to figure out what on earth is going on here.)

>
> diff --git a/tests/test-backout.t b/tests/test-backout.t
> --- a/tests/test-backout.t
> +++ b/tests/test-backout.t
> @@ -144,8 +144,13 @@
>    $ touch -t 200001010000 c
>    $ hg status -A
>    C c
> +#if unix-permissions
>    $ hg debugstate --nodates
>    n 644         12 set                 c
> +#else
> +  $ hg debugstate --nodates
> +  n 755         12 set                 c
> +#endif
>    $ hg backout -d '6 0' -m 'to be rollback-ed soon' -r .
>    adding b
>    removing c
> diff --git a/tests/test-convert-svn-sink.t b/tests/test-convert-svn-sink.t
> --- a/tests/test-convert-svn-sink.t
> +++ b/tests/test-convert-svn-sink.t
> @@ -255,9 +255,14 @@
>
>    $ hg --cwd a up 5
>    0 files updated, 0 files merged, 1 files removed, 0 files unresolved
> +#endif
> +#if symlink unix-permissions
>    $ hg --cwd a --config extensions.strip= strip -r 6
>    saved backup bundle to $TESTTMP/a/.hg/strip-backup/bd4f7b7a7067-ed505e42-backup.hg (glob)
> -
> +#endif
> +#if symlink no-unix-permissions
> +  $ hg --cwd a --config extensions.strip= strip -r 6
> +  saved backup bundle to $TESTTMP/a/.hg/strip-backup/acd3468d7783-a37941a0-backup.hg (glob)
>  #endif
>
>  Convert with --full adds and removes files that didn't change
> diff --git a/tests/test-dirstate.t b/tests/test-dirstate.t
> --- a/tests/test-dirstate.t
> +++ b/tests/test-dirstate.t
> @@ -50,17 +50,28 @@
>  Status must not set a's entry to unset (issue1790):
>
>    $ hg status
> +#if unix-permissions
>    $ hg debugstate
>    n 644          2 2021-01-01 12:00:00 a
> +#else
> +  $ hg debugstate
> +  n 755          2 2021-01-01 12:00:00 a
> +#endif
>
>  Test modulo storage/comparison of absurd dates:
>
>  #if no-aix
>    $ touch -t 195001011200 a
>    $ hg st
> +#endif
> +#if no-aix unix-permissions
>    $ hg debugstate
>    n 644          2 2018-01-19 15:14:08 a
>  #endif
> +#if no-aix no-unix-permissions
> +  $ hg debugstate
> +  n 755          2 2018-01-19 15:14:08 a
> +#endif
>
>  Verify that exceptions during a dirstate change leave the dirstate
>  coherent (issue4353)
> diff --git a/tests/test-keyword.t b/tests/test-keyword.t
> --- a/tests/test-keyword.t
> +++ b/tests/test-keyword.t
> @@ -649,8 +649,16 @@
>
>  #if symlink
>    $ cp sym i
> +#endif
> +#if symlink unix-permissions
>    $ ls -l i
>    -rw-r--r--* (glob)
> +#endif
> +#if symlink no-unix-permissions
> +  $ ls -l i
> +  -rwxrwxrwx* (glob)
> +#endif
> +#if symlink
>    $ head -1 i
>    expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
>    $ hg copy --after --verbose sym i
> diff --git a/tests/test-largefiles-update.t b/tests/test-largefiles-update.t
> --- a/tests/test-largefiles-update.t
> +++ b/tests/test-largefiles-update.t
> @@ -68,15 +68,22 @@
>
>    $ hg up
>    0 files updated, 0 files merged, 0 files removed, 0 files unresolved
> +#if unix-permissions
>    $ hg debugdirstate --large --nodate
>    n 644          7 set                 large1
>    n 644         13 set                 large2
> +#else
> +  $ hg debugdirstate --large --nodate
> +  n 755          7 unset               large1
> +  n 755         13 unset               large2
> +#endif
>
>  Test that lfdirstate keeps track of last modification of largefiles and
>  prevents unnecessary hashing of content - also after linear/noop update
>
>    $ sleep 1
>    $ hg st
> +#if unix-permissions
>    $ hg debugdirstate --large --nodate
>    n 644          7 set                 large1
>    n 644         13 set                 large2
> @@ -85,6 +92,16 @@
>    $ hg debugdirstate --large --nodate
>    n 644          7 set                 large1
>    n 644         13 set                 large2
> +#else
> +  $ hg debugdirstate --large --nodate
> +  n 755          7 set                 large1
> +  n 755         13 set                 large2
> +  $ hg up
> +  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
> +  $ hg debugdirstate --large --nodate
> +  n 755          7 set                 large1
> +  n 755         13 set                 large2
> +#endif
>
>  Test that "hg merge" updates largefiles from "other" correctly
>
> diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
> --- a/tests/test-largefiles.t
> +++ b/tests/test-largefiles.t
> @@ -47,6 +47,7 @@
>    $ touch large1 sub/large2
>    $ sleep 1
>    $ hg st
> +#if unix-permissions
>    $ hg debugstate --nodates
>    n 644         41 set                 .hglf/large1
>    n 644         41 set                 .hglf/sub/large2
> @@ -55,6 +56,16 @@
>    $ hg debugstate --large --nodates
>    n 644          7 set                 large1
>    n 644          7 set                 sub/large2
> +#else
> +  $ hg debugstate --nodates
> +  n 755         41 set                 .hglf/large1
> +  n 755         41 set                 .hglf/sub/large2
> +  n 755          8 set                 normal1
> +  n 755          8 set                 sub/normal2
> +  $ hg debugstate --large --nodates
> +  n 755          7 set                 large1
> +  n 755          7 set                 sub/large2
> +#endif
>    $ echo normal11 > normal1
>    $ echo normal22 > sub/normal2
>    $ echo large11 > large1
> diff --git a/tests/test-rebuildstate.t b/tests/test-rebuildstate.t
> --- a/tests/test-rebuildstate.t
> +++ b/tests/test-rebuildstate.t
> @@ -78,6 +78,7 @@
>    ? baz
>    C foo
>    $ hg debugadddrop --normal-lookup baz
> +#if unix-permissions
>    $ hg debugdirstate --nodates
>    r   0          0 * bar (glob)
>    n   0         -1 * baz (glob)
> @@ -88,6 +89,18 @@
>    r   0          0 * bar (glob)
>    n 644          0 * foo (glob)
>    a   0         -1 * qux (glob)
> +#else
> +  $ hg debugdirstate --nodates
> +  r   0          0 * bar (glob)
> +  n   0         -1 * baz (glob)
> +  n 755          0 * foo (glob)
> +  a   0         -1 * qux (glob)
> +  $ hg debugrebuilddirstate --minimal
> +  $ hg debugdirstate --nodates
> +  r   0          0 * bar (glob)
> +  n 755          0 * foo (glob)
> +  a   0         -1 * qux (glob)
> +#endif
>    $ hg status -A
>    A qux
>    R bar
> @@ -104,10 +117,17 @@
>    R bar
>    ? baz
>    C foo
> +#if unix-permissions
>    $ hg debugdirstate --nodates
>    r   0          0 * bar (glob)
>    n 644          0 * foo (glob)
>    a   0         -1 * qux (glob)
> +#else
> +  $ hg debugdirstate --nodates
> +  r   0          0 * bar (glob)
> +  n 755          0 * foo (glob)
> +  a   0         -1 * qux (glob)
> +#endif
>    $ hg debugadddrop --drop foo
>    $ hg debugdirstate --nodates
>    r   0          0 * bar (glob)
> diff --git a/tests/test-symlinks.t b/tests/test-symlinks.t
> --- a/tests/test-symlinks.t
> +++ b/tests/test-symlinks.t
> @@ -33,7 +33,7 @@
>    $ hg commit -m 'is there a bug?'
>    $ cd ..
>
> -
> +#if unix-permissions
>  == fifo & ignore ==
>
>    $ hg init test; cd test;
> @@ -66,7 +66,7 @@
>    a.c: unsupported file type (type is fifo)
>    ! a.c
>    $ cd ..
> -
> +#endif
>
>  == symlinks from outside the tree ==
>
> diff --git a/tests/test-tools.t b/tests/test-tools.t
> --- a/tests/test-tools.t
> +++ b/tests/test-tools.t
> @@ -38,7 +38,7 @@
>    $ f foo
>    foo:
>
> -#if symlink
> +#if unix-permissions
>    $ f foo --mode
>    foo: mode=644
>  #endif
> @@ -88,7 +88,7 @@
>    $ cd ..
>
>  Yadda is a symlink
> -#if symlink
> +#if unix-permissions symlink
>    $ f -qr dir -HB 17
>    dir: directory with 3 files
>    dir/bar:
> diff --git a/tests/test-transplant.t b/tests/test-transplant.t
> --- a/tests/test-transplant.t
> +++ b/tests/test-transplant.t
> @@ -946,8 +946,13 @@
>
>    $ cat r1
>    Y1
> +#if unix-permissions
>    $ hg debugstate | grep ' r1$'
>    n 644          3 unset               r1
> +#else
> +  $ hg debugstate | grep ' r1$'
> +  n 755          3 unset               r1
> +#endif
>    $ hg status -A r1
>    M r1
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel
timeless - Jan. 12, 2016, 4:09 p.m.
On Tue, Jan 12, 2016 at 10:22 AM, Augie Fackler <raf@durin42.com> wrote:
> On Mon, Jan 11, 2016 at 11:54:29PM -0600, timeless wrote:
>> # HG changeset patch
>> # User timeless <timeless@mozdev.org>
>> # Date 1452576441 18000
>> #      Tue Jan 12 00:27:21 2016 -0500
>> # Node ID c561f00fa2ffc7b2967ad8231b052c74084df367
>> # Parent  4571c0b383378f5eec5189e3a39c672a169ce566
>> tests: add unix-permissions guards
>
> This seems a little weird to me - can you provide some more
> explanation of why in the log message?
>
> (I have a guess, but I definitely won't have a guess in 3 months or so
> when I'm trying to figure out what on earth is going on here.)

The short answer is that systems that "care" about execute treat
systems that don't support execute as if all files are executable,
otherwise anyone trying to "run" any "scripts" or "programs" from them
would be upset because they wouldn't work at all.

Thus, all 644 become 755.
Augie Fackler - Jan. 12, 2016, 4:49 p.m.
> On Jan 12, 2016, at 11:09, timeless <timeless@gmail.com> wrote:
> 
> On Tue, Jan 12, 2016 at 10:22 AM, Augie Fackler <raf@durin42.com> wrote:
>> On Mon, Jan 11, 2016 at 11:54:29PM -0600, timeless wrote:
>>> # HG changeset patch
>>> # User timeless <timeless@mozdev.org>
>>> # Date 1452576441 18000
>>> #      Tue Jan 12 00:27:21 2016 -0500
>>> # Node ID c561f00fa2ffc7b2967ad8231b052c74084df367
>>> # Parent  4571c0b383378f5eec5189e3a39c672a169ce566
>>> tests: add unix-permissions guards
>> 
>> This seems a little weird to me - can you provide some more
>> explanation of why in the log message?
>> 
>> (I have a guess, but I definitely won't have a guess in 3 months or so
>> when I'm trying to figure out what on earth is going on here.)
> 
> The short answer is that systems that "care" about execute treat
> systems that don't support execute as if all files are executable,
> otherwise anyone trying to "run" any "scripts" or "programs" from them
> would be upset because they wouldn't work at all.
> 
> Thus, all 644 become 755.

This was my socratic way of asking you to improve the commit message and resend the patches. :)

> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/tests/test-backout.t b/tests/test-backout.t
--- a/tests/test-backout.t
+++ b/tests/test-backout.t
@@ -144,8 +144,13 @@ 
   $ touch -t 200001010000 c
   $ hg status -A
   C c
+#if unix-permissions
   $ hg debugstate --nodates
   n 644         12 set                 c
+#else
+  $ hg debugstate --nodates
+  n 755         12 set                 c
+#endif
   $ hg backout -d '6 0' -m 'to be rollback-ed soon' -r .
   adding b
   removing c
diff --git a/tests/test-convert-svn-sink.t b/tests/test-convert-svn-sink.t
--- a/tests/test-convert-svn-sink.t
+++ b/tests/test-convert-svn-sink.t
@@ -255,9 +255,14 @@ 
 
   $ hg --cwd a up 5
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+#endif
+#if symlink unix-permissions
   $ hg --cwd a --config extensions.strip= strip -r 6
   saved backup bundle to $TESTTMP/a/.hg/strip-backup/bd4f7b7a7067-ed505e42-backup.hg (glob)
-
+#endif
+#if symlink no-unix-permissions
+  $ hg --cwd a --config extensions.strip= strip -r 6
+  saved backup bundle to $TESTTMP/a/.hg/strip-backup/acd3468d7783-a37941a0-backup.hg (glob)
 #endif
 
 Convert with --full adds and removes files that didn't change
diff --git a/tests/test-dirstate.t b/tests/test-dirstate.t
--- a/tests/test-dirstate.t
+++ b/tests/test-dirstate.t
@@ -50,17 +50,28 @@ 
 Status must not set a's entry to unset (issue1790):
 
   $ hg status
+#if unix-permissions
   $ hg debugstate
   n 644          2 2021-01-01 12:00:00 a
+#else
+  $ hg debugstate
+  n 755          2 2021-01-01 12:00:00 a
+#endif
 
 Test modulo storage/comparison of absurd dates:
 
 #if no-aix
   $ touch -t 195001011200 a
   $ hg st
+#endif
+#if no-aix unix-permissions
   $ hg debugstate
   n 644          2 2018-01-19 15:14:08 a
 #endif
+#if no-aix no-unix-permissions
+  $ hg debugstate
+  n 755          2 2018-01-19 15:14:08 a
+#endif
 
 Verify that exceptions during a dirstate change leave the dirstate
 coherent (issue4353)
diff --git a/tests/test-keyword.t b/tests/test-keyword.t
--- a/tests/test-keyword.t
+++ b/tests/test-keyword.t
@@ -649,8 +649,16 @@ 
 
 #if symlink
   $ cp sym i
+#endif
+#if symlink unix-permissions
   $ ls -l i
   -rw-r--r--* (glob)
+#endif
+#if symlink no-unix-permissions
+  $ ls -l i
+  -rwxrwxrwx* (glob)
+#endif
+#if symlink
   $ head -1 i
   expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
   $ hg copy --after --verbose sym i
diff --git a/tests/test-largefiles-update.t b/tests/test-largefiles-update.t
--- a/tests/test-largefiles-update.t
+++ b/tests/test-largefiles-update.t
@@ -68,15 +68,22 @@ 
 
   $ hg up
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+#if unix-permissions
   $ hg debugdirstate --large --nodate
   n 644          7 set                 large1
   n 644         13 set                 large2
+#else
+  $ hg debugdirstate --large --nodate
+  n 755          7 unset               large1
+  n 755         13 unset               large2
+#endif
 
 Test that lfdirstate keeps track of last modification of largefiles and
 prevents unnecessary hashing of content - also after linear/noop update
 
   $ sleep 1
   $ hg st
+#if unix-permissions
   $ hg debugdirstate --large --nodate
   n 644          7 set                 large1
   n 644         13 set                 large2
@@ -85,6 +92,16 @@ 
   $ hg debugdirstate --large --nodate
   n 644          7 set                 large1
   n 644         13 set                 large2
+#else
+  $ hg debugdirstate --large --nodate
+  n 755          7 set                 large1
+  n 755         13 set                 large2
+  $ hg up
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg debugdirstate --large --nodate
+  n 755          7 set                 large1
+  n 755         13 set                 large2
+#endif
 
 Test that "hg merge" updates largefiles from "other" correctly
 
diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -47,6 +47,7 @@ 
   $ touch large1 sub/large2
   $ sleep 1
   $ hg st
+#if unix-permissions
   $ hg debugstate --nodates
   n 644         41 set                 .hglf/large1
   n 644         41 set                 .hglf/sub/large2
@@ -55,6 +56,16 @@ 
   $ hg debugstate --large --nodates
   n 644          7 set                 large1
   n 644          7 set                 sub/large2
+#else
+  $ hg debugstate --nodates
+  n 755         41 set                 .hglf/large1
+  n 755         41 set                 .hglf/sub/large2
+  n 755          8 set                 normal1
+  n 755          8 set                 sub/normal2
+  $ hg debugstate --large --nodates
+  n 755          7 set                 large1
+  n 755          7 set                 sub/large2
+#endif
   $ echo normal11 > normal1
   $ echo normal22 > sub/normal2
   $ echo large11 > large1
diff --git a/tests/test-rebuildstate.t b/tests/test-rebuildstate.t
--- a/tests/test-rebuildstate.t
+++ b/tests/test-rebuildstate.t
@@ -78,6 +78,7 @@ 
   ? baz
   C foo
   $ hg debugadddrop --normal-lookup baz
+#if unix-permissions
   $ hg debugdirstate --nodates
   r   0          0 * bar (glob)
   n   0         -1 * baz (glob)
@@ -88,6 +89,18 @@ 
   r   0          0 * bar (glob)
   n 644          0 * foo (glob)
   a   0         -1 * qux (glob)
+#else
+  $ hg debugdirstate --nodates
+  r   0          0 * bar (glob)
+  n   0         -1 * baz (glob)
+  n 755          0 * foo (glob)
+  a   0         -1 * qux (glob)
+  $ hg debugrebuilddirstate --minimal
+  $ hg debugdirstate --nodates
+  r   0          0 * bar (glob)
+  n 755          0 * foo (glob)
+  a   0         -1 * qux (glob)
+#endif
   $ hg status -A
   A qux
   R bar
@@ -104,10 +117,17 @@ 
   R bar
   ? baz
   C foo
+#if unix-permissions
   $ hg debugdirstate --nodates
   r   0          0 * bar (glob)
   n 644          0 * foo (glob)
   a   0         -1 * qux (glob)
+#else
+  $ hg debugdirstate --nodates
+  r   0          0 * bar (glob)
+  n 755          0 * foo (glob)
+  a   0         -1 * qux (glob)
+#endif
   $ hg debugadddrop --drop foo
   $ hg debugdirstate --nodates
   r   0          0 * bar (glob)
diff --git a/tests/test-symlinks.t b/tests/test-symlinks.t
--- a/tests/test-symlinks.t
+++ b/tests/test-symlinks.t
@@ -33,7 +33,7 @@ 
   $ hg commit -m 'is there a bug?'
   $ cd ..
 
-
+#if unix-permissions
 == fifo & ignore ==
 
   $ hg init test; cd test;
@@ -66,7 +66,7 @@ 
   a.c: unsupported file type (type is fifo)
   ! a.c
   $ cd ..
-
+#endif
 
 == symlinks from outside the tree ==
 
diff --git a/tests/test-tools.t b/tests/test-tools.t
--- a/tests/test-tools.t
+++ b/tests/test-tools.t
@@ -38,7 +38,7 @@ 
   $ f foo
   foo:
 
-#if symlink
+#if unix-permissions
   $ f foo --mode
   foo: mode=644
 #endif
@@ -88,7 +88,7 @@ 
   $ cd ..
 
 Yadda is a symlink
-#if symlink
+#if unix-permissions symlink
   $ f -qr dir -HB 17
   dir: directory with 3 files
   dir/bar:
diff --git a/tests/test-transplant.t b/tests/test-transplant.t
--- a/tests/test-transplant.t
+++ b/tests/test-transplant.t
@@ -946,8 +946,13 @@ 
 
   $ cat r1
   Y1
+#if unix-permissions
   $ hg debugstate | grep ' r1$'
   n 644          3 unset               r1
+#else
+  $ hg debugstate | grep ' r1$'
+  n 755          3 unset               r1
+#endif
   $ hg status -A r1
   M r1