tests/test-clone-failure.t
branchstable
changeset 17225 a06e2681dd17
parent 17222 98823bd0d697
parent 17224 23b247234454
child 17226 436cc9d017c6
equal deleted inserted replaced
17222:98823bd0d697 17225:a06e2681dd17
     1   $ "$TESTDIR/hghave" unix-permissions || exit 80
       
     2 
       
     3 No local source
       
     4 
       
     5   $ hg clone a b
       
     6   abort: repository a not found!
       
     7   [255]
       
     8 
       
     9 No remote source
       
    10 
       
    11   $ hg clone http://127.0.0.1:3121/a b
       
    12   abort: error: Connection refused
       
    13   [255]
       
    14   $ rm -rf b # work around bug with http clone
       
    15 
       
    16 Inaccessible source
       
    17 
       
    18   $ mkdir a
       
    19   $ chmod 000 a
       
    20   $ hg clone a b
       
    21   abort: repository a not found!
       
    22   [255]
       
    23 
       
    24 Inaccessible destination
       
    25 
       
    26   $ hg init b
       
    27   $ cd b
       
    28   $ hg clone . ../a
       
    29   abort: Permission denied: ../a
       
    30   [255]
       
    31   $ cd ..
       
    32   $ chmod 700 a
       
    33   $ rm -r a b
       
    34 
       
    35 Source of wrong type
       
    36 
       
    37   $ if "$TESTDIR/hghave" -q fifo; then
       
    38   >     mkfifo a
       
    39   >     hg clone a b
       
    40   >     rm a
       
    41   > else
       
    42   >     echo "abort: repository a not found!"
       
    43   > fi
       
    44   abort: repository a not found!
       
    45 
       
    46 Default destination, same directory
       
    47 
       
    48   $ hg init q
       
    49   $ hg clone q
       
    50   destination directory: q
       
    51   abort: destination 'q' is not empty
       
    52   [255]
       
    53 
       
    54 destination directory not empty
       
    55 
       
    56   $ mkdir a 
       
    57   $ echo stuff > a/a
       
    58   $ hg clone q a
       
    59   abort: destination 'a' is not empty
       
    60   [255]
       
    61 
       
    62 leave existing directory in place after clone failure
       
    63 
       
    64   $ hg init c
       
    65   $ cd c
       
    66   $ echo c > c
       
    67   $ hg commit -A -m test
       
    68   adding c
       
    69   $ chmod -rx .hg/store/data
       
    70   $ cd ..
       
    71   $ mkdir d
       
    72   $ hg clone c d 2> err
       
    73   [255]
       
    74   $ test -d d
       
    75   $ test -d d/.hg
       
    76   [1]
       
    77 
       
    78 reenable perm to allow deletion
       
    79 
       
    80   $ chmod +rx c/.hg/store/data