tests/test-rebase-obsolete2.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Thu, 01 Apr 2021 11:31:54 +0200
changeset 47037 d57386e5c80e
parent 46863 d9601243b73c
child 48687 f8f2ecdde4b5
permissions -rw-r--r--
revlog: have an explicit "pack_header" method Having to pass the version header when retrieving the binary version of every single entry is a bit silly. So we extract that special logic in its own method. This also prepare the move to newer revlog format, not storing the header within an actual entry… Differential Revision: https://phab.mercurial-scm.org/D10510
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17612
fc2a6114f0a0 rebase: allow creation obsolescence relation instead of stripping
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     1
==========================
fc2a6114f0a0 rebase: allow creation obsolescence relation instead of stripping
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     2
Test rebase with obsolete
fc2a6114f0a0 rebase: allow creation obsolescence relation instead of stripping
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     3
==========================
fc2a6114f0a0 rebase: allow creation obsolescence relation instead of stripping
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     4
fc2a6114f0a0 rebase: allow creation obsolescence relation instead of stripping
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     5
Enable obsolete
fc2a6114f0a0 rebase: allow creation obsolescence relation instead of stripping
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     6
fc2a6114f0a0 rebase: allow creation obsolescence relation instead of stripping
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     7
  $ cat >> $HGRCPATH << EOF
45765
ed84a4d48910 config: add a new [command-templates] section for templates defined by hg
Martin von Zweigbergk <martinvonz@google.com>
parents: 45458
diff changeset
     8
  > [command-templates]
ed84a4d48910 config: add a new [command-templates] section for templates defined by hg
Martin von Zweigbergk <martinvonz@google.com>
parents: 45458
diff changeset
     9
  > log= {rev}:{node|short} {desc|firstline}{if(obsolete,' ({obsfate})')}
22955
fab9dda0f2a3 obsolete: update tests to use obsolete options
Durham Goode <durham@fb.com>
parents: 22260
diff changeset
    10
  > [experimental]
34866
1644623ab096 config: use 'experimental.evolution.create-markers'
Boris Feld <boris.feld@octobus.net>
parents: 34865
diff changeset
    11
  > evolution.createmarkers=True
34867
7f183c643eb6 config: use 'experimental.evolution.allowunstable'
Boris Feld <boris.feld@octobus.net>
parents: 34866
diff changeset
    12
  > evolution.allowunstable=True
17612
fc2a6114f0a0 rebase: allow creation obsolescence relation instead of stripping
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    13
  > [phases]
fc2a6114f0a0 rebase: allow creation obsolescence relation instead of stripping
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    14
  > publish=False
27011
53c668dc6b16 rebase: fix a typo in test-rebase-obsolete
Laurent Charignon <lcharignon@fb.com>
parents: 26902
diff changeset
    15
  > [extensions]
17612
fc2a6114f0a0 rebase: allow creation obsolescence relation instead of stripping
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    16
  > rebase=
33677
644dddccc265 tests: demonstrate broken rebase of merge with p1's successor in dest
Martin von Zweigbergk <martinvonz@google.com>
parents: 33667
diff changeset
    17
  > drawdag=$TESTDIR/drawdag.py
39093
cc37009e95ca rebase: add --stop option to stop rebase at any point (issue5206)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 38239
diff changeset
    18
  > strip=
17612
fc2a6114f0a0 rebase: allow creation obsolescence relation instead of stripping
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    19
  > EOF
fc2a6114f0a0 rebase: allow creation obsolescence relation instead of stripping
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    20
26675
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    21
Skip obsolete changeset even with multiple hops
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    22
-----------------------------------------------
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    23
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    24
setup
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    25
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    26
  $ hg init obsskip
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    27
  $ cd obsskip
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    28
  $ cat << EOF >> .hg/hgrc
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    29
  > [experimental]
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    30
  > rebaseskipobsolete = True
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    31
  > [extensions]
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    32
  > strip =
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    33
  > EOF
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    34
  $ echo A > A
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    35
  $ hg add A
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    36
  $ hg commit -m A
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    37
  $ echo B > B
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    38
  $ hg add B
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    39
  $ hg commit -m B0
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    40
  $ hg commit --amend -m B1
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    41
  $ hg commit --amend -m B2
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    42
  $ hg up --hidden 'desc(B0)'
