tests/test-exchange-A3.t
branchmercurial-4.0
changeset 2278 2db189baf8b7
parent 2260 e200dbfb4515
parent 2277 61d885899466
child 2279 347849e17876
child 2318 523855eb28c1
equal deleted inserted replaced
2260:e200dbfb4515 2278:2db189baf8b7
     1 
       
     2 Initial setup
       
     3 
       
     4   $ . $TESTDIR/testlib/exchange-util.sh
       
     5 
       
     6 === A.3 new branch created ===
       
     7 
       
     8 .. {{{
       
     9 ..   B' ○⇢ø B
       
    10 ..      | |
       
    11 ..      \Aø⇠◔ A'
       
    12 ..       \|/
       
    13 ..        ● O
       
    14 .. }}}
       
    15 ..
       
    16 .. Marker exist from:
       
    17 ..
       
    18 ..  * `Aø⇠○ A'`
       
    19 ..  * `Bø⇠○ B'`
       
    20 ..
       
    21 .. Command run:
       
    22 ..
       
    23 ..  * hg push -r A
       
    24 ..
       
    25 .. Expected exchange:
       
    26 ..
       
    27 ..  * chain from A
       
    28 ..
       
    29 .. Expected Exclude:
       
    30 ..
       
    31 ..  * chain from B
       
    32 ..
       
    33 .. Extra note:
       
    34 ..
       
    35 .. If A and B are remontly known, we should expect:
       
    36 ..
       
    37 ..  * `hg push` will complain about the new head
       
    38 ..  * `hg push` should complain about unstable history creation
       
    39 
       
    40 initial
       
    41 
       
    42   $ setuprepos A.3.a
       
    43   creating test repo for test case A.3.a
       
    44   - pulldest
       
    45   - main
       
    46   - pushdest
       
    47   cd into `main` and proceed with env setup
       
    48   $ cd main
       
    49   $ mkcommit A0
       
    50   $ mkcommit B0
       
    51   $ hg update -q 0
       
    52   $ mkcommit A1
       
    53   created new head
       
    54   $ hg update -q 0
       
    55   $ mkcommit B1
       
    56   created new head
       
    57   $ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(A1)'`
       
    58   $ hg debugobsolete `getid 'desc(B0)'` `getid 'desc(B1)'`
       
    59   $ hg log -G --hidden
       
    60   @  f6298a8ac3a4 (draft): B1
       
    61   |
       
    62   | o  e5ea8f9c7314 (draft): A1
       
    63   |/
       
    64   | x  6e72f0a95b5e (draft): B0
       
    65   | |
       
    66   | x  28b51eb45704 (draft): A0
       
    67   |/
       
    68   o  a9bdc8b26820 (public): O
       
    69   
       
    70   $ hg debugobsolete
       
    71   28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
    72   6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
    73   $ hg debugobsrelsethashtree
       
    74   a9bdc8b26820b1b87d585b82eb0ceb4a2ecdbc04 0000000000000000000000000000000000000000
       
    75   28b51eb45704506b5c603decd6bf7ac5e0f6a52f 0000000000000000000000000000000000000000
       
    76   6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 0000000000000000000000000000000000000000
       
    77   e5ea8f9c73143125d36658e90ef70c6d2027a5b7 3bc2ee626e11a7cf8fee7a66d069271e17d5a597
       
    78   f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 91716bfd671b5a5854a47ac5d392edfdd25e431a
       
    79   $ hg debugobshashrange --subranges --rev 'head()'
       
    80            rev         node        index         size        depth      obshash
       
    81              3 e5ea8f9c7314            0            2            2 3bc2ee626e11
       
    82              4 f6298a8ac3a4            0            2            2 91716bfd671b
       
    83              0 a9bdc8b26820            0            1            1 000000000000
       
    84              3 e5ea8f9c7314            1            1            2 3bc2ee626e11
       
    85              4 f6298a8ac3a4            1            1            2 91716bfd671b
       
    86   $ cd ..
       
    87   $ cd ..
       
    88 
       
    89 Actual Test for first version (changeset unknown in remote)
       
    90 -----------------------------------------------------------
       
    91 
       
    92   $ dotest A.3.a A1
       
    93   ## Running testcase A.3.a
       
    94   # testing echange of "A1" (e5ea8f9c7314)
       
    95   ## initial state
       
    96   # obstore: main
       
    97   28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
    98   6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
    99   # obstore: pushdest
       
   100   # obstore: pulldest
       
   101   ## pushing "A1" from main to pushdest
       
   102   pushing to pushdest
       
   103   searching for changes
       
   104   remote: adding changesets
       
   105   remote: adding manifests
       
   106   remote: adding file changes
       
   107   remote: added 1 changesets with 1 changes to 1 files
       
   108   remote: 1 new obsolescence markers
       
   109   ## post push state
       
   110   # obstore: main
       
   111   28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   112   6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   113   # obstore: pushdest
       
   114   28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   115   # obstore: pulldest
       
   116   ## pulling "e5ea8f9c7314" from main into pulldest
       
   117   pulling from main
       
   118   searching for changes
       
   119   adding changesets
       
   120   adding manifests
       
   121   adding file changes
       
   122   added 1 changesets with 1 changes to 1 files
       
   123   1 new obsolescence markers
       
   124   (run 'hg update' to get a working copy)
       
   125   ## post pull state
       
   126   # obstore: main
       
   127   28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   128   6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   129   # obstore: pushdest
       
   130   28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   131   # obstore: pulldest
       
   132   28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   133 
       
   134 
       
   135 other variant: changeset known in remote
       
   136 ----------------------------------------
       
   137 
       
   138   $ setuprepos A.3.b
       
   139   creating test repo for test case A.3.b
       
   140   - pulldest
       
   141   - main
       
   142   - pushdest
       
   143   cd into `main` and proceed with env setup
       
   144   $ cd main
       
   145   $ mkcommit A0
       
   146   $ mkcommit B0
       
   147   $ hg push -q ../pushdest
       
   148   $ hg push -q ../pulldest
       
   149   $ hg update -q 0
       
   150   $ mkcommit A1
       
   151   created new head
       
   152   $ hg update -q 0
       
   153   $ mkcommit B1
       
   154   created new head
       
   155   $ hg debugobsolete `getid 'desc(A0)'` `getid 'desc(A1)'`
       
   156   $ hg debugobsolete `getid 'desc(B0)'` `getid 'desc(B1)'`
       
   157   $ hg log -G --hidden
       
   158   @  f6298a8ac3a4 (draft): B1
       
   159   |
       
   160   | o  e5ea8f9c7314 (draft): A1
       
   161   |/
       
   162   | x  6e72f0a95b5e (draft): B0
       
   163   | |
       
   164   | x  28b51eb45704 (draft): A0
       
   165   |/
       
   166   o  a9bdc8b26820 (public): O
       
   167   
       
   168   $ hg debugobsolete
       
   169   28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   170   6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   171   $ cd ..
       
   172   $ cd ..
       
   173 
       
   174 Actual Test for first version (changeset unknown in remote)
       
   175 -----------------------------------------------------------
       
   176 
       
   177 check it complains about multiple heads
       
   178 
       
   179   $ cd A.3.b
       
   180   $ hg push -R main -r e5ea8f9c7314 pushdest
       
   181   pushing to pushdest
       
   182   searching for changes
       
   183   abort: push creates new remote head e5ea8f9c7314!
       
   184   (merge or see 'hg help push' for details about pushing new heads)
       
   185   [255]
       
   186   $ cd ..
       
   187 
       
   188 test obsmarkers exchange.
       
   189 
       
   190   $ dotest A.3.b A1 -f
       
   191   ## Running testcase A.3.b
       
   192   # testing echange of "A1" (e5ea8f9c7314)
       
   193   ## initial state
       
   194   # obstore: main
       
   195   28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   196   6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   197   # obstore: pushdest
       
   198   # obstore: pulldest
       
   199   ## pushing "A1" from main to pushdest
       
   200   pushing to pushdest
       
   201   searching for changes
       
   202   remote: adding changesets
       
   203   remote: adding manifests
       
   204   remote: adding file changes
       
   205   remote: added 1 changesets with 1 changes to 1 files (+1 heads)
       
   206   remote: 1 new obsolescence markers
       
   207   ## post push state
       
   208   # obstore: main
       
   209   28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   210   6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   211   # obstore: pushdest
       
   212   28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   213   # obstore: pulldest
       
   214   ## pulling "e5ea8f9c7314" from main into pulldest
       
   215   pulling from main
       
   216   searching for changes
       
   217   adding changesets
       
   218   adding manifests
       
   219   adding file changes
       
   220   added 1 changesets with 1 changes to 1 files (+1 heads)
       
   221   1 new obsolescence markers
       
   222   (run 'hg heads' to see heads, 'hg merge' to merge)
       
   223   1 new unstable changesets
       
   224   ## post pull state
       
   225   # obstore: main
       
   226   28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   227   6e72f0a95b5e01a7504743aa941f69cb1fbef8b0 f6298a8ac3a4b78bbeae5f1d3dc5bc3c3812f0f3 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   228   # obstore: pushdest
       
   229   28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
       
   230   # obstore: pulldest
       
   231   28b51eb45704506b5c603decd6bf7ac5e0f6a52f e5ea8f9c73143125d36658e90ef70c6d2027a5b7 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}