tests/test-evolve-phase-divergence.t
changeset 3621 db3ec5f79ab9
parent 3620 1f020455f6fe
child 3623 71fbb679e311
equal deleted inserted replaced
3620:1f020455f6fe 3621:db3ec5f79ab9
     2 ====================================================================
     2 ====================================================================
     3 
     3 
     4   $ cat >> $HGRCPATH <<EOF
     4   $ cat >> $HGRCPATH <<EOF
     5   > [alias]
     5   > [alias]
     6   > glog = log -GT "{rev}:{node|short} {desc}\n ({bookmarks}) {phase}"
     6   > glog = log -GT "{rev}:{node|short} {desc}\n ({bookmarks}) {phase}"
       
     7   > [extensions]
       
     8   > rebase =
     7   > EOF
     9   > EOF
     8 
    10 
     9 Setting up a public repo
    11 Setting up a public repo
    10 ------------------------
    12 ------------------------
    11 
    13 
   494   |   () public
   496   |   () public
   495   o  1:4d1169d82e47 modify a
   497   o  1:4d1169d82e47 modify a
   496   |   () public
   498   |   () public
   497   o  0:d3873e73d99e init
   499   o  0:d3873e73d99e init
   498       () public
   500       () public
       
   501 
       
   502 Syncing all the repositories
       
   503 ----------------------------
       
   504 
       
   505   $ hg push ../private
       
   506   pushing to ../private
       
   507   searching for changes
       
   508   adding changesets
       
   509   adding manifests
       
   510   adding file changes
       
   511   added 1 changesets with 1 changes to 1 files
       
   512   2 new obsolescence markers
       
   513   $ hg push ../public
       
   514   pushing to ../public
       
   515   searching for changes
       
   516   adding changesets
       
   517   adding manifests
       
   518   adding file changes
       
   519   added 1 changesets with 1 changes to 1 files
       
   520   2 new obsolescence markers
       
   521 
       
   522 Creating phase-divergence with divergent changeset and precursor having
       
   523 different parents
       
   524 -----------------------------------------------------------------------
       
   525 
       
   526 Alice creates a changeset and pushes to private repo
       
   527 
       
   528   $ echo x > x
       
   529   $ hg ci -Am "added x to x"
       
   530   adding x
       
   531 
       
   532   $ hg push ../private
       
   533   pushing to ../private
       
   534   searching for changes
       
   535   adding changesets
       
   536   adding manifests
       
   537   adding file changes
       
   538   added 1 changesets with 1 changes to 1 files
       
   539 
       
   540 Bob does what he always does, pull from private and push to public, he is acting
       
   541 as a CI service
       
   542 
       
   543   $ cd ../bob
       
   544   $ hg pull ../private
       
   545   pulling from ../private
       
   546   searching for changes
       
   547   adding changesets
       
   548   adding manifests
       
   549   adding file changes
       
   550   added 2 changesets with 2 changes to 2 files
       
   551   2 new obsolescence markers
       
   552   new changesets 502e73736632:2352021b3785
       
   553   (run 'hg update' to get a working copy)
       
   554   $ hg push ../public
       
   555   pushing to ../public
       
   556   searching for changes
       
   557   adding changesets
       
   558   adding manifests
       
   559   adding file changes
       
   560   added 1 changesets with 1 changes to 1 files
       
   561 
       
   562 Alice like always dont care about Bob existence and rebases her changeset and
       
   563 then pull from public repo creating phase divergence
       
   564 
       
   565   $ cd ../alice
       
   566   $ hg rebase -r . -d .^^^
       
   567   rebasing 9:2352021b3785 "added x to x" (bm tip)
       
   568 
       
   569   $ hg pull ../public
       
   570   pulling from ../public
       
   571   searching for changes
       
   572   no changes found
       
   573   1 new phase-divergent changesets
       
   574 
       
   575   $ hg obslog -r .
       
   576   @  334e300d6db5 (10) added x to x
       
   577   |
       
   578   o  2352021b3785 (9) added x to x
       
   579        rewritten(parent) as 334e300d6db5 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
       
   580   
       
   581   $ hg glog -r .^::
       
   582   @  10:334e300d6db5 added x to x
       
   583   |   (bm) draft
       
   584   | o  9:2352021b3785 added x to x
       
   585   | |   () public
       
   586   | o  8:502e73736632 phase-divergent update to b756eb10ea73:
       
   587   | |
       
   588   | |  foo to bar
       
   589   | |   () public
       
   590   | o  6:b756eb10ea73 added bar to bar
       
   591   |/    () public
       
   592   o  5:3d62500c673d phase-divergent update to aa071e5554e3:
       
   593   |
       
   594   ~  added bar to foo
       
   595       () public
       
   596 
       
   597 Using `hg evolve` to resolve phase-divergence
       
   598 ---------------------------------------------
       
   599 
       
   600   $ hg evolve --phase-divergent
       
   601   recreate:[10] added x to x
       
   602   atop:[9] added x to x
       
   603   rebasing to destination parent: 502e73736632
       
   604   (leaving bookmark bm)
       
   605   computing new diff
       
   606   committed as 5388376cb2f0
       
   607   working directory is now at 5388376cb2f0
       
   608 
       
   609 XXX: we should not have created a new commit here
       
   610   $ hg glog
       
   611   @  12:5388376cb2f0 phase-divergent update to 2352021b3785:
       
   612   |
       
   613   |  added x to x
       
   614   |   () draft
       
   615   | x  11:b1a0e143e32b added x to x
       
   616   | |   (bm) draft
       
   617   o |  9:2352021b3785 added x to x
       
   618   |/    () public
       
   619   o  8:502e73736632 phase-divergent update to b756eb10ea73:
       
   620   |
       
   621   |  foo to bar
       
   622   |   () public
       
   623   o  6:b756eb10ea73 added bar to bar
       
   624   |   () public
       
   625   o  5:3d62500c673d phase-divergent update to aa071e5554e3:
       
   626   |
       
   627   |  added bar to foo
       
   628   |   () public
       
   629   o  3:aa071e5554e3 added foo to foo
       
   630   |   () public
       
   631   o  1:4d1169d82e47 modify a
       
   632   |   () public
       
   633   o  0:d3873e73d99e init
       
   634       () public
       
   635 
       
   636   $ hg obslog -r .
       
   637   @  5388376cb2f0 (12) phase-divergent update to 2352021b3785:
       
   638   |
       
   639   x  b1a0e143e32b (11) added x to x
       
   640   |    rewritten(description, parent, content) as 5388376cb2f0 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
       
   641   |
       
   642   x  334e300d6db5 (10) added x to x
       
   643   |    rewritten(parent) as b1a0e143e32b using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
       
   644   |
       
   645   o  2352021b3785 (9) added x to x
       
   646        rewritten(parent) as 334e300d6db5 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
       
   647   
       
   648 XXX: The existence of this changeset is wrong, moreover its diff is wrong
       
   649   $ hg exp
       
   650   # HG changeset patch
       
   651   # User test
       
   652   # Date 0 0
       
   653   #      Thu Jan 01 00:00:00 1970 +0000
       
   654   # Node ID 5388376cb2f0f9bc4842361fb16fe66ce5cc2f6d
       
   655   # Parent  2352021b37851be226ebed109b0eb6eada918566
       
   656   phase-divergent update to 2352021b3785:
       
   657   
       
   658   added x to x
       
   659   
       
   660   diff -r 2352021b3785 -r 5388376cb2f0 bar
       
   661   --- a/bar	Thu Jan 01 00:00:00 1970 +0000
       
   662   +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
   663   @@ -1,1 +0,0 @@
       
   664   -foo