tests/test-evolve-phase-divergence.t
branchstable
changeset 4507 de9089514833
parent 4498 99dbe605fda5
child 4512 7a779a288793
child 4576 96ce1030d2fb
equal deleted inserted replaced
4486:099e0ca8285e 4507:de9089514833
    30   $ evolvepath=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/
    30   $ evolvepath=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/
    31 
    31 
    32 Setting up a private non-publishing repo
    32 Setting up a private non-publishing repo
    33 ----------------------------------------
    33 ----------------------------------------
    34 
    34 
    35   $ hg clone -U public private
    35   $ hg clone public private
       
    36   updating to branch default
       
    37   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
    36   $ cd private
    38   $ cd private
    37   $ cat >> .hg/hgrc <<EOF
    39   $ cat >> .hg/hgrc <<EOF
    38   > [ui]
    40   > [ui]
    39   > logtemplate = {rev}:{node|short}@{branch}({phase}) {desc|firstline}\n
    41   > logtemplate = {rev}:{node|short}@{branch}({phase}) {desc|firstline}\n
    40   > [phases]
    42   > [phases]
    45 Setting up couple of more instances of private repo
    47 Setting up couple of more instances of private repo
    46 ---------------------------------------------------
    48 ---------------------------------------------------
    47 
    49 
    48   $ cp -a private alice
    50   $ cp -a private alice
    49   $ cp -a private bob
    51   $ cp -a private bob
       
    52   $ cp -a private split
       
    53   $ cp -a private split-across-branches
       
    54   $ cp -a private split-and-amend
       
    55   $ cp -a private merge-no-conflict
       
    56 
       
    57 Simple phase-divergence case
       
    58 ============================
    50 
    59 
    51 Creating a phase-divergence changeset
    60 Creating a phase-divergence changeset
    52 -------------------------------------
    61 -------------------------------------
    53 
    62 
    54 Alice creating a draft changeset and pushing to main private repo
    63 Alice creating a draft changeset and pushing to main private repo
    55 
    64 
    56   $ cd alice
    65   $ cd alice
    57   $ hg update
       
    58   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    59   $ echo a >> a
    66   $ echo a >> a
    60   $ hg commit -u alice -m 'modify a'
    67   $ hg commit -u alice -m 'modify a'
    61   $ hg push ../private
    68   $ hg push ../private
    62   pushing to ../private
    69   pushing to ../private
    63   searching for changes
    70   searching for changes
    86   (run 'hg update' to get a working copy)
    93   (run 'hg update' to get a working copy)
    87 
    94 
    88   $ hg glog
    95   $ hg glog
    89   o  1:4d1169d82e47 modify a
    96   o  1:4d1169d82e47 modify a
    90   |   () draft
    97   |   () draft
    91   o  0:d3873e73d99e init
    98   @  0:d3873e73d99e init
    92       () public
    99       () public
    93 
   100 
    94   $ hg push ../public
   101   $ hg push ../public
    95   pushing to ../public
   102   pushing to ../public
    96   searching for changes
   103   searching for changes
   100   added 1 changesets with 1 changes to 1 files
   107   added 1 changesets with 1 changes to 1 files
   101 
   108 
   102   $ hg glog
   109   $ hg glog
   103   o  1:4d1169d82e47 modify a
   110   o  1:4d1169d82e47 modify a
   104   |   () public
   111   |   () public
   105   o  0:d3873e73d99e init
   112   @  0:d3873e73d99e init
   106       () public
   113       () public
   107 
   114 
   108 *But* Alice decided to amend the changeset she had and then pulling from public
   115 *But* Alice decided to amend the changeset she had and then pulling from public
   109 repo creating phase-divergent changeset locally
   116 repo creating phase-divergent changeset locally
   110 
   117 
   193 of public one. From the message it looks like a new commit is created.
   200 of public one. From the message it looks like a new commit is created.
   194 
   201 
   195   $ hg evolve --phase-divergent
   202   $ hg evolve --phase-divergent
   196   recreate:[2] tweak a
   203   recreate:[2] tweak a
   197   atop:[1] modify a
   204   atop:[1] modify a
   198   computing new diff
   205   no changes to commit
   199   committed as 4d1169d82e47
       
   200   working directory is now at 4d1169d82e47
   206   working directory is now at 4d1169d82e47
   201 
   207 
   202   $ hg glog
   208   $ hg glog
   203   @  1:4d1169d82e47 modify a
   209   @  1:4d1169d82e47 modify a
   204   |   () public
   210   |   () public
   225   searching for changes
   231   searching for changes
   226   no changes found
   232   no changes found
   227   2 new obsolescence markers
   233   2 new obsolescence markers
   228   [1]
   234   [1]
   229 
   235 
       
   236 phase-divergence that lead to new commit and bookmark movement
       
   237 ==============================================================
       
   238 
   230 Creating more phase-divergence where a new resolution commit will be formed and
   239 Creating more phase-divergence where a new resolution commit will be formed and
   231 also testing bookmark movement
   240 also testing bookmark movement
   232 --------------------------------------------------------------------------------
       
   233 
   241 
   234 Alice created a commit and push to private non-publishing repo
   242 Alice created a commit and push to private non-publishing repo
   235 
   243 
   236   $ echo foo > foo
   244   $ echo foo > foo
   237   $ hg add foo
   245   $ hg add foo
   308 test I have to go through code base to understand what will be the behavior
   316 test I have to go through code base to understand what will be the behavior
   309 
   317 
   310   $ hg evolve --phase-divergent
   318   $ hg evolve --phase-divergent
   311   recreate:[4] added bar to foo
   319   recreate:[4] added bar to foo
   312   atop:[3] added foo to foo
   320   atop:[3] added foo to foo
   313   computing new diff
       
   314   committed as 3d62500c673d
   321   committed as 3d62500c673d
   315   working directory is now at 3d62500c673d
   322   working directory is now at 3d62500c673d
   316 
   323 
   317   $ hg exp
   324   $ hg exp
   318   # HG changeset patch
   325   # HG changeset patch
   386   adding manifests
   393   adding manifests
   387   adding file changes
   394   adding file changes
   388   added 1 changesets with 1 changes to 1 files
   395   added 1 changesets with 1 changes to 1 files
   389   2 new obsolescence markers
   396   2 new obsolescence markers
   390 
   397 
       
   398 
       
   399 phase divergence rebasing back to old changeset - with (unrelated?) conflict
       
   400 ============================================================================
       
   401 
   391 Creating a phasedivergence changeset where the divergent changeset changed in a
   402 Creating a phasedivergence changeset where the divergent changeset changed in a
   392 way that we rebase that on old public changeset, there will be conflicts, but
   403 way that we rebase that on old public changeset, there will be conflicts, but
   393 the `hg evolve` command handles it very well and uses `hg revert` logic to
   404 the `hg evolve` command handles it very well and uses `hg revert` logic to
   394 prevent any conflicts
   405 prevent any conflicts
   395 -------------------------------------------------------------------------------
       
   396 
   406 
   397 Alice creates one more changeset and pushes to private repo
   407 Alice creates one more changeset and pushes to private repo
   398 
   408 
   399   $ echo bar > bar
   409   $ echo bar > bar
   400   $ hg ci -Aqm "added bar to bar"
   410   $ hg ci -Aqm "added bar to bar"
   459 ---------------------------------------------------------------
   469 ---------------------------------------------------------------
   460 
   470 
   461   $ hg evolve --phase-divergent
   471   $ hg evolve --phase-divergent
   462   recreate:[7] foo to bar
   472   recreate:[7] foo to bar
   463   atop:[6] added bar to bar
   473   atop:[6] added bar to bar
   464   computing new diff
       
   465   committed as 502e73736632
   474   committed as 502e73736632
   466   working directory is now at 502e73736632
   475   working directory is now at 502e73736632
   467 
   476 
   468   $ hg exp
   477   $ hg exp
   469   # HG changeset patch
   478   # HG changeset patch
   515   adding manifests
   524   adding manifests
   516   adding file changes
   525   adding file changes
   517   added 1 changesets with 1 changes to 1 files
   526   added 1 changesets with 1 changes to 1 files
   518   2 new obsolescence markers
   527   2 new obsolescence markers
   519 
   528 
       
   529 different parents for successors and predecessors
       
   530 =================================================
       
   531 
   520 Creating phase-divergence with divergent changeset and precursor having
   532 Creating phase-divergence with divergent changeset and precursor having
   521 different parents
   533 different parents
   522 -----------------------------------------------------------------------
       
   523 
   534 
   524 Alice creates a changeset and pushes to private repo
   535 Alice creates a changeset and pushes to private repo
   525 
   536 
   526   $ echo x > x
   537   $ echo x > x
   527   $ hg ci -Am "added x to x"
   538   $ hg ci -Am "added x to x"
   596   $ hg evolve --phase-divergent
   607   $ hg evolve --phase-divergent
   597   recreate:[10] added x to x
   608   recreate:[10] added x to x
   598   atop:[9] added x to x
   609   atop:[9] added x to x
   599   rebasing to destination parent: 502e73736632
   610   rebasing to destination parent: 502e73736632
   600   (leaving bookmark bm)
   611   (leaving bookmark bm)
   601   computing new diff
   612   no changes to commit
   602   committed as 2352021b3785
       
   603   working directory is now at 2352021b3785
   613   working directory is now at 2352021b3785
   604 
   614 
   605 XXX: we should move bookmark here
   615 XXX: we should move bookmark here
   606   $ hg glog
   616   $ hg glog
   607   @  9:2352021b3785 added x to x
   617   @  9:2352021b3785 added x to x
   643   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   653   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   644   +++ b/x	Thu Jan 01 00:00:00 1970 +0000
   654   +++ b/x	Thu Jan 01 00:00:00 1970 +0000
   645   @@ -0,0 +1,1 @@
   655   @@ -0,0 +1,1 @@
   646   +x
   656   +x
   647 
   657 
   648 Creating divergence with parent and content change both but not resulting in
   658 divergence with parent+content change both, no conflict
       
   659 =======================================================
       
   660 
       
   661 Creating divergence with parent cand content change both but not resulting in
   649 conflicts
   662 conflicts
   650 -----------------------------------------------------------------------------
       
   651 
   663 
   652 Alice is tired of pushing and pulling and will create phase-divergence locally
   664 Alice is tired of pushing and pulling and will create phase-divergence locally
   653 
   665 
   654   $ hg glog
   666   $ hg glog
   655   @  9:2352021b3785 added x to x
   667   @  9:2352021b3785 added x to x
   715 
   727 
   716   $ hg evolve --phase-divergent
   728   $ hg evolve --phase-divergent
   717   recreate:[14] y to y and foobar to foo
   729   recreate:[14] y to y and foobar to foo
   718   atop:[12] y to y and foobar to foo
   730   atop:[12] y to y and foobar to foo
   719   rebasing to destination parent: 2352021b3785
   731   rebasing to destination parent: 2352021b3785
   720   computing new diff
       
   721   committed as 8c2bb6fb44e9
   732   committed as 8c2bb6fb44e9
   722   working directory is now at 8c2bb6fb44e9
   733   working directory is now at 8c2bb6fb44e9
   723 
   734 
   724   $ hg exp
   735   $ hg exp
   725   # HG changeset patch
   736   # HG changeset patch
   757   o  1:4d1169d82e47 modify a
   768   o  1:4d1169d82e47 modify a
   758   |   () public
   769   |   () public
   759   o  0:d3873e73d99e init
   770   o  0:d3873e73d99e init
   760       () public
   771       () public
   761 
   772 
       
   773 divergence with parent+content change both, with conflict
       
   774 =========================================================
       
   775 
   762 Creating divergence with parent and content change both which results in
   776 Creating divergence with parent and content change both which results in
   763 conflicts while rebasing on parent
   777 conflicts while rebasing on parent
   764 -----------------------------------------------------------------------------
       
   765 
   778 
   766   $ echo l > l
   779   $ echo l > l
   767   $ hg ci -Aqm "added l to l"
   780   $ hg ci -Aqm "added l to l"
   768   $ hg rebase -r . -d .^^^^
   781   $ hg rebase -r . -d .^^^^
   769   rebasing 17:f3794e5a91dc "added l to l" (tip)
   782   rebasing 17:f3794e5a91dc "added l to l" (tip)
   819   (no more unresolved files)
   832   (no more unresolved files)
   820   continue: hg evolve --continue
   833   continue: hg evolve --continue
   821 
   834 
   822   $ hg evolve --continue
   835   $ hg evolve --continue
   823   evolving 19:5fd38c0de46e "added l to l"
   836   evolving 19:5fd38c0de46e "added l to l"
   824   computing new diff
       
   825   committed as e3090241a10c
   837   committed as e3090241a10c
   826   working directory is now at e3090241a10c
   838   working directory is now at e3090241a10c
   827 
   839 
   828   $ hg glog
   840   $ hg glog
   829   @  21:e3090241a10c phase-divergent update to f3794e5a91dc:
   841   @  21:e3090241a10c phase-divergent update to f3794e5a91dc:
   916 
   928 
   917   $ hg evolve --phase-divergent --all
   929   $ hg evolve --phase-divergent --all
   918   recreate:[24] added f
   930   recreate:[24] added f
   919   atop:[23] added g
   931   atop:[23] added g
   920   rebasing to destination parent: 21ae52e414e6
   932   rebasing to destination parent: 21ae52e414e6
   921   computing new diff
   933   no changes to commit
   922   committed as 428f7900a969
       
   923   working directory is now at 428f7900a969
   934   working directory is now at 428f7900a969
   924 
   935 
   925   $ hg glog -r f3794e5a91dc::
   936   $ hg glog -r f3794e5a91dc::
   926   @  23:428f7900a969 added g
   937   @  23:428f7900a969 added g
   927   |   () public
   938   |   () public
   931   |   () public
   942   |   () public
   932   o  17:f3794e5a91dc added l to l
   943   o  17:f3794e5a91dc added l to l
   933   |   () public
   944   |   () public
   934   ~
   945   ~
   935 
   946 
   936 When the public changesets is splitted causing phase-divergence
   947 When the public changesets is split causing phase-divergence
   937 ---------------------------------------------------------------
   948 ------------------------------------------------------------
       
   949 
       
   950   $ cd ../split
   938 
   951 
   939   $ echo m > m
   952   $ echo m > m
   940   $ echo n > n
   953   $ echo n > n
   941   $ hg ci -Aqm "added m and n"
   954   $ hg ci -Aqm "added m and n"
   942 
   955 
   943   $ hg glog -r 21ae52e414e6::
   956   $ hg glog
   944   @  26:849cee0a874b added m and n
   957   @  1:a51bce62c219 added m and n
   945   |   () draft
   958   |   () draft
   946   o  23:428f7900a969 added g
   959   o  0:d3873e73d99e init
   947   |   () public
   960       () public
   948   o  22:21ae52e414e6 added f
       
   949   |   () public
       
   950   ~
       
   951 
   961 
   952   $ hg prev
   962   $ hg prev
   953   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   963   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
   954   [23] added g
   964   [0] init
   955   $ echo m > m
   965   $ echo m > m
   956   $ hg ci -Aqm "added m"
   966   $ hg ci -Aqm "added m"
   957   $ echo n > n
   967   $ echo n > n
   958   $ hg ci -Aqm "added n"
   968   $ hg ci -Aqm "added n"
   959 
   969 
   960   $ hg glog -r 428f7900a969::
   970   $ hg glog
   961   @  28:63ccb8ea7cae added n
   971   @  3:e1154ec0206a added n
   962   |   () draft
   972   |   () draft
   963   o  27:f313e2b90e70 added m
   973   o  2:4f25cd9cd2bf added m
   964   |   () draft
   974   |   () draft
   965   | o  26:849cee0a874b added m and n
   975   | o  1:a51bce62c219 added m and n
   966   |/    () draft
   976   |/    () draft
   967   o  23:428f7900a969 added g
   977   o  0:d3873e73d99e init
   968   |   () public
   978       () public
   969   ~
   979 
   970 
   980   $ hg prune -r a51bce62c219 --succ 4f25cd9cd2bf --succ e1154ec0206a --split
   971   $ hg prune -r 849cee0a874b --succ f313e2b90e70 --succ 63ccb8ea7cae --split
       
   972   1 changesets pruned
   981   1 changesets pruned
   973 
   982 
   974   $ hg phase -r 849cee0a874b --hidden --public
   983   $ hg phase -r a51bce62c219 --hidden --public
   975   2 new phase-divergent changesets
   984   2 new phase-divergent changesets
   976 
   985 
   977   $ hg glog -r 428f7900a969::
   986   $ hg glog
   978   @  28:63ccb8ea7cae added n
   987   @  3:e1154ec0206a added n
   979   |   () draft
   988   |   () draft
   980   *  27:f313e2b90e70 added m
   989   *  2:4f25cd9cd2bf added m
   981   |   () draft
   990   |   () draft
   982   | o  26:849cee0a874b added m and n
   991   | o  1:a51bce62c219 added m and n
   983   |/    () public
   992   |/    () public
   984   o  23:428f7900a969 added g
   993   o  0:d3873e73d99e init
   985   |   () public
   994       () public
   986   ~
       
   987 
   995 
   988   $ hg evolve --all --phase-divergent
   996   $ hg evolve --all --phase-divergent
   989   recreate:[27] added m
   997   recreate:[2] added m
   990   atop:[26] added m and n
   998   atop:[1] added m and n
   991   computing new diff
   999   committed as 86419909e017
   992   committed as 870e1c3eddc3
       
   993   1 new orphan changesets
  1000   1 new orphan changesets
   994   recreate:[28] added n
  1001   recreate:[3] added n
   995   atop:[26] added m and n
  1002   atop:[1] added m and n
   996   rebasing to destination parent: 428f7900a969
  1003   rebasing to destination parent: d3873e73d99e
   997   computing new diff
  1004   committed as 89ba615ea1ec
   998   committed as 154b0179fb9b
  1005   working directory is now at 89ba615ea1ec
   999   working directory is now at 154b0179fb9b
       
  1000 
  1006 
  1001 XXX: this is messy, we should solve things in better way
  1007 XXX: this is messy, we should solve things in better way
  1002   $ hg glog -r 428f7900a969:: --hidden
  1008   $ hg glog --hidden
  1003   @  31:154b0179fb9b phase-divergent update to 849cee0a874b:
  1009   @  6:89ba615ea1ec phase-divergent update to a51bce62c219:
  1004   |   () draft
  1010   |   () draft
  1005   | x  30:1ebf33547a82 added n
  1011   | x  5:ee4af146c5cf added n
  1006   | |   () draft
  1012   | |   () draft
  1007   +---o  29:870e1c3eddc3 phase-divergent update to 849cee0a874b:
  1013   +---o  4:86419909e017 phase-divergent update to a51bce62c219:
  1008   | |     () draft
  1014   | |     () draft
  1009   | | x  28:63ccb8ea7cae added n
  1015   | | x  3:e1154ec0206a added n
  1010   | | |   () draft
  1016   | | |   () draft
  1011   | | x  27:f313e2b90e70 added m
  1017   | | x  2:4f25cd9cd2bf added m
  1012   | |/    () draft
  1018   | |/    () draft
  1013   o |  26:849cee0a874b added m and n
  1019   o |  1:a51bce62c219 added m and n
  1014   |/    () public
  1020   |/    () public
  1015   o  23:428f7900a969 added g
  1021   o  0:d3873e73d99e init
  1016   |   () public
  1022       () public
  1017   ~
  1023 
       
  1024   $ hg obslog -r a51bce62c219 --all
       
  1025   o  86419909e017 (4) phase-divergent update to a51bce62c219:
       
  1026   |
       
  1027   | @  89ba615ea1ec (6) phase-divergent update to a51bce62c219:
       
  1028   | |
       
  1029   x |  4f25cd9cd2bf (2) added m
       
  1030   | |    rewritten(description, parent, content) as 86419909e017 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
       
  1031   | |
       
  1032   | x  ee4af146c5cf (5) added n
       
  1033   | |    rewritten(description, parent, content) as 89ba615ea1ec using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
       
  1034   | |
       
  1035   | x  e1154ec0206a (3) added n
       
  1036   |/     rewritten(parent) as ee4af146c5cf using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
       
  1037   |
       
  1038   o  a51bce62c219 (1) added m and n
       
  1039        rewritten(description, parent, content) as 4f25cd9cd2bf, e1154ec0206a using prune by test (Thu Jan 01 00:00:00 1970 +0000)
       
  1040   
  1018 
  1041 
  1019 XXX: not sure this is the correct
  1042 XXX: not sure this is the correct
  1020   $ hg exp 154b0179fb9b
  1043   $ hg exp 89ba615ea1ec
  1021   # HG changeset patch
  1044   # HG changeset patch
  1022   # User test
  1045   # User test
  1023   # Date 0 0
  1046   # Date 0 0
  1024   #      Thu Jan 01 00:00:00 1970 +0000
  1047   #      Thu Jan 01 00:00:00 1970 +0000
  1025   # Node ID 154b0179fb9b53d2f853d6ba04740bb3d7a5cabe
  1048   # Node ID 89ba615ea1ec3ba5b25db9f7897eb29712d7e5d6
  1026   # Parent  849cee0a874be7c4e75dfacb5ad72aa5696951ba
  1049   # Parent  a51bce62c219f024bc0ae0cc0e3957ee77d7cb46
  1027   phase-divergent update to 849cee0a874b:
  1050   phase-divergent update to a51bce62c219:
  1028   
  1051   
  1029   added n
  1052   added n
  1030   
  1053   
  1031   diff -r 849cee0a874b -r 154b0179fb9b m
  1054   diff -r a51bce62c219 -r 89ba615ea1ec m
  1032   --- a/m	Thu Jan 01 00:00:00 1970 +0000
  1055   --- a/m	Thu Jan 01 00:00:00 1970 +0000
  1033   +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  1056   +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  1034   @@ -1,1 +0,0 @@
  1057   @@ -1,1 +0,0 @@
  1035   -m
  1058   -m
  1036 
  1059 
  1037 XXX: not sure this is correct
  1060 XXX: not sure this is correct
  1038   $ hg exp 870e1c3eddc3
  1061   $ hg exp 86419909e017
  1039   # HG changeset patch
  1062   # HG changeset patch
  1040   # User test
  1063   # User test
  1041   # Date 0 0
  1064   # Date 0 0
  1042   #      Thu Jan 01 00:00:00 1970 +0000
  1065   #      Thu Jan 01 00:00:00 1970 +0000
  1043   # Node ID 870e1c3eddc34cc475e8e13d2fe1934210c1937e
  1066   # Node ID 86419909e01787959aa6471aee605c6d604a3e0d
  1044   # Parent  849cee0a874be7c4e75dfacb5ad72aa5696951ba
  1067   # Parent  a51bce62c219f024bc0ae0cc0e3957ee77d7cb46
  1045   phase-divergent update to 849cee0a874b:
  1068   phase-divergent update to a51bce62c219:
  1046   
  1069   
  1047   added m
  1070   added m
  1048   
  1071   
  1049   diff -r 849cee0a874b -r 870e1c3eddc3 n
  1072   diff -r a51bce62c219 -r 86419909e017 n
  1050   --- a/n	Thu Jan 01 00:00:00 1970 +0000
  1073   --- a/n	Thu Jan 01 00:00:00 1970 +0000
  1051   +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  1074   +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  1052   @@ -1,1 +0,0 @@
  1075   @@ -1,1 +0,0 @@
  1053   -n
  1076   -n
  1054 
  1077 
  1055 When the public changeset is splitted across various branches
  1078 When the public changeset is split across various topological branches
  1056 --------------------------------------------------------------
  1079 ======================================================================
       
  1080 
       
  1081   $ cd ../split-across-branches
  1057 
  1082 
  1058   $ echo p > p
  1083   $ echo p > p
  1059   $ echo q > q
  1084   $ echo q > q
  1060   $ hg ci -Aqm "added p and q"
  1085   $ hg ci -Aqm "added p and q"
  1061 
  1086 
  1062   $ hg prev
  1087   $ hg prev
  1063   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
  1088   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
  1064   [31] phase-divergent update to 849cee0a874b:
  1089   [0] init
  1065   $ echo p > p
  1090   $ echo p > p
  1066   $ hg ci -Aqm "added p"
  1091   $ hg ci -Aqm "added p"
  1067   $ hg prev
  1092   $ hg prev
  1068   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  1093   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  1069   [31] phase-divergent update to 849cee0a874b:
  1094   [0] init
  1070   $ echo q > q
  1095   $ echo q > q
  1071   $ hg ci -Aqm "added q"
  1096   $ hg ci -Aqm "added q"
  1072 
  1097 
  1073   $ hg glog -r 154b0179fb9b::
  1098   $ hg glog
  1074   @  34:e046341aa97c added q
  1099   @  3:bb87595f9a77 added q
  1075   |   () draft
  1100   |   () draft
  1076   | o  33:6f8c250eecff added p
  1101   | o  2:a47263294745 added p
  1077   |/    () draft
  1102   |/    () draft
  1078   | o  32:8a70f55b2af3 added p and q
  1103   | o  1:90859808ece6 added p and q
  1079   |/    () draft
  1104   |/    () draft
  1080   o  31:154b0179fb9b phase-divergent update to 849cee0a874b:
  1105   o  0:d3873e73d99e init
  1081   |   () draft
  1106       () public
  1082   ~
  1107 
  1083 
  1108   $ hg prune -r 90859808ece6 --succ a47263294745 --succ bb87595f9a77 --split
  1084   $ hg prune -r 8a70f55b2af3 --succ 6f8c250eecff --succ e046341aa97c --split
       
  1085   1 changesets pruned
  1109   1 changesets pruned
  1086 
  1110 
  1087   $ hg phase -r 8a70f55b2af3 --public --hidden
  1111   $ hg phase -r 90859808ece6 --public --hidden
  1088   2 new phase-divergent changesets
  1112   2 new phase-divergent changesets
  1089 
  1113 
  1090   $ hg glog -r 154b0179fb9b::
  1114   $ hg glog
  1091   @  34:e046341aa97c added q
  1115   @  3:bb87595f9a77 added q
  1092   |   () draft
  1116   |   () draft
  1093   | *  33:6f8c250eecff added p
  1117   | *  2:a47263294745 added p
  1094   |/    () draft
  1118   |/    () draft
  1095   | o  32:8a70f55b2af3 added p and q
  1119   | o  1:90859808ece6 added p and q
  1096   |/    () public
  1120   |/    () public
  1097   o  31:154b0179fb9b phase-divergent update to 849cee0a874b:
  1121   o  0:d3873e73d99e init
  1098   |   () public
  1122       () public
  1099   ~
       
  1100 
  1123 
  1101   $ hg evolve --list
  1124   $ hg evolve --list
  1102   6f8c250eecff: added p
  1125   a47263294745: added p
  1103     phase-divergent: 8a70f55b2af3 (immutable precursor)
  1126     phase-divergent: 90859808ece6 (immutable precursor)
  1104   
  1127   
  1105   e046341aa97c: added q
  1128   bb87595f9a77: added q
  1106     phase-divergent: 8a70f55b2af3 (immutable precursor)
  1129     phase-divergent: 90859808ece6 (immutable precursor)
  1107   
  1130   
  1108   $ hg evolve --all --phase-divergent
  1131   $ hg evolve --all --phase-divergent
  1109   recreate:[33] added p
  1132   recreate:[2] added p
  1110   atop:[32] added p and q
  1133   atop:[1] added p and q
  1111   computing new diff
  1134   committed as 25875a9cb640
  1112   committed as f3e41d89b3c5
  1135   recreate:[3] added q
  1113   recreate:[34] added q
  1136   atop:[1] added p and q
  1114   atop:[32] added p and q
  1137   committed as 26f564f94bcc
  1115   computing new diff
  1138   working directory is now at 26f564f94bcc
  1116   committed as 605c306d4f87
  1139 
  1117   working directory is now at 605c306d4f87
  1140   $ hg glog --hidden
  1118 
  1141   @  5:26f564f94bcc phase-divergent update to 90859808ece6:
  1119   $ hg glog -r 154b0179fb9b:: --hidden
  1142   |   () draft
  1120   @  36:605c306d4f87 phase-divergent update to 8a70f55b2af3:
  1143   | o  4:25875a9cb640 phase-divergent update to 90859808ece6:
  1121   |   () draft
       
  1122   | o  35:f3e41d89b3c5 phase-divergent update to 8a70f55b2af3:
       
  1123   |/    () draft
  1144   |/    () draft
  1124   | x  34:e046341aa97c added q
  1145   | x  3:bb87595f9a77 added q
  1125   | |   () draft
  1146   | |   () draft
  1126   | | x  33:6f8c250eecff added p
  1147   | | x  2:a47263294745 added p
  1127   | |/    () draft
  1148   | |/    () draft
  1128   o |  32:8a70f55b2af3 added p and q
  1149   o |  1:90859808ece6 added p and q
  1129   |/    () public
  1150   |/    () public
  1130   o  31:154b0179fb9b phase-divergent update to 849cee0a874b:
  1151   o  0:d3873e73d99e init
  1131   |   () public
  1152       () public
  1132   ~
  1153 
       
  1154   $ hg obslog -r 90859808ece6 --all
       
  1155   o  25875a9cb640 (4) phase-divergent update to 90859808ece6:
       
  1156   |
       
  1157   | @  26f564f94bcc (5) phase-divergent update to 90859808ece6:
       
  1158   | |
       
  1159   x |  a47263294745 (2) added p
       
  1160   | |    rewritten(description, parent, content) as 25875a9cb640 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
       
  1161   | |
       
  1162   | x  bb87595f9a77 (3) added q
       
  1163   |/     rewritten(description, parent, content) as 26f564f94bcc using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
       
  1164   |
       
  1165   o  90859808ece6 (1) added p and q
       
  1166        rewritten(description, content) as a47263294745, bb87595f9a77 using prune by test (Thu Jan 01 00:00:00 1970 +0000)
       
  1167   
  1133 
  1168 
  1134 XXX: not sure this is correct
  1169 XXX: not sure this is correct
  1135   $ hg exp 605c306d4f87
  1170   $ hg exp 26f564f94bcc
  1136   # HG changeset patch
  1171   # HG changeset patch
  1137   # User test
  1172   # User test
  1138   # Date 0 0
  1173   # Date 0 0
  1139   #      Thu Jan 01 00:00:00 1970 +0000
  1174   #      Thu Jan 01 00:00:00 1970 +0000
  1140   # Node ID 605c306d4f87fccfdb5e7dd1c750b6d4f813defb
  1175   # Node ID 26f564f94bcc34e049eb112fd14ab1e5286f2325
  1141   # Parent  8a70f55b2af35452916dc89401a5ecf6553646a5
  1176   # Parent  90859808ece64c9ca64dd29992db42353c70f164
  1142   phase-divergent update to 8a70f55b2af3:
  1177   phase-divergent update to 90859808ece6:
  1143   
  1178   
  1144   added q
  1179   added q
  1145   
  1180   
  1146   diff -r 8a70f55b2af3 -r 605c306d4f87 p
  1181   diff -r 90859808ece6 -r 26f564f94bcc p
  1147   --- a/p	Thu Jan 01 00:00:00 1970 +0000
  1182   --- a/p	Thu Jan 01 00:00:00 1970 +0000
  1148   +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  1183   +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  1149   @@ -1,1 +0,0 @@
  1184   @@ -1,1 +0,0 @@
  1150   -p
  1185   -p
  1151 
  1186 
  1152 XXX: not sure this is correct
  1187 XXX: not sure this is correct
  1153   $ hg exp f3e41d89b3c5
  1188   $ hg exp 25875a9cb640
  1154   # HG changeset patch
  1189   # HG changeset patch
  1155   # User test
  1190   # User test
  1156   # Date 0 0
  1191   # Date 0 0
  1157   #      Thu Jan 01 00:00:00 1970 +0000
  1192   #      Thu Jan 01 00:00:00 1970 +0000
  1158   # Node ID f3e41d89b3c5f6ee49ccc734045856d7b025f048
  1193   # Node ID 25875a9cb6400973b846c94f6a80410067c2cb1f
  1159   # Parent  8a70f55b2af35452916dc89401a5ecf6553646a5
  1194   # Parent  90859808ece64c9ca64dd29992db42353c70f164
  1160   phase-divergent update to 8a70f55b2af3:
  1195   phase-divergent update to 90859808ece6:
  1161   
  1196   
  1162   added p
  1197   added p
  1163   
  1198   
  1164   diff -r 8a70f55b2af3 -r f3e41d89b3c5 q
  1199   diff -r 90859808ece6 -r 25875a9cb640 q
  1165   --- a/q	Thu Jan 01 00:00:00 1970 +0000
  1200   --- a/q	Thu Jan 01 00:00:00 1970 +0000
  1166   +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  1201   +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  1167   @@ -1,1 +0,0 @@
  1202   @@ -1,1 +0,0 @@
  1168   -q
  1203   -q
  1169 
  1204 
       
  1205 When the public changeset is split and amended
       
  1206 ==============================================
       
  1207 
       
  1208   $ cd ../split-and-amend
       
  1209 
       
  1210   $ echo m > m
       
  1211   $ echo n > n
       
  1212   $ hg ci -Aqm "added m and n"
       
  1213   $ hg prev
       
  1214   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
       
  1215   [0] init
       
  1216   $ echo m > m
       
  1217   $ hg ci -Aqm "added m"
       
  1218   $ echo n > n
       
  1219   $ hg ci -Aqm "added n"
       
  1220 
       
  1221   $ hg glog
       
  1222   @  3:e1154ec0206a added n
       
  1223   |   () draft
       
  1224   o  2:4f25cd9cd2bf added m
       
  1225   |   () draft
       
  1226   | o  1:a51bce62c219 added m and n
       
  1227   |/    () draft
       
  1228   o  0:d3873e73d99e init
       
  1229       () public
       
  1230 
       
  1231   $ hg prune -r a51bce62c219 --succ 4f25cd9cd2bf --succ e1154ec0206a --split
       
  1232   1 changesets pruned
       
  1233 
       
  1234   $ echo n2 > n
       
  1235   $ hg amend
       
  1236 
       
  1237   $ hg phase -r a51bce62c219 --public --hidden
       
  1238   2 new phase-divergent changesets
       
  1239 
       
  1240   $ hg glog
       
  1241   @  4:52ca78bb98c7 added n
       
  1242   |   () draft
       
  1243   *  2:4f25cd9cd2bf added m
       
  1244   |   () draft
       
  1245   | o  1:a51bce62c219 added m and n
       
  1246   |/    () public
       
  1247   o  0:d3873e73d99e init
       
  1248       () public
       
  1249 
       
  1250   $ hg evolve --list
       
  1251   4f25cd9cd2bf: added m
       
  1252     phase-divergent: a51bce62c219 (immutable precursor)
       
  1253   
       
  1254   52ca78bb98c7: added n
       
  1255     phase-divergent: a51bce62c219 (immutable precursor)
       
  1256   
       
  1257   $ hg evolve --all --phase-divergent
       
  1258   recreate:[2] added m
       
  1259   atop:[1] added m and n
       
  1260   committed as 86419909e017
       
  1261   1 new orphan changesets
       
  1262   recreate:[4] added n
       
  1263   atop:[1] added m and n
       
  1264   rebasing to destination parent: d3873e73d99e
       
  1265   committed as 88b0dae5369a
       
  1266   working directory is now at 88b0dae5369a
       
  1267 
       
  1268   $ hg glog --hidden
       
  1269   @  7:88b0dae5369a phase-divergent update to a51bce62c219:
       
  1270   |   () draft
       
  1271   | x  6:98dad8812511 added n
       
  1272   | |   () draft
       
  1273   +---o  5:86419909e017 phase-divergent update to a51bce62c219:
       
  1274   | |     () draft
       
  1275   | | x  4:52ca78bb98c7 added n
       
  1276   | | |   () draft
       
  1277   | | | x  3:e1154ec0206a added n
       
  1278   | | |/    () draft
       
  1279   | | x  2:4f25cd9cd2bf added m
       
  1280   | |/    () draft
       
  1281   o |  1:a51bce62c219 added m and n
       
  1282   |/    () public
       
  1283   o  0:d3873e73d99e init
       
  1284       () public
       
  1285 
       
  1286   $ hg obslog -r a51bce62c219 --all
       
  1287   o  86419909e017 (5) phase-divergent update to a51bce62c219:
       
  1288   |
       
  1289   | @  88b0dae5369a (7) phase-divergent update to a51bce62c219:
       
  1290   | |
       
  1291   x |  4f25cd9cd2bf (2) added m
       
  1292   | |    rewritten(description, parent, content) as 86419909e017 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
       
  1293   | |
       
  1294   | x  98dad8812511 (6) added n
       
  1295   | |    rewritten(description, parent, content) as 88b0dae5369a using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
       
  1296   | |
       
  1297   | x  52ca78bb98c7 (4) added n
       
  1298   | |    rewritten(parent) as 98dad8812511 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
       
  1299   | |
       
  1300   | x  e1154ec0206a (3) added n
       
  1301   |/     rewritten(content) as 52ca78bb98c7 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
       
  1302   |
       
  1303   o  a51bce62c219 (1) added m and n
       
  1304        rewritten(description, parent, content) as 4f25cd9cd2bf, e1154ec0206a using prune by test (Thu Jan 01 00:00:00 1970 +0000)
       
  1305   
       
  1306 
       
  1307 XXX: not sure this is correct
       
  1308   $ hg exp 86419909e017
       
  1309   # HG changeset patch
       
  1310   # User test
       
  1311   # Date 0 0
       
  1312   #      Thu Jan 01 00:00:00 1970 +0000
       
  1313   # Node ID 86419909e01787959aa6471aee605c6d604a3e0d
       
  1314   # Parent  a51bce62c219f024bc0ae0cc0e3957ee77d7cb46
       
  1315   phase-divergent update to a51bce62c219:
       
  1316   
       
  1317   added m
       
  1318   
       
  1319   diff -r a51bce62c219 -r 86419909e017 n
       
  1320   --- a/n	Thu Jan 01 00:00:00 1970 +0000
       
  1321   +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
  1322   @@ -1,1 +0,0 @@
       
  1323   -n
       
  1324 
       
  1325 XXX: not sure this is correct
       
  1326   $ hg exp 88b0dae5369a
       
  1327   # HG changeset patch
       
  1328   # User test
       
  1329   # Date 0 0
       
  1330   #      Thu Jan 01 00:00:00 1970 +0000
       
  1331   # Node ID 88b0dae5369aaa3bceb6c0b647542594e2c72fb7
       
  1332   # Parent  a51bce62c219f024bc0ae0cc0e3957ee77d7cb46
       
  1333   phase-divergent update to a51bce62c219:
       
  1334   
       
  1335   added n
       
  1336   
       
  1337   diff -r a51bce62c219 -r 88b0dae5369a m
       
  1338   --- a/m	Thu Jan 01 00:00:00 1970 +0000
       
  1339   +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
  1340   @@ -1,1 +0,0 @@
       
  1341   -m
       
  1342   diff -r a51bce62c219 -r 88b0dae5369a n
       
  1343   --- a/n	Thu Jan 01 00:00:00 1970 +0000
       
  1344   +++ b/n	Thu Jan 01 00:00:00 1970 +0000
       
  1345   @@ -1,1 +1,1 @@
       
  1346   -n
       
  1347   +n2
       
  1348 
  1170 Testing the evolution of a phase-divergent merge with no conflicts
  1349 Testing the evolution of a phase-divergent merge with no conflicts
  1171 ------------------------------------------------------------------
  1350 ==================================================================
  1172 
  1351 
  1173   $ hg glog -r 154b0179fb9b::
  1352   $ cd ../merge-no-conflict
  1174   @  36:605c306d4f87 phase-divergent update to 8a70f55b2af3:
       
  1175   |   () draft
       
  1176   | o  35:f3e41d89b3c5 phase-divergent update to 8a70f55b2af3:
       
  1177   |/    () draft
       
  1178   o  32:8a70f55b2af3 added p and q
       
  1179   |   () public
       
  1180   o  31:154b0179fb9b phase-divergent update to 849cee0a874b:
       
  1181   |   () public
       
  1182   ~
       
  1183 
  1353 
  1184   $ echo h > h
  1354   $ echo h > h
  1185   $ hg ci -Aqm "added h"
  1355   $ hg ci -Aqm "added h"
  1186   $ hg prev
  1356   $ hg prev
  1187   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  1357   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  1188   [36] phase-divergent update to 8a70f55b2af3:
  1358   [0] init
  1189   $ echo i > i
  1359   $ echo i > i
  1190   $ hg ci -Aqm "added i"
  1360   $ hg ci -Aqm "added i"
  1191   $ hg merge -r ef8c23f37b55
  1361   $ hg merge -r a53d182199c1
  1192   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  1362   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  1193   (branch merge, don't forget to commit)
  1363   (branch merge, don't forget to commit)
  1194   $ hg ci -m "merge h and i"
  1364   $ hg ci -m "merge h and i"
  1195 
  1365 
  1196   $ hg glog -r 605c306d4f87::
  1366   $ hg glog
  1197   @    39:12ebe0d625d7 merge h and i
  1367   @    3:205b2f5ecb7b merge h and i
  1198   |\    () draft
  1368   |\    () draft
  1199   | o  38:9bb561db4230 added i
  1369   | o  2:f0be5e638ecf added i
  1200   | |   () draft
  1370   | |   () draft
  1201   o |  37:ef8c23f37b55 added h
  1371   o |  1:a53d182199c1 added h
  1202   |/    () draft
  1372   |/    () draft
  1203   o  36:605c306d4f87 phase-divergent update to 8a70f55b2af3:
  1373   o  0:d3873e73d99e init
  1204   |   () draft
  1374       () public
  1205   ~
  1375 
  1206 
  1376   $ hg up a53d182199c1
  1207   $ hg up ef8c23f37b55
       
  1208   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  1377   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  1209   $ hg merge -r 9bb561db4230
  1378   $ hg merge -r f0be5e638ecf
  1210   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  1379   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  1211   (branch merge, don't forget to commit)
  1380   (branch merge, don't forget to commit)
  1212   $ hg ci -m "merge h and i successor"
  1381   $ hg ci -m "merge h and i successor"
  1213   created new head
  1382   created new head
  1214   $ hg glog -r 605c306d4f87::
  1383   $ hg glog
  1215   @    40:d2aeda868461 merge h and i successor
  1384   @    4:8d4acf488ab5 merge h and i successor
  1216   |\    () draft
  1385   |\    () draft
  1217   +---o  39:12ebe0d625d7 merge h and i
  1386   +---o  3:205b2f5ecb7b merge h and i
  1218   | |/    () draft
  1387   | |/    () draft
  1219   | o  38:9bb561db4230 added i
  1388   | o  2:f0be5e638ecf added i
  1220   | |   () draft
  1389   | |   () draft
  1221   o |  37:ef8c23f37b55 added h
  1390   o |  1:a53d182199c1 added h
  1222   |/    () draft
  1391   |/    () draft
  1223   o  36:605c306d4f87 phase-divergent update to 8a70f55b2af3:
  1392   o  0:d3873e73d99e init
  1224   |   () draft
  1393       () public
  1225   ~
  1394 
  1226 
  1395   $ hg prune -r 205b2f5ecb7b --succ .
  1227   $ hg prune -r 12ebe0d625d7 --succ .
       
  1228   1 changesets pruned
  1396   1 changesets pruned
  1229 
  1397 
  1230   $ hg phase 12ebe0d625d7 --hidden --public
  1398   $ hg phase 205b2f5ecb7b --hidden --public
  1231   1 new phase-divergent changesets
  1399   1 new phase-divergent changesets
  1232 
  1400 
  1233 Resolution of phase-divergent merge commit using `hg evolve`
  1401 Resolution of phase-divergent merge commit using `hg evolve`
  1234 
  1402 
  1235 XXX: we should handle phase-divergent merges
  1403 XXX: we should handle phase-divergent merges
  1236   $ hg evolve --phase-divergent
  1404   $ hg evolve --phase-divergent
  1237   skipping d2aeda868461 : we do not handle merge yet
  1405   skipping 8d4acf488ab5 : we do not handle merge yet
       
  1406 
       
  1407 Check we preserve "cancelation" of changes
       
  1408 ==========================================
       
  1409 
       
  1410 This tests case where the phase divergence changesets cancelled some of the
       
  1411 change made by the public predecessors. The cancellation of these changes need
       
  1412 to be preserved.
       
  1413 
       
  1414   $ hg init cancelled-changes
       
  1415   $ cd cancelled-changes
       
  1416   $ cat << EOF > numbers
       
  1417   > 1
       
  1418   > 2
       
  1419   > 3
       
  1420   > 4
       
  1421   > 5
       
  1422   > 6
       
  1423   > 7
       
  1424   > 8
       
  1425   > 9
       
  1426   > EOF
       
  1427   $ cat << EOF > letters
       
  1428   > a
       
  1429   > b
       
  1430   > c
       
  1431   > d
       
  1432   > e
       
  1433   > f
       
  1434   > g
       
  1435   > h
       
  1436   > i
       
  1437   > EOF
       
  1438   $ cat << EOF > romans
       
  1439   > I
       
  1440   > II
       
  1441   > III
       
  1442   > IV
       
  1443   > V
       
  1444   > VI
       
  1445   > VII
       
  1446   > VIII
       
  1447   > IX
       
  1448   > EOF
       
  1449   $ hg add numbers letters romans
       
  1450   $ hg commit -m root
       
  1451   $ cat << EOF > numbers
       
  1452   > 1
       
  1453   > 2
       
  1454   > 3
       
  1455   > four
       
  1456   > 5
       
  1457   > 6
       
  1458   > 7
       
  1459   > 8
       
  1460   > nine
       
  1461   > EOF
       
  1462   $ cat << EOF > letters
       
  1463   > a
       
  1464   > b
       
  1465   > c
       
  1466   > D
       
  1467   > e
       
  1468   > f
       
  1469   > g
       
  1470   > h
       
  1471   > i
       
  1472   > EOF
       
  1473   $ hg commit -m E1
       
  1474   $ cat << EOF > numbers
       
  1475   > 1
       
  1476   > 2
       
  1477   > 3
       
  1478   > 4
       
  1479   > 5
       
  1480   > 6
       
  1481   > seven
       
  1482   > 8
       
  1483   > nine
       
  1484   > EOF
       
  1485   $ cat << EOF > letters
       
  1486   > a
       
  1487   > b
       
  1488   > c
       
  1489   > d
       
  1490   > e
       
  1491   > f
       
  1492   > g
       
  1493   > h
       
  1494   > i
       
  1495   > EOF
       
  1496   $ cat << EOF > romans
       
  1497   > I
       
  1498   > ii
       
  1499   > III
       
  1500   > IV
       
  1501   > V
       
  1502   > VI
       
  1503   > VII
       
  1504   > VIII
       
  1505   > IX
       
  1506   > EOF
       
  1507   $ hg commit --amend -m E2
       
  1508   $ hg --hidden phase --public --rev 'desc(E1)'
       
  1509   1 new phase-divergent changesets
       
  1510   $ hg log -G --patch --hidden --rev 'not desc("root")'
       
  1511   @  changeset:   2:599454370881
       
  1512   |  tag:         tip
       
  1513   ~  parent:      0:6d1fdf6de7e2
       
  1514      user:        test
       
  1515      date:        Thu Jan 01 00:00:00 1970 +0000
       
  1516      instability: phase-divergent
       
  1517      summary:     E2
       
  1518   
       
  1519      diff -r 6d1fdf6de7e2 -r 599454370881 numbers
       
  1520      --- a/numbers	Thu Jan 01 00:00:00 1970 +0000
       
  1521      +++ b/numbers	Thu Jan 01 00:00:00 1970 +0000
       
  1522      @@ -4,6 +4,6 @@
       
  1523       4
       
  1524       5
       
  1525       6
       
  1526      -7
       
  1527      +seven
       
  1528       8
       
  1529      -9
       
  1530      +nine
       
  1531      diff -r 6d1fdf6de7e2 -r 599454370881 romans
       
  1532      --- a/romans	Thu Jan 01 00:00:00 1970 +0000
       
  1533      +++ b/romans	Thu Jan 01 00:00:00 1970 +0000
       
  1534      @@ -1,5 +1,5 @@
       
  1535       I
       
  1536      -II
       
  1537      +ii
       
  1538       III
       
  1539       IV
       
  1540       V
       
  1541   
       
  1542   o  changeset:   1:3074c7249d20
       
  1543   |  user:        test
       
  1544   ~  date:        Thu Jan 01 00:00:00 1970 +0000
       
  1545      summary:     E1
       
  1546   
       
  1547      diff -r 6d1fdf6de7e2 -r 3074c7249d20 letters
       
  1548      --- a/letters	Thu Jan 01 00:00:00 1970 +0000
       
  1549      +++ b/letters	Thu Jan 01 00:00:00 1970 +0000
       
  1550      @@ -1,7 +1,7 @@
       
  1551       a
       
  1552       b
       
  1553       c
       
  1554      -d
       
  1555      +D
       
  1556       e
       
  1557       f
       
  1558       g
       
  1559      diff -r 6d1fdf6de7e2 -r 3074c7249d20 numbers
       
  1560      --- a/numbers	Thu Jan 01 00:00:00 1970 +0000
       
  1561      +++ b/numbers	Thu Jan 01 00:00:00 1970 +0000
       
  1562      @@ -1,9 +1,9 @@
       
  1563       1
       
  1564       2
       
  1565       3
       
  1566      -4
       
  1567      +four
       
  1568       5
       
  1569       6
       
  1570       7
       
  1571       8
       
  1572      -9
       
  1573      +nine
       
  1574   
       
  1575   $ hg evolve --list
       
  1576   599454370881: E2
       
  1577     phase-divergent: 3074c7249d20 (immutable precursor)
       
  1578   
       
  1579   $ hg obslog --all --patch
       
  1580   @  599454370881 (2) E2
       
  1581   |
       
  1582   o  3074c7249d20 (1) E1
       
  1583        rewritten(description, content) as 599454370881 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
       
  1584          diff -r 3074c7249d20 -r 599454370881 changeset-description
       
  1585          --- a/changeset-description
       
  1586          +++ b/changeset-description
       
  1587          @@ -1,1 +1,1 @@
       
  1588          -E1
       
  1589          +E2
       
  1590   
       
  1591          diff -r 3074c7249d20 -r 599454370881 letters
       
  1592          --- a/letters	Thu Jan 01 00:00:00 1970 +0000
       
  1593          +++ b/letters	Thu Jan 01 00:00:00 1970 +0000
       
  1594          @@ -1,7 +1,7 @@
       
  1595           a
       
  1596           b
       
  1597           c
       
  1598          -D
       
  1599          +d
       
  1600           e
       
  1601           f
       
  1602           g
       
  1603          diff -r 3074c7249d20 -r 599454370881 numbers
       
  1604          --- a/numbers	Thu Jan 01 00:00:00 1970 +0000
       
  1605          +++ b/numbers	Thu Jan 01 00:00:00 1970 +0000
       
  1606          @@ -1,9 +1,9 @@
       
  1607           1
       
  1608           2
       
  1609           3
       
  1610          -four
       
  1611          +4
       
  1612           5
       
  1613           6
       
  1614          -7
       
  1615          +seven
       
  1616           8
       
  1617           nine
       
  1618          diff -r 3074c7249d20 -r 599454370881 romans
       
  1619          --- a/romans	Thu Jan 01 00:00:00 1970 +0000
       
  1620          +++ b/romans	Thu Jan 01 00:00:00 1970 +0000
       
  1621          @@ -1,5 +1,5 @@
       
  1622           I
       
  1623          -II
       
  1624          +ii
       
  1625           III
       
  1626           IV
       
  1627           V
       
  1628   
       
  1629   
       
  1630 
       
  1631   $ hg evolve --phase-divergent --rev 'desc("E2")'
       
  1632   recreate:[2] E2
       
  1633   atop:[1] E1
       
  1634   committed as 9eebcb77a7e2
       
  1635   working directory is now at 9eebcb77a7e2
       
  1636   $ hg export
       
  1637   # HG changeset patch
       
  1638   # User test
       
  1639   # Date 0 0
       
  1640   #      Thu Jan 01 00:00:00 1970 +0000
       
  1641   # Node ID 9eebcb77a7e2b240cb7dce095bbe608b5de91cc8
       
  1642   # Parent  3074c7249d2023b1fff891591d7e609695cd09c2
       
  1643   phase-divergent update to 3074c7249d20:
       
  1644   
       
  1645   E2
       
  1646   
       
  1647   diff -r 3074c7249d20 -r 9eebcb77a7e2 letters
       
  1648   --- a/letters	Thu Jan 01 00:00:00 1970 +0000
       
  1649   +++ b/letters	Thu Jan 01 00:00:00 1970 +0000
       
  1650   @@ -1,7 +1,7 @@
       
  1651    a
       
  1652    b
       
  1653    c
       
  1654   -D
       
  1655   +d
       
  1656    e
       
  1657    f
       
  1658    g
       
  1659   diff -r 3074c7249d20 -r 9eebcb77a7e2 numbers
       
  1660   --- a/numbers	Thu Jan 01 00:00:00 1970 +0000
       
  1661   +++ b/numbers	Thu Jan 01 00:00:00 1970 +0000
       
  1662   @@ -1,9 +1,9 @@
       
  1663    1
       
  1664    2
       
  1665    3
       
  1666   -four
       
  1667   +4
       
  1668    5
       
  1669    6
       
  1670   -7
       
  1671   +seven
       
  1672    8
       
  1673    nine
       
  1674   diff -r 3074c7249d20 -r 9eebcb77a7e2 romans
       
  1675   --- a/romans	Thu Jan 01 00:00:00 1970 +0000
       
  1676   +++ b/romans	Thu Jan 01 00:00:00 1970 +0000
       
  1677   @@ -1,5 +1,5 @@
       
  1678    I
       
  1679   -II
       
  1680   +ii
       
  1681    III
       
  1682    IV
       
  1683    V
       
  1684   $ hg log -G --patch --rev 'not desc("root")'
       
  1685   @  changeset:   3:9eebcb77a7e2
       
  1686   |  tag:         tip
       
  1687   |  parent:      1:3074c7249d20
       
  1688   |  user:        test
       
  1689   |  date:        Thu Jan 01 00:00:00 1970 +0000
       
  1690   |  summary:     phase-divergent update to 3074c7249d20:
       
  1691   |
       
  1692   |  diff -r 3074c7249d20 -r 9eebcb77a7e2 letters
       
  1693   |  --- a/letters	Thu Jan 01 00:00:00 1970 +0000
       
  1694   |  +++ b/letters	Thu Jan 01 00:00:00 1970 +0000
       
  1695   |  @@ -1,7 +1,7 @@
       
  1696   |   a
       
  1697   |   b
       
  1698   |   c
       
  1699   |  -D
       
  1700   |  +d
       
  1701   |   e
       
  1702   |   f
       
  1703   |   g
       
  1704   |  diff -r 3074c7249d20 -r 9eebcb77a7e2 numbers
       
  1705   |  --- a/numbers	Thu Jan 01 00:00:00 1970 +0000
       
  1706   |  +++ b/numbers	Thu Jan 01 00:00:00 1970 +0000
       
  1707   |  @@ -1,9 +1,9 @@
       
  1708   |   1
       
  1709   |   2
       
  1710   |   3
       
  1711   |  -four
       
  1712   |  +4
       
  1713   |   5
       
  1714   |   6
       
  1715   |  -7
       
  1716   |  +seven
       
  1717   |   8
       
  1718   |   nine
       
  1719   |  diff -r 3074c7249d20 -r 9eebcb77a7e2 romans
       
  1720   |  --- a/romans	Thu Jan 01 00:00:00 1970 +0000
       
  1721   |  +++ b/romans	Thu Jan 01 00:00:00 1970 +0000
       
  1722   |  @@ -1,5 +1,5 @@
       
  1723   |   I
       
  1724   |  -II
       
  1725   |  +ii
       
  1726   |   III
       
  1727   |   IV
       
  1728   |   V
       
  1729   |
       
  1730   o  changeset:   1:3074c7249d20
       
  1731   |  user:        test
       
  1732   ~  date:        Thu Jan 01 00:00:00 1970 +0000
       
  1733      summary:     E1
       
  1734   
       
  1735      diff -r 6d1fdf6de7e2 -r 3074c7249d20 letters
       
  1736      --- a/letters	Thu Jan 01 00:00:00 1970 +0000
       
  1737      +++ b/letters	Thu Jan 01 00:00:00 1970 +0000
       
  1738      @@ -1,7 +1,7 @@
       
  1739       a
       
  1740       b
       
  1741       c
       
  1742      -d
       
  1743      +D
       
  1744       e
       
  1745       f
       
  1746       g
       
  1747      diff -r 6d1fdf6de7e2 -r 3074c7249d20 numbers
       
  1748      --- a/numbers	Thu Jan 01 00:00:00 1970 +0000
       
  1749      +++ b/numbers	Thu Jan 01 00:00:00 1970 +0000
       
  1750      @@ -1,9 +1,9 @@
       
  1751       1
       
  1752       2
       
  1753       3
       
  1754      -4
       
  1755      +four
       
  1756       5
       
  1757       6
       
  1758       7
       
  1759       8
       
  1760      -9
       
  1761      +nine
       
  1762   
       
  1763   $ hg obslog --patch
       
  1764   @  9eebcb77a7e2 (3) phase-divergent update to 3074c7249d20:
       
  1765   |
       
  1766   x  599454370881 (2) E2
       
  1767   |    rewritten(description, parent, content) as 9eebcb77a7e2 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
       
  1768   |      (No patch available, changesets rebased)
       
  1769   |
       
  1770   o  3074c7249d20 (1) E1
       
  1771        rewritten(description, content) as 599454370881 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
       
  1772          diff -r 3074c7249d20 -r 599454370881 changeset-description
       
  1773          --- a/changeset-description
       
  1774          +++ b/changeset-description
       
  1775          @@ -1,1 +1,1 @@
       
  1776          -E1
       
  1777          +E2
       
  1778   
       
  1779          diff -r 3074c7249d20 -r 599454370881 letters
       
  1780          --- a/letters	Thu Jan 01 00:00:00 1970 +0000
       
  1781          +++ b/letters	Thu Jan 01 00:00:00 1970 +0000
       
  1782          @@ -1,7 +1,7 @@
       
  1783           a
       
  1784           b
       
  1785           c
       
  1786          -D
       
  1787          +d
       
  1788           e
       
  1789           f
       
  1790           g
       
  1791          diff -r 3074c7249d20 -r 599454370881 numbers
       
  1792          --- a/numbers	Thu Jan 01 00:00:00 1970 +0000
       
  1793          +++ b/numbers	Thu Jan 01 00:00:00 1970 +0000
       
  1794          @@ -1,9 +1,9 @@
       
  1795           1
       
  1796           2
       
  1797           3
       
  1798          -four
       
  1799          +4
       
  1800           5
       
  1801           6
       
  1802          -7
       
  1803          +seven
       
  1804           8
       
  1805           nine
       
  1806          diff -r 3074c7249d20 -r 599454370881 romans
       
  1807          --- a/romans	Thu Jan 01 00:00:00 1970 +0000
       
  1808          +++ b/romans	Thu Jan 01 00:00:00 1970 +0000
       
  1809          @@ -1,5 +1,5 @@
       
  1810           I
       
  1811          -II
       
  1812          +ii
       
  1813           III
       
  1814           IV
       
  1815           V
       
  1816   
       
  1817   
       
  1818   $ cd ..
       
  1819 
       
  1820 Phase divergence with file removal cancelation
       
  1821 ==============================================
       
  1822 
       
  1823   $ hg init cancel-removal
       
  1824   $ cd cancel-removal
       
  1825   $ echo a > a
       
  1826   $ echo b > b
       
  1827   $ echo c > c
       
  1828   $ echo d > d
       
  1829   $ hg ci -Aqm initial
       
  1830 
       
  1831 Oops, we meant to delete just 'a', but we deleted 'b' and 'c' too
       
  1832 
       
  1833   $ hg rm a b c
       
  1834   $ hg ci -m 'delete a'
       
  1835   $ hg revert -r .^ b
       
  1836   $ hg amend
       
  1837   $ hg glog --hidden --patch
       
  1838   @  2:0825dcee2670 delete a
       
  1839   |   () draftdiff -r 75d2b02c4a5c -r 0825dcee2670 a
       
  1840   |  --- a/a	Thu Jan 01 00:00:00 1970 +0000
       
  1841   |  +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
  1842   |  @@ -1,1 +0,0 @@
       
  1843   |  -a
       
  1844   |  diff -r 75d2b02c4a5c -r 0825dcee2670 c
       
  1845   |  --- a/c	Thu Jan 01 00:00:00 1970 +0000
       
  1846   |  +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
  1847   |  @@ -1,1 +0,0 @@
       
  1848   |  -c
       
  1849   |
       
  1850   | x  1:dff6e52f5e41 delete a
       
  1851   |/    () draftdiff -r 75d2b02c4a5c -r dff6e52f5e41 a
       
  1852   |    --- a/a	Thu Jan 01 00:00:00 1970 +0000
       
  1853   |    +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
  1854   |    @@ -1,1 +0,0 @@
       
  1855   |    -a
       
  1856   |    diff -r 75d2b02c4a5c -r dff6e52f5e41 b
       
  1857   |    --- a/b	Thu Jan 01 00:00:00 1970 +0000
       
  1858   |    +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
  1859   |    @@ -1,1 +0,0 @@
       
  1860   |    -b
       
  1861   |    diff -r 75d2b02c4a5c -r dff6e52f5e41 c
       
  1862   |    --- a/c	Thu Jan 01 00:00:00 1970 +0000
       
  1863   |    +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
  1864   |    @@ -1,1 +0,0 @@
       
  1865   |    -c
       
  1866   |
       
  1867   o  0:75d2b02c4a5c initial
       
  1868       () draftdiff -r 000000000000 -r 75d2b02c4a5c a
       
  1869      --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
  1870      +++ b/a	Thu Jan 01 00:00:00 1970 +0000
       
  1871      @@ -0,0 +1,1 @@
       
  1872      +a
       
  1873      diff -r 000000000000 -r 75d2b02c4a5c b
       
  1874      --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
  1875      +++ b/b	Thu Jan 01 00:00:00 1970 +0000
       
  1876      @@ -0,0 +1,1 @@
       
  1877      +b
       
  1878      diff -r 000000000000 -r 75d2b02c4a5c c
       
  1879      --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
  1880      +++ b/c	Thu Jan 01 00:00:00 1970 +0000
       
  1881      @@ -0,0 +1,1 @@
       
  1882      +c
       
  1883      diff -r 000000000000 -r 75d2b02c4a5c d
       
  1884      --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
  1885      +++ b/d	Thu Jan 01 00:00:00 1970 +0000
       
  1886      @@ -0,0 +1,1 @@
       
  1887      +d
       
  1888   
       
  1889 
       
  1890 The public predecessors deletes'a', 'b' and 'c',
       
  1891 If was amended to only delete 'a', and 'c'
       
  1892 so the fixup should add back 'b'.
       
  1893 
       
  1894   $ hg phase -p -r dff6e52f5e41 --hidden
       
  1895   1 new phase-divergent changesets
       
  1896   $ hg evolve --phase-divergent
       
  1897   recreate:[2] delete a
       
  1898   atop:[1] delete a
       
  1899   committed as 84aa492b3c37
       
  1900   working directory is now at 84aa492b3c37
       
  1901   $ hg glog --patch
       
  1902   @  3:84aa492b3c37 phase-divergent update to dff6e52f5e41:
       
  1903   |   () draftdiff -r dff6e52f5e41 -r 84aa492b3c37 b
       
  1904   |  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
  1905   |  +++ b/b	Thu Jan 01 00:00:00 1970 +0000
       
  1906   |  @@ -0,0 +1,1 @@
       
  1907   |  +b
       
  1908   |
       
  1909   o  1:dff6e52f5e41 delete a
       
  1910   |   () publicdiff -r 75d2b02c4a5c -r dff6e52f5e41 a
       
  1911   |  --- a/a	Thu Jan 01 00:00:00 1970 +0000
       
  1912   |  +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
  1913   |  @@ -1,1 +0,0 @@
       
  1914   |  -a
       
  1915   |  diff -r 75d2b02c4a5c -r dff6e52f5e41 b
       
  1916   |  --- a/b	Thu Jan 01 00:00:00 1970 +0000
       
  1917   |  +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
  1918   |  @@ -1,1 +0,0 @@
       
  1919   |  -b
       
  1920   |  diff -r 75d2b02c4a5c -r dff6e52f5e41 c
       
  1921   |  --- a/c	Thu Jan 01 00:00:00 1970 +0000
       
  1922   |  +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
  1923   |  @@ -1,1 +0,0 @@
       
  1924   |  -c
       
  1925   |
       
  1926   o  0:75d2b02c4a5c initial
       
  1927       () publicdiff -r 000000000000 -r 75d2b02c4a5c a
       
  1928      --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
  1929      +++ b/a	Thu Jan 01 00:00:00 1970 +0000
       
  1930      @@ -0,0 +1,1 @@
       
  1931      +a
       
  1932      diff -r 000000000000 -r 75d2b02c4a5c b
       
  1933      --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
  1934      +++ b/b	Thu Jan 01 00:00:00 1970 +0000
       
  1935      @@ -0,0 +1,1 @@
       
  1936      +b
       
  1937      diff -r 000000000000 -r 75d2b02c4a5c c
       
  1938      --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
  1939      +++ b/c	Thu Jan 01 00:00:00 1970 +0000
       
  1940      @@ -0,0 +1,1 @@
       
  1941      +c
       
  1942      diff -r 000000000000 -r 75d2b02c4a5c d
       
  1943      --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
  1944      +++ b/d	Thu Jan 01 00:00:00 1970 +0000
       
  1945      @@ -0,0 +1,1 @@
       
  1946      +d
       
  1947   
       
  1948 
       
  1949   $ hg diff --change .
       
  1950   diff -r dff6e52f5e41 -r 84aa492b3c37 b
       
  1951   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       
  1952   +++ b/b	Thu Jan 01 00:00:00 1970 +0000
       
  1953   @@ -0,0 +1,1 @@
       
  1954   +b
       
  1955