37920
ea63a2004d09 update: print warning about hidden changeset after update
Martin von Zweigbergk <martinvonz@google.com>
parents: 37787
diff changeset
    43
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
ea63a2004d09 update: print warning about hidden changeset after update
Martin von Zweigbergk <martinvonz@google.com>
parents: 37787
diff changeset
    44
  updated to hidden changeset a8b11f55fb19
35711
35a0f6f31eef update: display the obsfate of hidden revision we update to
Boris Feld <boris.feld@octobus.net>
parents: 35709
diff changeset
    45
  (hidden revision 'a8b11f55fb19' was rewritten as: 261e70097290)
26675
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    46
  $ echo C > C
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    47
  $ hg add C
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    48
  $ hg commit -m C
35709
1a09dad8b85a evolution: report new unstable changesets
Martin von Zweigbergk <martinvonz@google.com>
parents: 35611
diff changeset
    49
  1 new orphan changesets
35057
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    50
  $ hg log -G
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    51
  @  4:212cb178bcbb C
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    52
  |
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    53
  | o  3:261e70097290 B2
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    54
  | |
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    55
  x |  1:a8b11f55fb19 B0 (rewritten using amend as 3:261e70097290)
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    56
  |/
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    57
  o  0:4a2df7238c3b A
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    58
  
26675
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    59
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    60
Rebase finds its way in a chain of marker
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    61
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    62
  $ hg rebase -d 'desc(B2)'
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    63
  note: not rebasing 1:a8b11f55fb19 "B0", already in destination as 3:261e70097290 "B2"
45771
f90a5c211251 rebase: change and standarize template for rebase's one-line summary
Martin von Zweigbergk <martinvonz@google.com>
parents: 45765
diff changeset
    64
  rebasing 4:212cb178bcbb tip "C"
26675
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    65
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    66
Even when the chain include missing node
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    67
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    68
  $ hg up --hidden 'desc(B0)'
37920
ea63a2004d09 update: print warning about hidden changeset after update
Martin von Zweigbergk <martinvonz@google.com>
parents: 37787
diff changeset
    69
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
ea63a2004d09 update: print warning about hidden changeset after update
Martin von Zweigbergk <martinvonz@google.com>
parents: 37787
diff changeset
    70
  updated to hidden changeset a8b11f55fb19
35711
35a0f6f31eef update: display the obsfate of hidden revision we update to
Boris Feld <boris.feld@octobus.net>
parents: 35709
diff changeset
    71
  (hidden revision 'a8b11f55fb19' was rewritten as: 261e70097290)
26675
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    72
  $ echo D > D
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    73
  $ hg add D
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    74
  $ hg commit -m D
35709
1a09dad8b85a evolution: report new unstable changesets
Martin von Zweigbergk <martinvonz@google.com>
parents: 35611
diff changeset
    75
  1 new orphan changesets
26675
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    76
  $ hg --hidden strip -r 'desc(B1)'
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35058
diff changeset
    77
  saved backup bundle to $TESTTMP/obsskip/.hg/strip-backup/86f6414ccda7-b1c452ee-backup.hg
35778
128dd940bedc repair: invalidate volatile sets after stripping
Martin von Zweigbergk <martinvonz@google.com>
parents: 35712
diff changeset
    78
  1 new orphan changesets
35057
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    79
  $ hg log -G
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    80
  @  5:1a79b7535141 D
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    81
  |
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    82
  | o  4:ff2c4d47b71d C
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    83
  | |
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    84
  | o  2:261e70097290 B2
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    85
  | |
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    86
  x |  1:a8b11f55fb19 B0 (rewritten using amend as 2:261e70097290)
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    87
  |/
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    88
  o  0:4a2df7238c3b A
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    89
  
