tests/test-pull-bundle.t
changeset 37498 aacfca6f9767
child 37516 20808ddb4990
equal deleted inserted replaced
37497:1541e1a8e87d 37498:aacfca6f9767
       
     1   $ hg init repo
       
     2   $ cd repo
       
     3   $ echo foo > foo
       
     4   $ hg ci -qAm 'add foo'
       
     5   $ echo >> foo
       
     6   $ hg ci -m 'change foo'
       
     7   $ hg up -qC 0
       
     8   $ echo bar > bar
       
     9   $ hg ci -qAm 'add bar'
       
    10 
       
    11   $ hg log
       
    12   changeset:   2:effea6de0384
       
    13   tag:         tip
       
    14   parent:      0:bbd179dfa0a7
       
    15   user:        test
       
    16   date:        Thu Jan 01 00:00:00 1970 +0000
       
    17   summary:     add bar
       
    18   
       
    19   changeset:   1:ed1b79f46b9a
       
    20   user:        test
       
    21   date:        Thu Jan 01 00:00:00 1970 +0000
       
    22   summary:     change foo
       
    23   
       
    24   changeset:   0:bbd179dfa0a7
       
    25   user:        test
       
    26   date:        Thu Jan 01 00:00:00 1970 +0000
       
    27   summary:     add foo
       
    28   
       
    29   $ cd ..
       
    30 
       
    31 Test pullbundle functionality
       
    32 
       
    33   $ cd repo
       
    34   $ cat <<EOF > .hg/hgrc
       
    35   > [server]
       
    36   > pullbundle = True
       
    37   > [extensions]
       
    38   > blackbox =
       
    39   > EOF
       
    40   $ hg bundle --base null -r 0 .hg/0.hg
       
    41   1 changesets found
       
    42   $ hg bundle --base 0 -r 1 .hg/1.hg
       
    43   1 changesets found
       
    44   $ hg bundle --base 1 -r 2 .hg/2.hg
       
    45   1 changesets found
       
    46   $ cat <<EOF > .hg/pullbundles.manifest
       
    47   > 2.hg heads=effea6de0384e684f44435651cb7bd70b8735bd4 bases=bbd179dfa0a71671c253b3ae0aa1513b60d199fa
       
    48   > 1.hg heads=ed1b79f46b9a29f5a6efa59cf12fcfca43bead5a bases=bbd179dfa0a71671c253b3ae0aa1513b60d199fa
       
    49   > 0.hg heads=bbd179dfa0a71671c253b3ae0aa1513b60d199fa
       
    50   > EOF
       
    51   $ hg --config blackbox.track=debug --debug serve -p $HGPORT2 -d --pid-file=../repo.pid
       
    52   listening at http://localhost:$HGPORT2/ (bound to $LOCALIP:$HGPORT2)
       
    53   $ cat ../repo.pid >> $DAEMON_PIDS
       
    54   $ cd ..
       
    55   $ hg clone -r 0 http://localhost:$HGPORT2/ repo.pullbundle
       
    56   adding changesets
       
    57   adding manifests
       
    58   adding file changes
       
    59   added 1 changesets with 1 changes to 1 files
       
    60   new changesets bbd179dfa0a7
       
    61   updating to branch default
       
    62   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    63   $ cd repo.pullbundle
       
    64   $ hg pull -r 1
       
    65   pulling from http://localhost:$HGPORT2/
       
    66   searching for changes
       
    67   adding changesets
       
    68   adding manifests
       
    69   adding file changes
       
    70   added 1 changesets with 1 changes to 1 files
       
    71   new changesets ed1b79f46b9a
       
    72   (run 'hg update' to get a working copy)
       
    73   $ hg pull -r 2
       
    74   pulling from http://localhost:$HGPORT2/
       
    75   searching for changes
       
    76   adding changesets
       
    77   adding manifests
       
    78   adding file changes
       
    79   added 1 changesets with 1 changes to 1 files (+1 heads)
       
    80   new changesets effea6de0384
       
    81   (run 'hg heads' to see heads, 'hg merge' to merge)
       
    82   $ cd ..
       
    83   $ killdaemons.py
       
    84   $ grep 'sending pullbundle ' repo/.hg/blackbox.log
       
    85   * sending pullbundle "0.hg" (glob)
       
    86   * sending pullbundle "1.hg" (glob)
       
    87   * sending pullbundle "2.hg" (glob)
       
    88   $ rm repo/.hg/blackbox.log
       
    89 
       
    90 Test pullbundle functionality for incremental pulls
       
    91 
       
    92   $ cd repo
       
    93   $ hg --config blackbox.track=debug --debug serve -p $HGPORT2 -d --pid-file=../repo.pid
       
    94   listening at http://localhost:$HGPORT2/ (bound to $LOCALIP:$HGPORT2)
       
    95   $ cat ../repo.pid >> $DAEMON_PIDS
       
    96   $ cd ..
       
    97   $ hg clone http://localhost:$HGPORT2/ repo.pullbundle2
       
    98   requesting all changes
       
    99   adding changesets
       
   100   adding manifests
       
   101   adding file changes
       
   102   added 1 changesets with 1 changes to 1 files
       
   103   adding changesets
       
   104   adding manifests
       
   105   adding file changes
       
   106   added 1 changesets with 1 changes to 1 files
       
   107   adding changesets
       
   108   adding manifests
       
   109   adding file changes
       
   110   added 1 changesets with 1 changes to 1 files (+1 heads)
       
   111   new changesets bbd179dfa0a7:ed1b79f46b9a
       
   112   updating to branch default
       
   113   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   114   $ killdaemons.py
       
   115   $ grep 'sending pullbundle ' repo/.hg/blackbox.log
       
   116   * sending pullbundle "0.hg" (glob)
       
   117   * sending pullbundle "2.hg" (glob)
       
   118   * sending pullbundle "1.hg" (glob)
       
   119   $ rm repo/.hg/blackbox.log
       
   120 
       
   121 Test recovery from misconfigured server sending no new data
       
   122 
       
   123   $ cd repo
       
   124   $ cat <<EOF > .hg/pullbundles.manifest
       
   125   > 0.hg heads=ed1b79f46b9a29f5a6efa59cf12fcfca43bead5a bases=bbd179dfa0a71671c253b3ae0aa1513b60d199fa
       
   126   > 0.hg heads=bbd179dfa0a71671c253b3ae0aa1513b60d199fa
       
   127   > EOF
       
   128   $ hg --config blackbox.track=debug --debug serve -p $HGPORT2 -d --pid-file=../repo.pid
       
   129   listening at http://localhost:$HGPORT2/ (bound to $LOCALIP:$HGPORT2)
       
   130   $ cat ../repo.pid >> $DAEMON_PIDS
       
   131   $ cd ..
       
   132   $ hg clone -r 0 http://localhost:$HGPORT2/ repo.pullbundle3
       
   133   adding changesets
       
   134   adding manifests
       
   135   adding file changes
       
   136   added 1 changesets with 1 changes to 1 files
       
   137   new changesets bbd179dfa0a7
       
   138   updating to branch default
       
   139   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   140   $ cd repo.pullbundle3
       
   141   $ hg pull -r 1
       
   142   pulling from http://localhost:$HGPORT2/
       
   143   searching for changes
       
   144   adding changesets
       
   145   adding manifests
       
   146   adding file changes
       
   147   added 0 changesets with 0 changes to 1 files
       
   148   abort: 00changelog.i@ed1b79f46b9a: no node!
       
   149   [255]
       
   150   $ cd ..
       
   151   $ killdaemons.py
       
   152   $ grep 'sending pullbundle ' repo/.hg/blackbox.log
       
   153   * sending pullbundle "0.hg" (glob)
       
   154   * sending pullbundle "0.hg" (glob)
       
   155   $ rm repo/.hg/blackbox.log