tests/test-rebase-obsolete2.t
author Gregory Szorc <gregory.szorc@gmail.com>
Tue, 08 Mar 2022 19:09:35 -0800
changeset 48958 b8eb29ab3906
parent 48687 f8f2ecdde4b5
permissions -rw-r--r--
hgdemandimport: delete check for Python 3.5 We dropped support for Python 3.5. So we no longer need to do this. Differential Revision: https://phab.mercurial-scm.org/D12362
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
48687
f8f2ecdde4b5 branchmap: skip obsolete revisions while computing heads
Anton Shestakov <av6@dwimlabs.net>
parents: 46863
diff changeset
    50
  created new head
35057
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    51
  $ 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
    52
  @  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
    53
  |
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    54
  | 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
    55
  | |
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    56
  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
    57
  |/
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    58
  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
    59
  
26675
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    60
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    61
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
    62
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    63
  $ 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
    64
  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
    65
  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
    66
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    67
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
    68
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    69
  $ 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
    70
  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
    71
  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
    72
  (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
    73
  $ 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
    74
  $ 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
    75
  $ hg commit -m D
35709
1a09dad8b85a evolution: report new unstable changesets
Martin von Zweigbergk <martinvonz@google.com>
parents: 35611
diff changeset
    76
  1 new orphan changesets
48687
f8f2ecdde4b5 branchmap: skip obsolete revisions while computing heads
Anton Shestakov <av6@dwimlabs.net>
parents: 46863
diff changeset
    77
  created new head
26675
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    78
  $ 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
    79
  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
    80
  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
    81
  $ 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
    82
  @  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
    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  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
    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
  | 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
    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
  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
    89
  |/
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
    90
  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
    91
  
26675
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    92
b73eb98c0243 rebase: properly handle chains of markers with missing nodes
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 26349
diff changeset
    93
  $ 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
    94
  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
    95
  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
    96
  $ hg up 4
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
    97
  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
    98
  $ echo "O" > O
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
    99
  $ hg add O
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   100
  $ hg commit -m O
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   101
  $ echo "P" > P
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   102
  $ hg add P
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   103
  $ hg commit -m P
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   104
  $ hg log -G
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   105
  @  8:8d47583e023f P
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  7:360bbaa7d3ce O
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  6:9c48361117de D
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 |  4:ff2c4d47b71d C
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  2:261e70097290 B2
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   114
  |
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   115
  o  0:4a2df7238c3b A
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   116
  
34865
a0100f34e20b config: replace experimental.stabilization by experimental.evolution
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
   117
  $ 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
   118
  1 new obsolescence markers
33542
b11e8c67fb0f debugobsolete: also report the number of obsoleted changesets
Boris Feld <boris.feld@octobus.net>
parents: 33332
diff changeset
   119
  obsoleted 1 changesets
35709
1a09dad8b85a evolution: report new unstable changesets
Martin von Zweigbergk <martinvonz@google.com>
parents: 35611
diff changeset
   120
  1 new orphan changesets
27012
5eac7ab59b95 rebase: don't rebase obsolete commits with no successor
Laurent Charignon <lcharignon@fb.com>
parents: 27011
diff changeset
   121
  $ 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
   122
  rebasing 4:ff2c4d47b71d "C"
33842
30573b3d2ebc rebase: move obsoleted not rebased messages earlier (BC)
Jun Wu <quark@fb.com>
parents: 33789
diff changeset
   123
  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
   124
  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
   125
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   126
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
   127
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
   128
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   129
  $ hg log -G
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   130
  @  10:121d9e3bc4c6 P
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  9:4be60e099a77 C
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  6:9c48361117de D
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  2:261e70097290 B2
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
  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
   139
  
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   140
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   141
  $ hg up 9
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   142
  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
   143
  $ 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
   144
  $ hg add nonrelevant
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   145
  $ 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
   146
  created new head
34865
a0100f34e20b config: replace experimental.stabilization by experimental.evolution
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
   147
  $ 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
   148
  1 new obsolescence markers
33542
b11e8c67fb0f debugobsolete: also report the number of obsoleted changesets
Boris Feld <boris.feld@octobus.net>
parents: 33332
diff changeset
   149
  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
   150
  $ 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
   151
  @  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
   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  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
   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  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
   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  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
   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  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
   160
  |
0564e7c7f4cd tests: add a couple of 'hg log' calls in test-rebase-obsolete.t
Denis Laxalde <denis@laxalde.org>
parents: 35056
diff changeset
   161
  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
   162
  
27577
f9e755736b0e rebase: better error message when rebased changes are all in destination
Laurent Charignon <lcharignon@fb.com>
parents: 27147
diff changeset
   163
  $ 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
   164
  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
   165
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   166
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
   167
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   168
  $ hg log -G
34008
9422107a6b64 rebase: move working parent and bookmark for obsoleted revs (BC)
Jun Wu <quark@fb.com>
parents: 33863
diff changeset
   169
  @  10:121d9e3bc4c6 P
27746
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  9:4be60e099a77 C
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  6:9c48361117de D
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  2:261e70097290 B2
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
  o  0:4a2df7238c3b A
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   178
  
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   179
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   180
  $ hg up 9
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   181
  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
   182
  $ echo "john" > doe
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   183
  $ hg add doe
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   184
  $ hg commit -m "john doe"
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   185
  created new head
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   186
  $ hg up 10
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   187
  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
   188
  $ echo "foo" > bar
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   189
  $ hg add bar
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   190
  $ hg commit --amend -m "10'"
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   191
  $ hg up 10 --hidden
37920
ea63a2004d09 update: print warning about hidden changeset after update
Martin von Zweigbergk <martinvonz@google.com>
parents: 37787
diff changeset
   192
  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
   193
  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
   194
  (hidden revision '121d9e3bc4c6' was rewritten as: 77d874d096a2)
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   195
  $ echo "bar" > foo
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   196
  $ hg add foo
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   197
  $ hg commit -m "bar foo"
35709
1a09dad8b85a evolution: report new unstable changesets
Martin von Zweigbergk <martinvonz@google.com>
parents: 35611
diff changeset
   198
  1 new orphan changesets
48687
f8f2ecdde4b5 branchmap: skip obsolete revisions while computing heads
Anton Shestakov <av6@dwimlabs.net>
parents: 46863
diff changeset
   199
  created new head
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   200
  $ hg log -G
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   201
  @  14:73568ab6879d bar foo
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   202
  |
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   203
  | o  13:77d874d096a2 10'
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   204
  | |
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   205
  | | o  12:3eb461388009 john doe
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   206
  | |/
35056
235d58aa723e tests: conditionally display obsfate in test-rebase-obsolete log output
Denis Laxalde <denis@laxalde.org>
parents: 35055
diff changeset
   207
  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
   208
  |/
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   209
  o  9:4be60e099a77 C
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   210
  |
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   211
  o  6:9c48361117de D
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   212
  |
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   213
  o  2:261e70097290 B2
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   214
  |
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   215
  o  0:4a2df7238c3b A
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   216
  
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   217
  $ hg summary
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   218
  parent: 14:73568ab6879d tip (orphan)
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   219
   bar foo
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   220
  branch: default
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   221
  commit: (clean)
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   222
  update: 2 new changesets, 3 branch heads (merge)
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   223
  phases: 8 draft
33667
03039ff3082b evolution: rename unstable to orphan
Boris Feld <boris.feld@octobus.net>
parents: 33542
diff changeset
   224
  orphan: 1 changesets
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   225
  $ 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
   226
  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
   227
  (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
   228
  [20]
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   229
  $ hg log -G
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   230
  @  14:73568ab6879d bar foo
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   231
  |
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   232
  | o  13:77d874d096a2 10'
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   233
  | |
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   234
  | | o  12:3eb461388009 john doe
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   235
  | |/
35056
235d58aa723e tests: conditionally display obsfate in test-rebase-obsolete log output
Denis Laxalde <denis@laxalde.org>
parents: 35055
diff changeset
   236
  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
   237
  |/
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   238
  o  9:4be60e099a77 C
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   239
  |
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   240
  o  6:9c48361117de D
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   241
  |
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   242
  o  2:261e70097290 B2
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   243
  |
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   244
  o  0:4a2df7238c3b A
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   245
  
34872
29f52e7966dd config: gather allowdivergence under the evolution namespace
Boris Feld <boris.feld@octobus.net>
parents: 34870
diff changeset
   246
With experimental.evolution.allowdivergence=True, rebase can create divergence
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   247
34872
29f52e7966dd config: gather allowdivergence under the evolution namespace
Boris Feld <boris.feld@octobus.net>
parents: 34870
diff changeset
   248
  $ 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
   249
  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
   250
  rebasing 14:73568ab6879d tip "bar foo"
35709
1a09dad8b85a evolution: report new unstable changesets
Martin von Zweigbergk <martinvonz@google.com>
parents: 35611
diff changeset
   251
  2 new content-divergent changesets
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   252
  $ hg summary
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   253
  parent: 16:61bd55f69bc4 tip
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   254
   bar foo
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   255
  branch: default
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   256
  commit: (clean)
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   257
  update: 1 new changesets, 2 branch heads (merge)
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   258
  phases: 8 draft
33688
2194a8723138 evolution: rename divergent to content-divergent
Boris Feld <boris.feld@octobus.net>
parents: 33678
diff changeset
   259
  content-divergent: 2 changesets
27746
f0e9f38d250f rebase: prevent creating divergence
Laurent Charignon <lcharignon@fb.com>
parents: 27577
diff changeset
   260
28686
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   261
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
   262
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
   263
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   264
  $ hg log -G -r 16::
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   265
  @  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
   266
  |
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   267
  ~
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   268
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   269
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
   270
  $ printf "a" > willconflict
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   271
  $ hg add willconflict
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   272
  $ 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
   273
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   274
  $ printf "dummy" > C
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   275
  $ 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
   276
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   277
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
   278
  $ 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
   279
  $ printf "b" > willconflict
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   280
  $ hg add willconflict
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   281
  $ 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
   282
  created new head
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   283
  $ printf "dummy" > K
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   284
  $ hg add K
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"
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   286
  $ printf "dummy" > L
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   287
  $ hg add L
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   288
  $ hg commit -m "dummy change"
34865
a0100f34e20b config: replace experimental.stabilization by experimental.evolution
Boris Feld <boris.feld@octobus.net>
parents: 34661
diff changeset
   289
  $ 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
   290
  1 new obsolescence markers
33542
b11e8c67fb0f debugobsolete: also report the number of obsoleted changesets
Boris Feld <boris.feld@octobus.net>
parents: 33332
diff changeset
   291
  obsoleted 1 changesets
35709
1a09dad8b85a evolution: report new unstable changesets
Martin von Zweigbergk <martinvonz@google.com>
parents: 35611
diff changeset
   292
  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
   293
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   294
  $ hg log -G -r 16::
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   295
  @  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
   296
  |
35056
235d58aa723e tests: conditionally display obsfate in test-rebase-obsolete log output
Denis Laxalde <denis@laxalde.org>
parents: 35055
diff changeset
   297
  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
   298
  |
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   299
  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
   300
  |
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   301
  | 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
   302
  | |
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   303
  | 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
   304
  |/
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   305
  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
   306
  |
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   307
  ~
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   308
  $ hg rebase -r ".^^ + .^ + ." -d 18
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   309
  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
   310
  merging willconflict
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   311
  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
   312
  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
   313
  [240]
28686
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   314
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   315
  $ hg resolve --mark willconflict
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   316
  (no more unresolved files)
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   317
  continue: hg rebase --continue
b212e01fead0 rebase: fix crash when rebase aborts while rebasing obsolete revisions
Laurent Charignon <lcharignon@fb.com>
parents: 28429
diff changeset
   318
  $ hg rebase --continue
34085
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   319
  rebasing 19:b82fb57ea638 "willconflict second version"
e8a7c1a0565a cmdutil: remove the redundant commit during amend
Saurabh Singh <singhsrb@fb.com>
parents: 34009
diff changeset
   320
  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
   321
  rebasing 21:7bdc8a87673d tip "dummy change"
29063
8ede973597fd rebase: handle successor targets (issue5198)
timeless <timeless@mozdev.org>
parents: 28686
diff changeset
   322
  $ 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
   323
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   324
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
   325
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   326
  $ 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
   327
  $ 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
   328
  $ 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
   329
  >   D
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   330
  >   |
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   331
  >   C
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   332
  >   |
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   333
  > 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
   334
  >  \|/   # 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
   335
  >   A
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   336
  > EOS
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   337
  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
   338
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   339
  $ 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
   340
  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
   341
  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
   342
  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
   343
d9601243b73c rebase: when using --keep, don't care about pruned commits or divergence
Martin von Zweigbergk <martinvonz@google.com>
parents: 46829
diff changeset
   344
  $ cd ..