26675
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    90
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    91
  $ hg rebase -d 'desc(B2)'
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    92
  note: not rebasing 1:a8b11f55fb19 "B0", already in destination as 2:261e70097290 "B2"
45771
f90a5c211251 rebase: change and standarize template for rebase's one-line summary
Martin von Zweigbergk <martinvonz@google.com>
parents: 45765
diff changeset
    93
  rebasing 5:1a79b7535141 tip "D"
27012
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
    94
  $ hg up 4
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
    95
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
    96
  $ echo "O" > O
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
    97
  $ hg add O
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
    98
  $ hg commit -m O
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
    99
  $ echo "P" > P
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   100
  $ hg add P
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   101
  $ hg commit -m P
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   102
  $ hg log -G
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   103
  @  8:8d47583e023f P
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   104
  |
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   105
  o  7:360bbaa7d3ce O
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   106
  |
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   107
  | o  6:9c48361117de D
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   108
  | |
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   109
  o |  4:ff2c4d47b71d C
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   110
  |/
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   111
  o  2:261e70097290 B2
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   112
  |
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   113
  o  0:4a2df7238c3b A
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   114
  
34865
a0100f34e20b config: replace experimental.stabilization by experimental.evolution
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
   115
  $ hg debugobsolete `hg log -r 7 -T '{node}\n'` --config experimental.evolution=true
42893
34a46d48d24e debugobsolete: also issue the "new obsmarkers" messsage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40865
diff changeset
   116
  1 new obsolescence markers
33542
b11e8c67fb0f debugobsolete: also report the number of obsoleted changesets
Boris Feld <boris.feld@octobus.net>
parents: 33332
diff changeset
   117
  obsoleted 1 changesets
35709
1a09dad8b85a evolution: report new unstable changesets
Martin von Zweigbergk <martinvonz@google.com>
parents: 35611
diff changeset
   118
  1 new orphan changesets
27012
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   119
  $ hg rebase -d 6 -r "4::"
34008
9422107a6b64 rebase: move working parent and bookmark for obsoleted revs (BC)
Jun Wu <quark@fb.com>
parents: 33863
diff changeset
   120
  rebasing 4:ff2c4d47b71d "C"
33842
30573b3d2ebc rebase: move obsoleted not rebased messages earlier (BC)
Jun Wu <quark@fb.com>
parents: 33789
diff changeset
   121
  note: not rebasing 7:360bbaa7d3ce "O", it has no successor
45771
f90a5c211251 rebase: change and standarize template for rebase's one-line summary
Martin von Zweigbergk <martinvonz@google.com>
parents: 45765
diff changeset
   122
  rebasing 8:8d47583e023f tip "P"
27577
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   123
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   124
If all the changeset to be rebased are obsolete and present in the destination, we
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   125
should display a friendly error message
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   126
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   127
  $ hg log -G
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   128
  @  10:121d9e3bc4c6 P
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   129
  |
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   130
  o  9:4be60e099a77 C
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   131
  |
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   132
  o  6:9c48361117de D
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   133
  |
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   134
  o  2:261e70097290 B2
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   135
  |
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   136
  o  0:4a2df7238c3b A
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   137
  
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   138
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   139
  $ hg up 9
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   140
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   141
  $ echo "non-relevant change" > nonrelevant
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   142
  $ hg add nonrelevant
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   143
  $ hg commit -m nonrelevant
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   144
  created new head
34865
a0100f34e20b config: replace experimental.stabilization by experimental.evolution
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
   145
  $ hg debugobsolete `hg log -r 11 -T '{node}\n'` --config experimental.evolution=true
42893
34a46d48d24e debugobsolete: also issue the "new obsmarkers" messsage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40865
diff changeset
   146
  1 new obsolescence markers
33542
b11e8c67fb0f debugobsolete: also report the number of obsoleted changesets
Boris Feld <boris.feld@octobus.net>
parents: 33332
diff changeset
   147
  obsoleted 1 changesets
