tests/test-merge-symlinks
changeset 5408 36794dbe66a3
parent 5391 786c1206a029
child 7080 a6477aa893b8
equal deleted inserted replaced
5407:d7e7902bb190 5408:36794dbe66a3
     1 #!/bin/sh
     1 #!/bin/sh
     2 
       
     3 "$TESTDIR/hghave" symlink || exit 80
       
     4 
     2 
     5 cat > echo.py <<EOF
     3 cat > echo.py <<EOF
     6 #!/usr/bin/env python
     4 #!/usr/bin/env python
     7 import os
     5 import os
     8 for k in ('HG_MY_ISLINK', 'HG_OTHER_ISLINK', 'HG_BASE_ISLINK'):
     6 for k in ('HG_FILE', 'HG_MY_ISLINK', 'HG_OTHER_ISLINK', 'HG_BASE_ISLINK'):
     9     print k, os.environ[k]
     7     print k, os.environ[k]
    10 EOF
     8 EOF
    11 chmod +x echo.py
       
    12 
     9 
    13 # Create 2 heads containing the same file, once as
    10 # Create 2 heads containing the same file, once as
    14 # a file, once as a link.
    11 # a file, once as a link. Bundle was generated with:
    15 echo % create heads
    12 #
       
    13 # hg init t
       
    14 # cd t
       
    15 # echo a > a
       
    16 # hg ci -qAm t0 -d '0 0'
       
    17 # echo l > l
       
    18 # hg ci -qAm t1 -d '1 0'
       
    19 # hg up -C 0
       
    20 # ln -s a l
       
    21 # hg ci -qAm t2 -d '2 0'
       
    22 # echo l2 > l2
       
    23 # hg ci -qAm t3 -d '3 0'
       
    24 
    16 hg init t
    25 hg init t
    17 cd t
    26 cd t
    18 echo a > a
    27 hg -q pull "$TESTDIR/test-merge-symlinks.hg"
    19 hg ci -qAm t0
    28 hg up -C 3
    20 echo l > l
       
    21 hg ci -qAm t1
       
    22 hg up -C 0
       
    23 ln -s a l
       
    24 hg ci -qAm t2
       
    25 
    29 
    26 # Merge them and display *_ISLINK vars
    30 # Merge them and display *_ISLINK vars
    27 echo % merge heads
    31 echo % merge heads
    28 HGMERGE=../echo.py hg merge
    32 HGMERGE="python ../echo.py" hg merge
       
    33 
       
    34 # Test working directory symlink bit calculation wrt copies,
       
    35 # especially on non-supporting systems.
       
    36 echo % merge working directory
       
    37 hg up -C 2
       
    38 hg copy l l2
       
    39 HGMERGE="python ../echo.py" hg up 3