[PATCH] tests: Set the group of the test directory of test-inherit-mode to one of the user's groups

Javi Merino cibervicho at gmail.com
Thu Mar 1 17:39:50 CST 2012


# HG changeset patch
# User Javi Merino <cibervicho at gmail.com>
# Date 1330644592 0
# Node ID 92ce7b21428515eb0b1489e7ba37cfaf152ff54b
# Parent  0196c437ca9fc26d872b21286bee6959f1cd73e6
tests: Set the group of the test directory of test-inherit-mode to one of the user's groups

Some $TMPDIRs create folders owned by a group which the user doesn't
belong to.  test-inherit-mode then fails when chmod tries to set the
setgid bit because the user doesn't have permission to do so.  This
patch sets the group of the parent directory to one of the users'
groups, so that the test can modify the setgid group of any of the
directories created inside it afterwards.  Forwarded: no

diff --git a/tests/test-inherit-mode.t b/tests/test-inherit-mode.t
--- a/tests/test-inherit-mode.t
+++ b/tests/test-inherit-mode.t
@@ -8,6 +8,7 @@ test that new files created in .hg inher
 just in case somebody has a strange $TMPDIR
 
   $ chmod g-s dir
+  $ chgrp $(groups | awk '{print $1}') dir
   $ cd dir
 
   $ cat >printmodes.py <<EOF


More information about the Mercurial-devel mailing list