35057
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
   148
  $ hg log -G
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
   149
  @  11:f44da1f4954c nonrelevant (pruned)
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
   150
  |
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
   151
  | o  10:121d9e3bc4c6 P
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
   152
  |/
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
   153
  o  9:4be60e099a77 C
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
   154
  |
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
   155
  o  6:9c48361117de D
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
   156
  |
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
   157
  o  2:261e70097290 B2
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
   158
  |
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
   159
  o  0:4a2df7238c3b A
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
   160
  
27577
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   161
  $ hg rebase -r . -d 10
45771
f90a5c211251 rebase: change and standarize template for rebase's one-line summary
Martin von Zweigbergk <martinvonz@google.com>
parents: 45765
diff changeset
   162
  note: not rebasing 11:f44da1f4954c tip "nonrelevant", it has no successor
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   163
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   164
If a rebase is going to create divergence, it should abort
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   165
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   166
  $ hg log -G
34008
9422107a6b64 rebase: move working parent and bookmark for obsoleted revs (BC)
Jun Wu <quark@fb.com>
parents: 33863
diff changeset
   167
  @  10:121d9e3bc4c6 P
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   168
  |
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   169
  o  9:4be60e099a77 C
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   170
  |
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   171
  o  6:9c48361117de D
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   172
  |
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   173
  o  2:261e70097290 B2
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   174
  |
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   175
  o  0:4a2df7238c3b A
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   176
  
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   177
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   178
  $ hg up 9
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   179
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   180
  $ echo "john" > doe
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   181
  $ hg add doe
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   182
  $ hg commit -m "john doe"
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   183
  created new head
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   184
  $ hg up 10
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   185
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   186
  $ echo "foo" > bar
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   187
  $ hg add bar
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   188
  $ hg commit --amend -m "10'"
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   189
  $ hg up 10 --hidden
37920
ea63a2004d09 update: print warning about hidden changeset after update
Martin von Zweigbergk <martinvonz@google.com>
parents: 37787
diff changeset
   190
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
ea63a2004d09 update: print warning about hidden changeset after update
Martin von Zweigbergk <martinvonz@google.com>
parents: 37787
diff changeset
   191
  updated to hidden changeset 121d9e3bc4c6
35711
35a0f6f31eef update: display the obsfate of hidden revision we update to
Boris Feld <boris.feld@octobus.net>
parents: 35709
diff changeset
   192
  (hidden revision '121d9e3bc4c6' was rewritten as: 77d874d096a2)
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   193
  $ echo "bar" > foo
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   194
  $ hg add foo
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   195
  $ hg commit -m "bar foo"
35709
1a09dad8b85a evolution: report new unstable changesets
Martin von Zweigbergk <martinvonz@google.com>
parents: 35611
diff changeset
   196
  1 new orphan changesets
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   197
  $ hg log -G
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   198
  @  14:73568ab6879d bar foo
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   199
  |
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   200
  | o  13:77d874d096a2 10'
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   201
  | |
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   202
  | | o  12:3eb461388009 john doe
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   203
  | |/
35056
235d58aa723e tests: conditionally display obsfate in test-rebase-obsolete log output
Denis Laxalde <denis@laxalde.org>
parents: 35055
diff changeset
   204
  x |  10:121d9e3bc4c6 P (rewritten using amend as 13:77d874d096a2)
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   205
  |/
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   206
  o  9:4be60e099a77 C
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   207
  |
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   208
  o  6:9c48361117de D
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   209
  |
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   210
  o  2:261e70097290 B2
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   211
  |
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   212
  o  0:4a2df7238c3b A
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   213
  
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   214
  $ hg summary
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   215
  parent: 14:73568ab6879d tip (orphan)
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   216
   bar foo
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   217
  branch: default
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   218
  commit: (clean)
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   219
  update: 2 new changesets, 3 branch heads (merge)
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   220
  phases: 8 draft
33667
03039ff3082b evolution: rename unstable to orphan
Boris Feld <boris.feld@octobus.net>
parents: 33542
diff changeset
   221
  orphan: 1 changesets
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   222
  $ hg rebase -s 10 -d 12
