tests/test-mq-qclone-http
changeset 12463 9f551ca3bb44
parent 12462 da2cfdc33fe8
child 12464 3177e3a7b14f
equal deleted inserted replaced
12462:da2cfdc33fe8 12463:9f551ca3bb44
     1 #! /bin/sh
       
     2 
       
     3 echo "[extensions]" >> $HGRCPATH
       
     4 echo "mq=" >> $HGRCPATH
       
     5 
       
     6 mkdir webdir
       
     7 cd webdir
       
     8 
       
     9 hg init a
       
    10 hg --cwd a qinit -c
       
    11 echo a > a/a
       
    12 hg --cwd a ci -A -m a
       
    13 echo b > a/b
       
    14 hg --cwd a addremove
       
    15 hg --cwd a qnew -f b.patch
       
    16 hg --cwd a qcommit -m b.patch
       
    17 
       
    18 hg --cwd a log --template "{desc}\n"
       
    19 hg --cwd a/.hg/patches log --template "{desc}\n"
       
    20 
       
    21 root=`pwd`
       
    22 
       
    23 cd ..
       
    24 
       
    25 echo % test with recursive collection
       
    26 
       
    27 cat > collections.conf <<EOF
       
    28 [paths]
       
    29 /=$root/**
       
    30 EOF
       
    31 
       
    32 hg serve -p $HGPORT -d --pid-file=hg.pid --webdir-conf collections.conf \
       
    33     -A access-paths.log -E error-paths-1.log
       
    34 cat hg.pid >> $DAEMON_PIDS
       
    35 
       
    36 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?style=raw'
       
    37 
       
    38 hg qclone http://localhost:$HGPORT/a b
       
    39 hg --cwd b log --template "{desc}\n"
       
    40 hg --cwd b qpush -a
       
    41 hg --cwd b log --template "{desc}\n"
       
    42 
       
    43 echo % test with normal collection
       
    44 
       
    45 cat > collections1.conf <<EOF
       
    46 [paths]
       
    47 /=$root/*
       
    48 EOF
       
    49 
       
    50 hg serve -p $HGPORT1 -d --pid-file=hg.pid --webdir-conf collections1.conf \
       
    51     -A access-paths.log -E error-paths-1.log
       
    52 cat hg.pid >> $DAEMON_PIDS
       
    53 
       
    54 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw'
       
    55 
       
    56 hg qclone http://localhost:$HGPORT1/a c
       
    57 hg --cwd c log --template "{desc}\n"
       
    58 hg --cwd c qpush -a
       
    59 hg --cwd c log --template "{desc}\n"
       
    60 
       
    61 echo % test with old-style collection
       
    62 
       
    63 cat > collections2.conf <<EOF
       
    64 [collections]
       
    65 $root=$root
       
    66 EOF
       
    67 
       
    68 hg serve -p $HGPORT2 -d --pid-file=hg.pid --webdir-conf collections2.conf \
       
    69     -A access-paths.log -E error-paths-1.log
       
    70 cat hg.pid >> $DAEMON_PIDS
       
    71 
       
    72 "$TESTDIR/get-with-headers.py" localhost:$HGPORT2 '/?style=raw'
       
    73 
       
    74 hg qclone http://localhost:$HGPORT2/a d
       
    75 hg --cwd d log --template "{desc}\n"
       
    76 hg --cwd d qpush -a
       
    77 hg --cwd d log --template "{desc}\n"
       
    78 
       
    79 echo '% test --mq works and uses correct repository config'
       
    80 hg --cwd d outgoing --mq | sed "s|$HGPORT2|\$HGPORT2|"
       
    81 hg --cwd d log --mq --template '{rev} {desc|firstline}\n'