tests/test-topic-fold.t
branchmercurial-3.9
changeset 2801 49494d0155b7
parent 2800 13c4d518327a
parent 2702 167567795f6c
child 2802 41c9a4df628e
child 2811 35d053d7bd87
equal deleted inserted replaced
2800:13c4d518327a 2801:49494d0155b7
     1 test of the fold command
       
     2 ------------------------
       
     3 
       
     4   $ cat >> $HGRCPATH <<EOF
       
     5   > [defaults]
       
     6   > amend=-d "0 0"
       
     7   > fold=-d "0 0"
       
     8   > split=-d "0 0"
       
     9   > amend=-d "0 0"
       
    10   > [web]
       
    11   > push_ssl = false
       
    12   > allow_push = *
       
    13   > [phases]
       
    14   > publish = False
       
    15   > [diff]
       
    16   > git = 1
       
    17   > unified = 0
       
    18   > [ui]
       
    19   > interactive = true
       
    20   > [extensions]
       
    21   > EOF
       
    22   $ echo "topic=$(echo $(dirname $TESTDIR))/hgext3rd/topic/" >> $HGRCPATH
       
    23   $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
       
    24   $ mkcommit() {
       
    25   >    echo "$1" > "$1"
       
    26   >    hg add "$1"
       
    27   >    hg ci -m "add $1" $2 $3
       
    28   > }
       
    29   $ logtopic() {
       
    30   >    hg log -G -T "{rev}:{node}\ntopics: {topics}" 
       
    31   > }
       
    32 
       
    33 Check that fold keep the topic if all revisions have the topic
       
    34 --------------------------------------------------------------
       
    35 
       
    36   $ hg init testfold
       
    37   $ cd testfold
       
    38   $ mkcommit ROOT
       
    39   $ hg topic myfeature
       
    40   $ mkcommit feature1
       
    41   $ mkcommit feature2
       
    42   $ logtopic
       
    43   @  2:d76a6166b18c835be9a487c5e21c7d260f0a1676
       
    44   |  topics: myfeature
       
    45   o  1:39e7a938055e87615edf675c24a10997ff05bb06
       
    46   |  topics: myfeature
       
    47   o  0:3e7df3b3b17c6deb4a1c70e790782fdf17af96a7
       
    48      topics:
       
    49   $ hg fold --exact -r "(tip~1)::" -m "folded"
       
    50   2 changesets folded
       
    51   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    52   $ hg stack
       
    53   ### topic: myfeature
       
    54   ### branch: default
       
    55   t1@ folded (current)
       
    56   t0^ add ROOT (base)
       
    57   $ logtopic
       
    58   @  3:4fd43e5bdc443dc8489edffac19bd8f93ccf1a5c
       
    59   |  topics: myfeature
       
    60   o  0:3e7df3b3b17c6deb4a1c70e790782fdf17af96a7
       
    61      topics:
       
    62   $ hg summary
       
    63   parent: 3:4fd43e5bdc44 tip
       
    64    folded
       
    65   branch: default
       
    66   commit: (clean)
       
    67   update: (current)
       
    68   phases: 2 draft
       
    69   topic:  myfeature
       
    70 
       
    71 Check that fold dismis the topic if not all revisions have the topic
       
    72 --------------------------------------------------------------------
       
    73 
       
    74 (I'm not sure this behavior make senses, but now it is tested)
       
    75 
       
    76   $ hg topic --clear
       
    77   $ mkcommit feature3
       
    78   created new head
       
    79   $ hg topic myotherfeature
       
    80   $ mkcommit feature4
       
    81   $ logtopic
       
    82   @  5:5ded4d6d578c37f339b0716de2e46e12ece7cbde
       
    83   |  topics: myotherfeature
       
    84   o  4:bdf6950b9b5b7c6b377c8132667c73ec86d5734f
       
    85   |  topics:
       
    86   o  3:4fd43e5bdc443dc8489edffac19bd8f93ccf1a5c
       
    87   |  topics: myfeature
       
    88   o  0:3e7df3b3b17c6deb4a1c70e790782fdf17af96a7
       
    89      topics:
       
    90   $ hg fold --exact -r "(tip~1)::" -m "folded 2"
       
    91   2 changesets folded
       
    92   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    93   $ logtopic
       
    94   @  6:03da8f7238e9a4d708d6b8af402c91c68f271477
       
    95   |  topics:
       
    96   o  3:4fd43e5bdc443dc8489edffac19bd8f93ccf1a5c
       
    97   |  topics: myfeature
       
    98   o  0:3e7df3b3b17c6deb4a1c70e790782fdf17af96a7
       
    99      topics:
       
   100   $ hg summary
       
   101   parent: 6:03da8f7238e9 tip
       
   102    folded 2
       
   103   branch: default
       
   104   commit: (clean)
       
   105   update: (current)
       
   106   phases: 3 draft