28188
6411140aeda9 rebase: add potential divergent commit hashes to error message (issue5086)
Kostia Balytskyi <ikostia@fb.com>
parents: 27974
diff changeset
   223
  abort: this rebase will cause divergences from: 121d9e3bc4c6
34872
29f52e7966dd config: gather allowdivergence under the evolution namespace
Boris Feld <boris.feld@octobus.net>
parents: 34870
diff changeset
   224
  (to force the rebase please set experimental.evolution.allowdivergence=True)
46632
9989a276712f errors: use more specific errors in rebase extension
Martin von Zweigbergk <martinvonz@google.com>
parents: 45840
diff changeset
   225
  [20]
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   226
  $ hg log -G
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   227
  @  14:73568ab6879d bar foo
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   228
  |
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   229
  | o  13:77d874d096a2 10'
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   230
  | |
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   231
  | | o  12:3eb461388009 john doe
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   232
  | |/
35056
235d58aa723e tests: conditionally display obsfate in test-rebase-obsolete log output
Denis Laxalde <denis@laxalde.org>
parents: 35055
diff changeset
   233
  x |  10:121d9e3bc4c6 P (rewritten using amend as 13:77d874d096a2)
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   234
  |/
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   235
  o  9:4be60e099a77 C
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   236
  |
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   237
  o  6:9c48361117de D
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   238
  |
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   239
  o  2:261e70097290 B2
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   240
  |
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   241
  o  0:4a2df7238c3b A
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   242
  
34872
29f52e7966dd config: gather allowdivergence under the evolution namespace
Boris Feld <boris.feld@octobus.net>
parents: 34870
diff changeset
   243
With experimental.evolution.allowdivergence=True, rebase can create divergence
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   244
34872
29f52e7966dd config: gather allowdivergence under the evolution namespace
Boris Feld <boris.feld@octobus.net>
parents: 34870
diff changeset
   245
  $ hg rebase -s 10 -d 12 --config experimental.evolution.allowdivergence=True
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   246
  rebasing 10:121d9e3bc4c6 "P"
45771
f90a5c211251 rebase: change and standarize template for rebase's one-line summary
Martin von Zweigbergk <martinvonz@google.com>
parents: 45765
diff changeset
   247
  rebasing 14:73568ab6879d tip "bar foo"
35709
1a09dad8b85a evolution: report new unstable changesets
Martin von Zweigbergk <martinvonz@google.com>
parents: 35611
diff changeset
   248
  2 new content-divergent changesets
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   249
  $ hg summary
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   250
  parent: 16:61bd55f69bc4 tip
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   251
   bar foo
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   252
  branch: default
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   253
  commit: (clean)
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   254
  update: 1 new changesets, 2 branch heads (merge)
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   255
  phases: 8 draft
33688
2194a8723138 evolution: rename divergent to content-divergent
Boris Feld <boris.feld@octobus.net>
parents: 33678
diff changeset
   256
  content-divergent: 2 changesets
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   257
28686
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   258
rebase --continue + skipped rev because their successors are in destination
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   259
we make a change in trunk and work on conflicting changes to make rebase abort.
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   260
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   261
  $ hg log -G -r 16::
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   262
  @  16:61bd55f69bc4 bar foo
28686
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   263
  |
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   264
  ~
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   265
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   266
Create the two changes in trunk
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   267
  $ printf "a" > willconflict
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   268
  $ hg add willconflict
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   269
  $ hg commit -m "willconflict first version"
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   270
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   271
  $ printf "dummy" > C
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   272
  $ hg commit -m "dummy change successor"
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   273
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   274
Create the changes that we will rebase
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   275
  $ hg update -C 16 -q
28686
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   276
  $ printf "b" > willconflict
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   277
  $ hg add willconflict
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   278
  $ hg commit -m "willconflict second version"
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   279
  created new head
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   280
  $ printf "dummy" > K
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   281
  $ hg add K
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   282
  $ hg commit -m "dummy change"
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   283
  $ printf "dummy" > L
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   284
  $ hg add L
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   285
  $ hg commit -m "dummy change"
