tests/test-hardlinks-safety
author Jim Hague <jim.hague@acm.org>
Fri, 09 Jan 2009 22:15:08 +0000
changeset 7618 6c89dd0a7797
parent 6920 7e5e13bee8f4
permissions -rwxr-xr-x
Bugzilla 2.18 and on use contrib/sendbugmail.pl, not processmail. During 2.17, Bugzilla ditched the old 'processmail' script. With 2.18 contrib/sendbugmail.pl arrived in its place. For notification emails to work properly, sendbugmail.pl requires as its second parameter the Bugzilla user who made the commit. Otherwise the user will not be recognised as the committer, and will receive notification emails about the commit regardless of their preference about being notified on their own commits. This parameter should be given to processmail also, but wasn't for historical reasons. Add new config with the local Bugzilla install directory, and provide defaults for the notify string which should work for most setups. Still permit notify string to be specified, and for backwards compatibility with any extant notify strings try first interpolating notify string with old-style single bug ID argument. Add new 2.18 support version to introduce sendbugmail.pl. In other words, this update should be backwards-compatible with existing installations, but offers simplified setup in most cases. And as a bonus Bugzilla notification emails will be dispatched correctly; notifiers will not receive an email unless configured to do so.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6835
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     1
#!/bin/sh
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
     2
6920
7e5e13bee8f4 Make test-hardlinks-safety portable
Christian Ebert <blacktrash@gmx.net>
parents: 6869
diff changeset
     3
# some implementations of cp can't create hardlinks
7e5e13bee8f4 Make test-hardlinks-safety portable
Christian Ebert <blacktrash@gmx.net>
parents: 6869
diff changeset
     4
cat > cp.py <<EOF
7e5e13bee8f4 Make test-hardlinks-safety portable
Christian Ebert <blacktrash@gmx.net>
parents: 6869
diff changeset
     5
from mercurial import util
7e5e13bee8f4 Make test-hardlinks-safety portable
Christian Ebert <blacktrash@gmx.net>
parents: 6869
diff changeset
     6
import sys
7e5e13bee8f4 Make test-hardlinks-safety portable
Christian Ebert <blacktrash@gmx.net>
parents: 6869
diff changeset
     7
util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True)
7e5e13bee8f4 Make test-hardlinks-safety portable
Christian Ebert <blacktrash@gmx.net>
parents: 6869
diff changeset
     8
EOF
7e5e13bee8f4 Make test-hardlinks-safety portable
Christian Ebert <blacktrash@gmx.net>
parents: 6869
diff changeset
     9
7e5e13bee8f4 Make test-hardlinks-safety portable
Christian Ebert <blacktrash@gmx.net>
parents: 6869
diff changeset
    10
# test hardlinking outside hg
7e5e13bee8f4 Make test-hardlinks-safety portable
Christian Ebert <blacktrash@gmx.net>
parents: 6869
diff changeset
    11
mkdir x
7e5e13bee8f4 Make test-hardlinks-safety portable
Christian Ebert <blacktrash@gmx.net>
parents: 6869
diff changeset
    12
echo foo > x/a
7e5e13bee8f4 Make test-hardlinks-safety portable
Christian Ebert <blacktrash@gmx.net>
parents: 6869
diff changeset
    13
7e5e13bee8f4 Make test-hardlinks-safety portable
Christian Ebert <blacktrash@gmx.net>
parents: 6869
diff changeset
    14
python cp.py x y
7e5e13bee8f4 Make test-hardlinks-safety portable
Christian Ebert <blacktrash@gmx.net>
parents: 6869
diff changeset
    15
echo bar >> y/a
7e5e13bee8f4 Make test-hardlinks-safety portable
Christian Ebert <blacktrash@gmx.net>
parents: 6869
diff changeset
    16
echo % no diff if hardlink
7e5e13bee8f4 Make test-hardlinks-safety portable
Christian Ebert <blacktrash@gmx.net>
parents: 6869
diff changeset
    17
diff x/a y/a
7e5e13bee8f4 Make test-hardlinks-safety portable
Christian Ebert <blacktrash@gmx.net>
parents: 6869
diff changeset
    18
6835
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    19
# test mq hardlinking
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    20
echo "[extensions]" >> $HGRCPATH
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    21
echo "mq=" >> $HGRCPATH
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    22
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    23
echo % init
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    24
hg init a
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    25
cd a
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    26
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    27
hg qimport -n foo - << EOF
6869
b49e01863202 Make test-hardlinks-safety repeatable and executable
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6835
diff changeset
    28
# HG changeset patch
b49e01863202 Make test-hardlinks-safety repeatable and executable
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6835
diff changeset
    29
# Date 1 0
6835
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    30
diff -r 2588a8b53d66 a
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    31
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    32
+++ b/a	Wed Jul 23 15:54:29 2008 +0200
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    33
@@ -0,0 +1,1 @@
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    34
+a
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    35
EOF
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    36
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    37
hg qpush
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    38
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    39
cd ..
6920
7e5e13bee8f4 Make test-hardlinks-safety portable
Christian Ebert <blacktrash@gmx.net>
parents: 6869
diff changeset
    40
python cp.py a b
6835
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    41
cd b
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    42
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    43
hg qimport -n bar - << EOF
6869
b49e01863202 Make test-hardlinks-safety repeatable and executable
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6835
diff changeset
    44
# HG changeset patch
b49e01863202 Make test-hardlinks-safety repeatable and executable
Thomas Arendsen Hein <thomas@intevation.de>
parents: 6835
diff changeset
    45
# Date 2 0
6835
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    46
diff -r 2588a8b53d66 a
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    47
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    48
+++ b/b	Wed Jul 23 15:54:29 2008 +0200
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    49
@@ -0,0 +1,1 @@
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    50
+b
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    51
EOF
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    52
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    53
hg qpush
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    54
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    55
cat .hg/patches/status
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    56
echo %
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    57
cat .hg/patches/series
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    58
echo %%%
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    59
cat ../a/.hg/patches/status
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    60
echo %
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    61
cat ../a/.hg/patches/series
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    62
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    63
# test tags hardlinking
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    64
hg qdel -r qbase:qtip
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    65
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    66
hg tag -l lfoo
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    67
hg tag foo
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    68
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    69
cd ..
6920
7e5e13bee8f4 Make test-hardlinks-safety portable
Christian Ebert <blacktrash@gmx.net>
parents: 6869
diff changeset
    70
python cp.py b c
6835
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    71
cd c
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    72
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    73
hg tag -l -r 0 lbar
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    74
hg tag -r 0 bar
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    75
echo %%%
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    76
cat .hgtags
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    77
echo %
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    78
cat .hg/localtags
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    79
echo %%%
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    80
cat ../b/.hgtags
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    81
echo %
08d9e0f974d9 make mq and tags hardlink safe
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
    82
cat ../b/.hg/localtags