tests/test-evolve-effectflags.t
branchmercurial-3.9
changeset 2702 167567795f6c
parent 2701 26ec0839865b
parent 2617 da0d3d4171cb
child 2703 8f199a2b87e9
child 2801 49494d0155b7
equal deleted inserted replaced
2701:26ec0839865b 2702:167567795f6c
     1 Test the 'effect-flags' feature
       
     2 
       
     3 Global setup
       
     4 ============
       
     5 
       
     6   $ . $TESTDIR/testlib/common.sh
       
     7   $ cat >> $HGRCPATH <<EOF
       
     8   > [ui]
       
     9   > interactive = true
       
    10   > [phases]
       
    11   > publish=False
       
    12   > [extensions]
       
    13   > evolve =
       
    14   > rebase =
       
    15   > [experimental]
       
    16   > evolution.effect-flags = 1
       
    17   > EOF
       
    18 
       
    19   $ hg init $TESTTMP/effect-flags
       
    20   $ cd $TESTTMP/effect-flags
       
    21   $ mkcommit ROOT
       
    22 
       
    23 amend touching the description only
       
    24 -----------------------------------
       
    25 
       
    26   $ mkcommit A0
       
    27   $ hg amend -m "A1"
       
    28 
       
    29 check result
       
    30 
       
    31   $ hg debugobsolete --rev .
       
    32   471f378eab4c5e25f6c77f785b27c936efb22874 fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e 0 (*) {'ef1': '1', 'user': 'test'} (glob)
       
    33   $ hg obslog .
       
    34   @  fdf9bde5129a (2) A1
       
    35   |
       
    36   x  471f378eab4c (1) A0
       
    37        rewritten(description) by test (*) as fdf9bde5129a (glob)
       
    38   
       
    39 
       
    40 amend touching the user only
       
    41 ----------------------------
       
    42 
       
    43   $ mkcommit B0
       
    44   $ hg amend -u "bob <bob@bob.com>"
       
    45 
       
    46 check result
       
    47 
       
    48   $ hg debugobsolete --rev .
       
    49   ef4a313b1e0ade55718395d80e6b88c5ccd875eb 5485c92d34330dac9d7a63dc07e1e3373835b964 0 (*) {'ef1': '16', 'user': 'test'} (glob)
       
    50   $ hg obslog .
       
    51   @  5485c92d3433 (4) B0
       
    52   |
       
    53   x  ef4a313b1e0a (3) B0
       
    54        rewritten(user) by test (*) as 5485c92d3433 (glob)
       
    55   
       
    56 
       
    57 amend touching the date only
       
    58 ----------------------------
       
    59 
       
    60   $ mkcommit B1
       
    61   $ hg amend -d "42 0"
       
    62 
       
    63 check result
       
    64 
       
    65   $ hg debugobsolete --rev .
       
    66   2ef0680ff45038ac28c9f1ff3644341f54487280 4dd84345082e9e5291c2e6b3f335bbf8bf389378 0 (*) {'ef1': '32', 'user': 'test'} (glob)
       
    67   $ hg obslog .
       
    68   @  4dd84345082e (6) B1
       
    69   |
       
    70   x  2ef0680ff450 (5) B1
       
    71        rewritten(date) by test (*) as 4dd84345082e (glob)
       
    72   
       
    73 
       
    74 amend touching the branch only
       
    75 ----------------------------
       
    76 
       
    77   $ mkcommit B2
       
    78   $ hg branch my-branch
       
    79   marked working directory as branch my-branch
       
    80   (branches are permanent and global, did you want a bookmark?)
       
    81   $ hg amend
       
    82 
       
    83 check result
       
    84 
       
    85   $ hg debugobsolete --rev .
       
    86   4d1430a201c1ffbd8465dec75edd4a691a2d97ec 0 {bd3db8264ceebf1966319f5df3be7aac6acd1a8e} (*) {'ef1': '0', 'user': 'test'} (glob)
       
    87   bd3db8264ceebf1966319f5df3be7aac6acd1a8e 14a01456e0574f0e0a0b15b2345486a6364a8d79 0 (*) {'ef1': '64', 'user': 'test'} (glob)
       
    88   $ hg obslog .
       
    89   @  14a01456e057 (9) B2
       
    90   |
       
    91   x  bd3db8264cee (7) B2
       
    92        rewritten(branch) by test (*) as 14a01456e057 (glob)
       
    93   
       
    94 
       
    95   $ hg up default
       
    96   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
    97 
       
    98 rebase (parents change)
       
    99 -----------------------
       
   100 
       
   101   $ mkcommit C0
       
   102   $ mkcommit D0
       
   103   $ hg rebase -r . -d 'desc(B0)'
       
   104   rebasing 11:c85eff83a034 "D0" (tip)
       
   105 
       
   106 check result
       
   107 
       
   108   $ hg debugobsolete --rev .
       
   109   c85eff83a0340efd9da52b806a94c350222f3371 da86aa2f19a30d6686b15cae15c7b6c908ec9699 0 (*) {'ef1': '4', 'user': 'test'} (glob)
       
   110   $ hg obslog .
       
   111   @  da86aa2f19a3 (12) D0
       
   112   |
       
   113   x  c85eff83a034 (11) D0
       
   114        rewritten(parent) by test (*) as da86aa2f19a3 (glob)
       
   115   
       
   116 
       
   117 amend touching the diff
       
   118 -----------------------
       
   119 
       
   120   $ mkcommit E0
       
   121   $ echo 42 >> E0
       
   122   $ hg amend
       
   123 
       
   124 check result
       
   125 
       
   126   $ hg debugobsolete --rev .
       
   127   d6f4d8b8d3c8cde990f13915bced7f92ce1cc54f 0 {ebfe0333e0d96f68a917afd97c0a0af87f1c3b5f} (*) {'ef1': '0', 'user': 'test'} (glob)
       
   128   ebfe0333e0d96f68a917afd97c0a0af87f1c3b5f 75781fdbdbf58a987516b00c980bccda1e9ae588 0 (*) {'ef1': '8', 'user': 'test'} (glob)
       
   129   $ hg obslog .
       
   130   @  75781fdbdbf5 (15) E0
       
   131   |
       
   132   x  ebfe0333e0d9 (13) E0
       
   133        rewritten(content) by test (*) as 75781fdbdbf5 (glob)
       
   134   
       
   135 
       
   136 amend with multiple effect (desc and meta)
       
   137 -------------------------------------------
       
   138 
       
   139   $ mkcommit F0
       
   140   $ hg branch my-other-branch
       
   141   marked working directory as branch my-other-branch
       
   142   $ hg amend -m F1 -u "bob <bob@bob.com>" -d "42 0"
       
   143 
       
   144 check result
       
   145 
       
   146   $ hg debugobsolete --rev .
       
   147   3b12912003b4e7aa6df6cded86255006c3c29d27 0 {fad47e5bd78e6aa4db1b5a0a1751bc12563655ff} (*) {'ef1': '0', 'user': 'test'} (glob)
       
   148   fad47e5bd78e6aa4db1b5a0a1751bc12563655ff a94e0fd5f1c81d969381a76eb0d37ce499a44fae 0 (*) {'ef1': '113', 'user': 'test'} (glob)
       
   149   $ hg obslog .
       
   150   @  a94e0fd5f1c8 (18) F1
       
   151   |
       
   152   x  fad47e5bd78e (16) F0
       
   153        rewritten(description, user, date, branch) by test (*) as a94e0fd5f1c8 (glob)
       
   154   
       
   155 rebase not touching the diff
       
   156 ----------------------------
       
   157 
       
   158   $ cat << EOF > H0
       
   159   > 0
       
   160   > 1
       
   161   > 2
       
   162   > 3
       
   163   > 4
       
   164   > 5
       
   165   > 6
       
   166   > 7
       
   167   > 8
       
   168   > 9
       
   169   > 10
       
   170   > EOF
       
   171   $ hg add H0
       
   172   $ hg commit -m 'H0'
       
   173   $ echo "H1" >> H0
       
   174   $ hg commit -m "H1"
       
   175   $ hg up -r "desc(H0)"
       
   176   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   177   $ cat << EOF > H0
       
   178   > H2
       
   179   > 0
       
   180   > 1
       
   181   > 2
       
   182   > 3
       
   183   > 4
       
   184   > 5
       
   185   > 6
       
   186   > 7
       
   187   > 8
       
   188   > 9
       
   189   > 10
       
   190   > EOF
       
   191   $ hg commit -m "H2"
       
   192   created new head
       
   193   $ hg rebase -s "desc(H1)" -d "desc(H2)" -t :merge3
       
   194   rebasing 20:b57fed8d8322 "H1"
       
   195   merging H0
       
   196   $ hg obslog tip
       
   197   o  e509e2eb3df5 (22) H1
       
   198   |
       
   199   x  b57fed8d8322 (20) H1
       
   200        rewritten(parent) by test (*) as e509e2eb3df5 (glob)
       
   201   
       
   202 amend closing the branch should be detected as meta change
       
   203 ----------------------------------------------------------
       
   204 
       
   205   $ hg branch closedbranch
       
   206   marked working directory as branch closedbranch
       
   207   $ mkcommit G0
       
   208   $ mkcommit I0
       
   209   $ hg commit --amend --close-branch
       
   210 
       
   211 check result
       
   212 
       
   213   $ hg obslog .
       
   214   @  12c6238b5e37 (26) I0
       
   215   |
       
   216   x  2f599e54c1c6 (24) I0
       
   217        rewritten(meta) by test (*) as 12c6238b5e37 (glob)
       
   218