34865
a0100f34e20b config: replace experimental.stabilization by experimental.evolution
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
   286
  $ hg debugobsolete `hg log -r ".^" -T '{node}'` `hg log -r 18 -T '{node}'` --config experimental.evolution=true
42893
34a46d48d24e debugobsolete: also issue the "new obsmarkers" messsage
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40865
diff changeset
   287
  1 new obsolescence markers
33542
b11e8c67fb0f debugobsolete: also report the number of obsoleted changesets
Boris Feld <boris.feld@octobus.net>
parents: 33332
diff changeset
   288
  obsoleted 1 changesets
35709
1a09dad8b85a evolution: report new unstable changesets
Martin von Zweigbergk <martinvonz@google.com>
parents: 35611
diff changeset
   289
  1 new orphan changesets
28686
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   290
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   291
  $ hg log -G -r 16::
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   292
  @  21:7bdc8a87673d dummy change
28686
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   293
  |
35056
235d58aa723e tests: conditionally display obsfate in test-rebase-obsolete log output
Denis Laxalde <denis@laxalde.org>
parents: 35055
diff changeset
   294
  x  20:8b31da3c4919 dummy change (rewritten as 18:601db7a18f51)
28686
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   295
  |
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   296
  o  19:b82fb57ea638 willconflict second version
28686
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   297
  |
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   298
  | o  18:601db7a18f51 dummy change successor
28686
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   299
  | |
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   300
  | o  17:357ddf1602d5 willconflict first version
28686
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   301
  |/
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   302
  o  16:61bd55f69bc4 bar foo
28686
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   303
  |
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   304
  ~
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   305
  $ hg rebase -r ".^^ + .^ + ." -d 18
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   306
  rebasing 19:b82fb57ea638 "willconflict second version"
28686
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   307
  merging willconflict
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   308
  warning: conflicts while merging willconflict! (edit, then use 'hg resolve --mark')
45150
dc5e5577af39 error: unify the error message formats for 'rebase' and 'unshelve'
Daniel Ploch <dploch@google.com>
parents: 44347
diff changeset
   309
  unresolved conflicts (see 'hg resolve', then 'hg rebase --continue')
45826
21733e8c924f errors: add config that lets user get more detailed exit codes
Martin von Zweigbergk <martinvonz@google.com>
parents: 45796
diff changeset
   310
  [240]
28686
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   311
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   312
  $ hg resolve --mark willconflict
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   313
  (no more unresolved files)
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   314
  continue: hg rebase --continue
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   315
  $ hg rebase --continue
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   316
  rebasing 19:b82fb57ea638 "willconflict second version"
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   317
  note: not rebasing 20:8b31da3c4919 "dummy change", already in destination as 18:601db7a18f51 "dummy change successor"
45771
f90a5c211251 rebase: change and standarize template for rebase's one-line summary
Martin von Zweigbergk <martinvonz@google.com>
parents: 45765
diff changeset
   318
  rebasing 21:7bdc8a87673d tip "dummy change"
29063
8ede973597fd rebase: handle successor targets (issue5198)
timeless <timeless@mozdev.org>
parents: 28686
diff changeset
   319
  $ cd ..
46863
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   320
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   321
Can rebase pruned and rewritten commits with --keep
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   322
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   323
  $ hg init keep
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   324
  $ cd keep
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   325
  $ hg debugdrawdag <<'EOS'
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   326
  >   D
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   327
  >   |
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   328
  >   C
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   329
  >   |
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   330
  > F B E  # prune: B
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   331
  >  \|/   # rebase: C -> E
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   332
  >   A
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   333
  > EOS
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   334
  1 new orphan changesets
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   335
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   336
  $ hg rebase -b D -d F --keep
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   337
  rebasing 1:112478962961 B "B"
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   338
  rebasing 4:26805aba1e60 C "C"
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   339
  rebasing 5:f585351a92f8 D tip "D"
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   340
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   341
  $ cd ..