tests/test-divergent.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Wed, 03 May 2017 18:46:48 +0200
changeset 2326 72853bade853
parent 1806 9f42f819267b
child 2776 4dd84054ebbb
permissions -rw-r--r--
obscache: extract code to update from new revision Code cleanup and prepare upstreaming. The make the code more likely to work with the key validation returning an iterator of revs to update the cache with.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1467
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     1
Tests the resolution of divergence
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     2
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     3
  $ cat >> $HGRCPATH <<EOF
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     4
  > [defaults]
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     5
  > amend=-d "0 0"
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     6
  > fold=-d "0 0"
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     7
  > [web]
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     8
  > push_ssl = false
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     9
  > allow_push = *
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    10
  > [phases]
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    11
  > publish = False
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    12
  > [diff]
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    13
  > git = 1
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    14
  > unified = 0
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    15
  > [ui]
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    16
  > logtemplate = {rev}:{node|short}@{branch}({phase}) {desc|firstline} [{troubles}]\n
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    17
  > [extensions]
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    18
  > hgext.graphlog=
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    19
  > EOF
1806
9f42f819267b evolve: move the extensions to 'hgext3rd'
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 1630
diff changeset
    20
  $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
1467
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    21
  $ mkcommit() {
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    22
  >    echo "$1" > "$1"
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    23
  >    hg add "$1"
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    24
  >    hg ci -m "add $1"
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    25
  > }
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    26
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    27
  $ mkcommits() {
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    28
  >   for i in $@; do mkcommit $i ; done
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    29
  > }
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    30
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    31
Basic test of divergence: two divergent changesets with the same parents
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    32
With --all --any we dedupe the divergent and solve the divergence once
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    33
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    34
  $ hg init test1
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    35
  $ cd test1
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    36
  $ mkcommits _a _b
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    37
  $ hg up "desc(_a)"
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    38
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    39
  $ mkcommit bdivergent1
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    40
  created new head
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    41
  $ hg up "desc(_a)"
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    42
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    43
  $ mkcommit bdivergent2
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    44
  created new head
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    45
  $ hg prune -s "desc(bdivergent1)" "desc(_b)"
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    46
  1 changesets pruned
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    47
  $ hg prune -s "desc(bdivergent2)" "desc(_b)" --hidden
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    48
  1 changesets pruned
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    49
  2 new divergent changesets
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    50
  $ hg log -G
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    51
  @  3:e708fd28d5cf@default(draft) add bdivergent2 [divergent]
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    52
  |
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    53
  | o  2:c2f698071cba@default(draft) add bdivergent1 [divergent]
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    54
  |/
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    55
  o  0:135f39f4bd78@default(draft) add _a []
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    56
  
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    57
  $ hg evolve --all --any --divergent
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    58
  merge:[2] add bdivergent1
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    59
  with: [3] add bdivergent2
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    60
  base: [1] add _b
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    61
  updating to "local" conflict
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    62
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    63
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    64
  working directory is now at c26f1d3baed2
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    65
  $ hg log -G
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    66
  @  5:c26f1d3baed2@default(draft) add bdivergent1 []
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    67
  |
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    68
  o  0:135f39f4bd78@default(draft) add _a []
5c385b812500 evolve: dedupe divergents when running evolve --all --any or evolve --rev
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    69
  
1536
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    70
Test divergence resolution when it yields to an empty commit (issue4950)
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    71
cdivergent2 contains the same content than cdivergent1 and they are divergent
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    72
versions of the revision _c
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    73
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    74
  $ hg up "desc(_a)"
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    75
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    76
  $ mkcommit _c
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    77
  created new head
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    78
  $ hg up "desc(_a)"
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    79
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    80
  $ mkcommit cdivergent1
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    81
  created new head
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    82
  $ hg up "desc(_a)"
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    83
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    84
  $ echo "cdivergent1" > cdivergent1
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    85
  $ hg add cdivergent1
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    86
  $ hg ci -m "cdivergent2"
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    87
  created new head
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    88
  $ hg prune -s "desc(cdivergent1)" "desc(_c)"
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    89
  1 changesets pruned
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    90
  $ hg prune -s "desc(cdivergent2)" "desc(_c)" --hidden
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    91
  1 changesets pruned
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    92
  2 new divergent changesets
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    93
  $ hg log -G
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    94
  @  8:0a768ef678d9@default(draft) cdivergent2 [divergent]
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    95
  |
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    96
  | o  7:26c7705fee96@default(draft) add cdivergent1 [divergent]
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    97
  |/
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    98
  | o  5:c26f1d3baed2@default(draft) add bdivergent1 []
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
    99
  |/
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   100
  o  0:135f39f4bd78@default(draft) add _a []
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   101
  
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   102
  $ hg evolve --all --any --divergent
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   103
  merge:[7] add cdivergent1
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   104
  with: [8] cdivergent2
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   105
  base: [6] add _c
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   106
  updating to "local" conflict
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   107
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   108
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
9afe9e0191a1 evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Laurent Charignon <lcharignon@fb.com>
parents: 1467
diff changeset
   109
  working directory is now at 6602ff5a79dc
1630
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   110
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   111
Test None docstring issue of evolve divergent, which caused hg crush
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   112
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   113
  $ hg init test2
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   114
  $ cd test2
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   115
  $ mkcommits _a _b
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   116
  $ hg up "desc(_a)"
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   117
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   118
  $ mkcommit bdivergent1
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   119
  created new head
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   120
  $ hg up "desc(_a)"
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   121
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   122
  $ mkcommit bdivergent2
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   123
  created new head
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   124
  $ hg prune -s "desc(bdivergent1)" "desc(_b)"
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   125
  1 changesets pruned
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   126
  $ hg prune -s "desc(bdivergent2)" "desc(_b)" --hidden
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   127
  1 changesets pruned
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   128
  2 new divergent changesets
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   129
  $ hg log -G
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   130
  @  3:e708fd28d5cf@default(draft) add bdivergent2 [divergent]
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   131
  |
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   132
  | o  2:c2f698071cba@default(draft) add bdivergent1 [divergent]
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   133
  |/
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   134
  o  0:135f39f4bd78@default(draft) add _a []
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   135
  
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   136
  $ cat >$TESTTMP/test_extension.py  << EOF
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   137
  > from mercurial import merge
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   138
  > origupdate = merge.update
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   139
  > def newupdate(*args, **kwargs):
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   140
  >   return origupdate(*args, **kwargs)
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   141
  > merge.update = newupdate
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   142
  > EOF
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   143
  $ cat >> $HGRCPATH << EOF
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   144
  > [extensions]
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   145
  > testextension=$TESTTMP/test_extension.py
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   146
  > EOF
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   147
  $ hg evolve --all
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   148
  nothing to evolve on current working copy parent
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   149
  (do you want to use --divergent)
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   150
  [2]
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   151
  $ hg evolve --divergent
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   152
  merge:[3] add bdivergent2
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   153
  with: [2] add bdivergent1
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   154
  base: [1] add _b
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   155
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   156
  working directory is now at aa26817f6fbe
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   157
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   158
35c666ef724e evolve: Fix crush when reading docstring
Juntao Li <juntaoli@fb.com>
parents: 1536
diff changeset
   159
  $ cd ..