tests/test-remotefilelog-clone.t
changeset 40545 3a333a582d7b
child 40560 fc2766860796
equal deleted inserted replaced
40544:9aeb9e2d28a7 40545:3a333a582d7b
       
     1   $ PYTHONPATH=$TESTDIR/..:$PYTHONPATH
       
     2   $ export PYTHONPATH
       
     3 
       
     4   $ . "$TESTDIR/remotefilelog-library.sh"
       
     5 
       
     6   $ hginit master
       
     7   $ cd master
       
     8   $ cat >> .hg/hgrc <<EOF
       
     9   > [remotefilelog]
       
    10   > server=True
       
    11   > EOF
       
    12   $ echo x > x
       
    13   $ hg commit -qAm x
       
    14 
       
    15   $ cd ..
       
    16 
       
    17 # shallow clone from full
       
    18 
       
    19   $ hgcloneshallow ssh://user@dummy/master shallow --noupdate
       
    20   streaming all changes
       
    21   2 files to transfer, 227 bytes of data
       
    22   transferred 227 bytes in * seconds (*/sec) (glob)
       
    23   searching for changes
       
    24   no changes found
       
    25   $ cd shallow
       
    26   $ cat .hg/requires
       
    27   dotencode
       
    28   fncache
       
    29   generaldelta
       
    30   remotefilelog
       
    31   revlogv1
       
    32   store
       
    33 
       
    34   $ hg update
       
    35   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    36   1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
       
    37 
       
    38   $ cat x
       
    39   x
       
    40 
       
    41   $ ls .hg/store/data
       
    42   $ echo foo > f
       
    43   $ hg add f
       
    44   $ hg ci -m 'local content'
       
    45   $ ls .hg/store/data
       
    46   4a0a19218e082a343a1b17e5333409af9d98f0f5
       
    47 
       
    48   $ cd ..
       
    49 
       
    50 # shallow clone from shallow
       
    51 
       
    52   $ hgcloneshallow ssh://user@dummy/shallow shallow2  --noupdate
       
    53   streaming all changes
       
    54   3 files to transfer, 564 bytes of data
       
    55   transferred 564 bytes in * seconds (*/sec) (glob)
       
    56   searching for changes
       
    57   no changes found
       
    58   $ cd shallow2
       
    59   $ cat .hg/requires
       
    60   dotencode
       
    61   fncache
       
    62   generaldelta
       
    63   remotefilelog
       
    64   revlogv1
       
    65   store
       
    66   $ ls .hg/store/data
       
    67   4a0a19218e082a343a1b17e5333409af9d98f0f5
       
    68 
       
    69   $ hg update
       
    70   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    71 
       
    72   $ cat x
       
    73   x
       
    74 
       
    75   $ cd ..
       
    76 
       
    77 # full clone from shallow
       
    78 
       
    79 Note: the output to STDERR comes from a different process to the output on
       
    80 STDOUT and their relative ordering is not deterministic. As a result, the test
       
    81 was failing sporadically. To avoid this, we capture STDERR to a file and
       
    82 check its contents separately.
       
    83 
       
    84   $ TEMP_STDERR=full-clone-from-shallow.stderr.tmp
       
    85   $ hg clone --noupdate ssh://user@dummy/shallow full 2>$TEMP_STDERR
       
    86   streaming all changes
       
    87   remote: abort: Cannot clone from a shallow repo to a full repo.
       
    88   [255]
       
    89   $ cat $TEMP_STDERR
       
    90   abort: pull failed on remote
       
    91   $ rm $TEMP_STDERR
       
    92 
       
    93 # getbundle full clone
       
    94 
       
    95   $ printf '[server]\npreferuncompressed=False\n' >> master/.hg/hgrc
       
    96   $ hgcloneshallow ssh://user@dummy/master shallow3
       
    97   requesting all changes
       
    98   adding changesets
       
    99   adding manifests
       
   100   adding file changes
       
   101   added 1 changesets with 0 changes to 0 files
       
   102   new changesets b292c1e3311f
       
   103   updating to branch default
       
   104   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   105 
       
   106   $ ls shallow3/.hg/store/data
       
   107   $ cat shallow3/.hg/requires
       
   108   dotencode
       
   109   fncache
       
   110   generaldelta
       
   111   remotefilelog
       
   112   revlogv1
       
   113   store