tests/test-discovery-obshashrange.t
changeset 2084 b1f029dcf573
child 2228 3b18440cca74
equal deleted inserted replaced
2083:778afb036245 2084:b1f029dcf573
       
     1 test for range based discovery
       
     2 ==============================
       
     3 
       
     4   $ . $TESTDIR/testlib/pythonpath.sh
       
     5 
       
     6   $ cat << EOF >> $HGRCPATH
       
     7   > [extensions]
       
     8   > hgext3rd.evolve =
       
     9   > [experimental]
       
    10   > obshashrange=1
       
    11   > verbose-obsolescence-exchange=1
       
    12   > [ui]
       
    13   > logtemplate = "{rev} {node|short} {desc} {tags}\n"
       
    14   > ssh=python "$RUNTESTDIR/dummyssh"
       
    15   > [alias]
       
    16   > debugobsolete=debugobsolete -d '0 0'
       
    17   > EOF
       
    18 
       
    19   $ getid() {
       
    20   >     hg log --hidden --template '{node}\n' --rev "$1"
       
    21   > }
       
    22 
       
    23   $ hg init server
       
    24   $ hg clone ssh://user@dummy/server client
       
    25   no changes found
       
    26   updating to branch default
       
    27   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    28   $ cd server
       
    29   $ hg debugbuilddag '.+7'
       
    30   $ hg log -G
       
    31   o  7 4de32a90b66c r7 tip
       
    32   |
       
    33   o  6 f69452c5b1af r6
       
    34   |
       
    35   o  5 c8d03c1b5e94 r5
       
    36   |
       
    37   o  4 bebd167eb94d r4
       
    38   |
       
    39   o  3 2dc09a01254d r3
       
    40   |
       
    41   o  2 01241442b3c2 r2
       
    42   |
       
    43   o  1 66f7d451a68b r1
       
    44   |
       
    45   o  0 1ea73414a91b r0
       
    46   
       
    47 
       
    48   $ hg debugobsolete aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa `getid 'desc(r1)'`
       
    49   $ hg debugobsolete bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb `getid 'desc(r2)'`
       
    50   $ hg debugobsolete cccccccccccccccccccccccccccccccccccccccc `getid 'desc(r4)'`
       
    51   $ hg debugobsolete dddddddddddddddddddddddddddddddddddddddd `getid 'desc(r5)'`
       
    52   $ hg debugobsolete eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee `getid 'desc(r7)'`
       
    53   $ hg debugobsolete
       
    54   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 66f7d451a68b85ed82ff5fcc254daf50c74144bd 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
    55   bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 01241442b3c2bf3211e593b549c655ea65b295e3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
    56   cccccccccccccccccccccccccccccccccccccccc bebd167eb94d257ace0e814aeb98e6972ed2970d 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
    57   dddddddddddddddddddddddddddddddddddddddd c8d03c1b5e94af74b772900c58259d2e08917735 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
    58   eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee 4de32a90b66cd083ebf3c00b41277aa7abca51dd 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
    59 
       
    60   $ hg debugstablerange --rev tip
       
    61   rev         node index size depth      obshash
       
    62     7 4de32a90b66c     0    8     8 38d1e7ad86ea
       
    63     3 2dc09a01254d     0    4     4 000000000000
       
    64     7 4de32a90b66c     4    4     8 38d1e7ad86ea
       
    65     3 2dc09a01254d     2    2     4 000000000000
       
    66     7 4de32a90b66c     6    2     8 033544c939f0
       
    67     1 66f7d451a68b     0    2     2 17ff8dd63509
       
    68     5 c8d03c1b5e94     4    2     6 57f6cf3757a2
       
    69     2 01241442b3c2     2    1     3 1ed3c61fb39a
       
    70     0 1ea73414a91b     0    1     1 000000000000
       
    71     3 2dc09a01254d     3    1     4 000000000000
       
    72     7 4de32a90b66c     7    1     8 033544c939f0
       
    73     1 66f7d451a68b     1    1     2 17ff8dd63509
       
    74     4 bebd167eb94d     4    1     5 bbe4d7fe27a8
       
    75     5 c8d03c1b5e94     5    1     6 446c2dc3bce5
       
    76     6 f69452c5b1af     6    1     7 000000000000
       
    77   $ cd .. 
       
    78 
       
    79 testing simple pull
       
    80 ===================
       
    81 
       
    82   $ cd client
       
    83   $ hg pull --rev 4
       
    84   pulling from ssh://user@dummy/server
       
    85   adding changesets
       
    86   adding manifests
       
    87   adding file changes
       
    88   added 5 changesets with 0 changes to 0 files
       
    89   3 new obsolescence markers
       
    90   (run 'hg update' to get a working copy)
       
    91   $ hg -R ../server/ debugobsolete --rev ::4 | sort
       
    92   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 66f7d451a68b85ed82ff5fcc254daf50c74144bd 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
    93   bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 01241442b3c2bf3211e593b549c655ea65b295e3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
    94   cccccccccccccccccccccccccccccccccccccccc bebd167eb94d257ace0e814aeb98e6972ed2970d 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
    95   $ hg debugobsolete | sort
       
    96   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 66f7d451a68b85ed82ff5fcc254daf50c74144bd 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
    97   bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 01241442b3c2bf3211e593b549c655ea65b295e3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
    98   cccccccccccccccccccccccccccccccccccccccc bebd167eb94d257ace0e814aeb98e6972ed2970d 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
    99 
       
   100 testing simple push
       
   101 ===================
       
   102 
       
   103   $ hg up
       
   104   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   105   $ echo foo > foo
       
   106   $ hg add foo
       
   107   $ hg commit -m foo
       
   108   $ hg debugobsolete ffffffffffffffffffffffffffffffffffffffff `getid '.'`
       
   109   $ hg push -f
       
   110   pushing to ssh://user@dummy/server
       
   111   searching for changes
       
   112   OBSEXC: computing relevant nodes
       
   113   OBSEXC: looking for common markers in 6 nodes
       
   114   OBSEXC: computing markers relevant to 1 nodes
       
   115   remote: adding changesets
       
   116   remote: adding manifests
       
   117   remote: adding file changes
       
   118   remote: added 1 changesets with 1 changes to 1 files (+1 heads)
       
   119   remote: 1 new obsolescence markers
       
   120 
       
   121 testing push with extra local markers
       
   122 =====================================
       
   123 
       
   124   $ hg log -G
       
   125   @  5 45f8b879de92 foo tip
       
   126   |
       
   127   o  4 bebd167eb94d r4
       
   128   |
       
   129   o  3 2dc09a01254d r3
       
   130   |
       
   131   o  2 01241442b3c2 r2
       
   132   |
       
   133   o  1 66f7d451a68b r1
       
   134   |
       
   135   o  0 1ea73414a91b r0
       
   136   
       
   137   $ hg debugobsolete 111111111111111aaaaaaaaa1111111111111111 `getid 'desc(r1)'`
       
   138   $ hg debugobsolete 22222222222222222bbbbbbbbbbbbb2222222222 `getid 'desc(r3)'`
       
   139   $ hg push
       
   140   pushing to ssh://user@dummy/server
       
   141   searching for changes
       
   142   OBSEXC: computing relevant nodes
       
   143   OBSEXC: looking for common markers in 6 nodes
       
   144   OBSEXC: computing markers relevant to 2 nodes
       
   145   no changes found
       
   146   remote: 2 new obsolescence markers
       
   147   [1]
       
   148   $ hg -R ../server/ debugobsolete --rev ::tip | sort
       
   149   111111111111111aaaaaaaaa1111111111111111 66f7d451a68b85ed82ff5fcc254daf50c74144bd 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   150   22222222222222222bbbbbbbbbbbbb2222222222 2dc09a01254db841290af0538aa52f6f52c776e3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   151   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 66f7d451a68b85ed82ff5fcc254daf50c74144bd 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   152   bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 01241442b3c2bf3211e593b549c655ea65b295e3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   153   cccccccccccccccccccccccccccccccccccccccc bebd167eb94d257ace0e814aeb98e6972ed2970d 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   154   ffffffffffffffffffffffffffffffffffffffff 45f8b879de922f6a6e620ba04205730335b6fc7e 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   155   $ hg debugobsolete | sort
       
   156   111111111111111aaaaaaaaa1111111111111111 66f7d451a68b85ed82ff5fcc254daf50c74144bd 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   157   22222222222222222bbbbbbbbbbbbb2222222222 2dc09a01254db841290af0538aa52f6f52c776e3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   158   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 66f7d451a68b85ed82ff5fcc254daf50c74144bd 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   159   bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 01241442b3c2bf3211e593b549c655ea65b295e3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   160   cccccccccccccccccccccccccccccccccccccccc bebd167eb94d257ace0e814aeb98e6972ed2970d 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   161   ffffffffffffffffffffffffffffffffffffffff 45f8b879de922f6a6e620ba04205730335b6fc7e 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   162 
       
   163 testing pull with extra remote markers
       
   164 =====================================
       
   165 
       
   166   $ hg log -G
       
   167   @  5 45f8b879de92 foo tip
       
   168   |
       
   169   o  4 bebd167eb94d r4
       
   170   |
       
   171   o  3 2dc09a01254d r3
       
   172   |
       
   173   o  2 01241442b3c2 r2
       
   174   |
       
   175   o  1 66f7d451a68b r1
       
   176   |
       
   177   o  0 1ea73414a91b r0
       
   178   
       
   179   $ hg -R ../server debugobsolete aaaaaaa11111111aaaaaaaaa1111111111111111 `getid 'desc(r1)'`
       
   180   $ hg -R ../server debugobsolete bbbbbbb2222222222bbbbbbbbbbbbb2222222222 `getid 'desc(r4)'`
       
   181   $ hg pull -r 6
       
   182   pulling from ssh://user@dummy/server
       
   183   searching for changes
       
   184   OBSEXC: looking for common markers in 6 nodes
       
   185   OBSEXC: request obsmarkers for 2 common nodes
       
   186   adding changesets
       
   187   adding manifests
       
   188   adding file changes
       
   189   added 2 changesets with 0 changes to 0 files (+1 heads)
       
   190   3 new obsolescence markers
       
   191   (run 'hg heads' to see heads, 'hg merge' to merge)
       
   192 
       
   193   $ hg -R ../server/ debugobsolete --rev '::6' | sort
       
   194   111111111111111aaaaaaaaa1111111111111111 66f7d451a68b85ed82ff5fcc254daf50c74144bd 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   195   22222222222222222bbbbbbbbbbbbb2222222222 2dc09a01254db841290af0538aa52f6f52c776e3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   196   aaaaaaa11111111aaaaaaaaa1111111111111111 66f7d451a68b85ed82ff5fcc254daf50c74144bd 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   197   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 66f7d451a68b85ed82ff5fcc254daf50c74144bd 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   198   bbbbbbb2222222222bbbbbbbbbbbbb2222222222 bebd167eb94d257ace0e814aeb98e6972ed2970d 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   199   bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 01241442b3c2bf3211e593b549c655ea65b295e3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   200   cccccccccccccccccccccccccccccccccccccccc bebd167eb94d257ace0e814aeb98e6972ed2970d 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   201   dddddddddddddddddddddddddddddddddddddddd c8d03c1b5e94af74b772900c58259d2e08917735 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   202   $ hg debugobsolete --rev '::6' | sort
       
   203   111111111111111aaaaaaaaa1111111111111111 66f7d451a68b85ed82ff5fcc254daf50c74144bd 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   204   22222222222222222bbbbbbbbbbbbb2222222222 2dc09a01254db841290af0538aa52f6f52c776e3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   205   aaaaaaa11111111aaaaaaaaa1111111111111111 66f7d451a68b85ed82ff5fcc254daf50c74144bd 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   206   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 66f7d451a68b85ed82ff5fcc254daf50c74144bd 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   207   bbbbbbb2222222222bbbbbbbbbbbbb2222222222 bebd167eb94d257ace0e814aeb98e6972ed2970d 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   208   bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 01241442b3c2bf3211e593b549c655ea65b295e3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   209   cccccccccccccccccccccccccccccccccccccccc bebd167eb94d257ace0e814aeb98e6972ed2970d 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   210   dddddddddddddddddddddddddddddddddddddddd c8d03c1b5e94af74b772900c58259d2e08917735 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   211