tests/test-rebase-abort.t
author Gregory Szorc <gregory.szorc@gmail.com>
Mon, 13 Nov 2017 20:03:02 -0800
changeset 35114 db5038525718
parent 34290 4f969b9e0cf5
child 35393 4441705b7111
permissions -rw-r--r--
bundle2: implement consume() API on unbundlepart We want bundle parts to not be seekable by default. That means eliminating the generic seek() method. A common pattern in bundle2.py is to seek to the end of the part data. This is mainly used by the part iteration code to ensure the underlying stream is advanced to the next bundle part. In this commit, we establish a dedicated API for consuming a bundle2 part data. We switch users of seek() to it. The old implementation of seek(0, os.SEEK_END) would effectively call self.read(). The new implementation calls self.read(32768) in a loop. The old implementation would therefore assemble a buffer to hold all remaining data being seeked over. For seeking over large bundle parts, this would involve a large allocation and a lot of overhead to collect intermediate data! This overhead can be seen in the results for `hg perfbundleread`: ! bundle2 iterparts() ! wall 10.891305 comb 10.820000 user 7.990000 sys 2.830000 (best of 3) ! wall 8.070791 comb 8.060000 user 7.180000 sys 0.880000 (best of 3) ! bundle2 part seek() ! wall 12.991478 comb 10.390000 user 7.720000 sys 2.670000 (best of 3) ! wall 10.370142 comb 10.350000 user 7.430000 sys 2.920000 (best of 3) Of course, skipping over large payload data isn't likely very common. So I doubt the performance wins will be observed in the wild. Differential Revision: https://phab.mercurial-scm.org/D1388
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
     1
  $ cat >> $HGRCPATH <<EOF
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
     2
  > [extensions]
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
     3
  > rebase=
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
     4
  > 
15742
65df60a3f96b phases: prevent rebase to rebase immutable changeset.
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 15501
diff changeset
     5
  > [phases]
65df60a3f96b phases: prevent rebase to rebase immutable changeset.
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 15501
diff changeset
     6
  > publish=False
65df60a3f96b phases: prevent rebase to rebase immutable changeset.
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 15501
diff changeset
     7
  > 
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
     8
  > [alias]
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
     9
  > tglog = log -G --template "{rev}:{phase} '{desc}' {branches}\n"
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    10
  > EOF
11198
b345b1cc124f rebase: use helpers.sh in tests
Matt Mackall <mpm@selenic.com>
parents: 8168
diff changeset
    11
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    12
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    13
  $ hg init a
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    14
  $ cd a
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    15
20327
46c2331fc750 rebase: abort cleanly when we encounter a damaged rebasestate (issue4155)
Matt Mackall <mpm@selenic.com>
parents: 20313
diff changeset
    16
  $ touch .hg/rebasestate
46c2331fc750 rebase: abort cleanly when we encounter a damaged rebasestate (issue4155)
Matt Mackall <mpm@selenic.com>
parents: 20313
diff changeset
    17
  $ hg sum
46c2331fc750 rebase: abort cleanly when we encounter a damaged rebasestate (issue4155)
Matt Mackall <mpm@selenic.com>
parents: 20313
diff changeset
    18
  parent: -1:000000000000 tip (empty repository)
46c2331fc750 rebase: abort cleanly when we encounter a damaged rebasestate (issue4155)
Matt Mackall <mpm@selenic.com>
parents: 20313
diff changeset
    19
  branch: default
46c2331fc750 rebase: abort cleanly when we encounter a damaged rebasestate (issue4155)
Matt Mackall <mpm@selenic.com>
parents: 20313
diff changeset
    20
  commit: (clean)
46c2331fc750 rebase: abort cleanly when we encounter a damaged rebasestate (issue4155)
Matt Mackall <mpm@selenic.com>
parents: 20313
diff changeset
    21
  update: (current)
46c2331fc750 rebase: abort cleanly when we encounter a damaged rebasestate (issue4155)
Matt Mackall <mpm@selenic.com>
parents: 20313
diff changeset
    22
  abort: .hg/rebasestate is incomplete
46c2331fc750 rebase: abort cleanly when we encounter a damaged rebasestate (issue4155)
Matt Mackall <mpm@selenic.com>
parents: 20313
diff changeset
    23
  [255]
46c2331fc750 rebase: abort cleanly when we encounter a damaged rebasestate (issue4155)
Matt Mackall <mpm@selenic.com>
parents: 20313
diff changeset
    24
  $ rm .hg/rebasestate
46c2331fc750 rebase: abort cleanly when we encounter a damaged rebasestate (issue4155)
Matt Mackall <mpm@selenic.com>
parents: 20313
diff changeset
    25
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    26
  $ echo c1 > common
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    27
  $ hg add common
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    28
  $ hg ci -m C1
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    29
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    30
  $ echo c2 >> common
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    31
  $ hg ci -m C2
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    32
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    33
  $ echo c3 >> common
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    34
  $ hg ci -m C3
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    35
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    36
  $ hg up -q -C 1
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    37
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    38
  $ echo l1 >> extra
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    39
  $ hg add extra
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    40
  $ hg ci -m L1
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    41
  created new head
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    42
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    43
  $ sed -e 's/c2/l2/' common > common.new
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    44
  $ mv common.new common
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    45
  $ hg ci -m L2
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    46
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
    47
  $ hg phase --force --secret 2
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
    48
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    49
  $ hg tglog
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
    50
  @  4:draft 'L2'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    51
  |
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
    52
  o  3:draft 'L1'
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
    53
  |
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
    54
  | o  2:secret 'C3'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    55
  |/
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
    56
  o  1:draft 'C2'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    57
  |
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
    58
  o  0:draft 'C1'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    59
  
11316
7fa3968004c1 rebase: --abort doesn't strip away the target changeset (issue2220)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 11208
diff changeset
    60
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    61
Conflicting rebase:
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    62
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    63
  $ hg rebase -s 3 -d 2
23517
4f18e80d9c30 rebase: show more useful status information while rebasing
Mads Kiilerich <madski@unity3d.com>
parents: 23516
diff changeset
    64
  rebasing 3:3163e20567cc "L1"
4f18e80d9c30 rebase: show more useful status information while rebasing
Mads Kiilerich <madski@unity3d.com>
parents: 23516
diff changeset
    65
  rebasing 4:46f0b057b5c0 "L2" (tip)
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    66
  merging common
26614
ef1eb6df7071 simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents: 25382
diff changeset
    67
  warning: conflicts while merging common! (edit, then use 'hg resolve --mark')
18933
42b620fc89e2 rebase: switch from util.Abort to util.InterventionRequired where appropriate (bc)
Augie Fackler <raf@durin42.com>
parents: 17477
diff changeset
    68
  unresolved conflicts (see hg resolve, then hg rebase --continue)
18935
e5d9441ec281 dispatch: exit with status 1 for an InterventionRequired exception (bc)
Augie Fackler <raf@durin42.com>
parents: 18933
diff changeset
    69
  [1]
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
    70
27027
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    71
Insert unsupported advisory merge record:
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    72
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    73
  $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -x
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    74
  $ hg debugmergestate
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    75
  * version 2 records
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    76
  local: 3e046f2ecedb793b97ed32108086edd1a162f8bc
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    77
  other: 46f0b057b5c061d276b91491c22151f78698abd2
28634
3ceac01bc29f merge: save merge part labels for later reuse
Simon Farnsworth <simonfar@fb.com>
parents: 28015
diff changeset
    78
  labels:
3ceac01bc29f merge: save merge part labels for later reuse
Simon Farnsworth <simonfar@fb.com>
parents: 28015
diff changeset
    79
    local: dest
3ceac01bc29f merge: save merge part labels for later reuse
Simon Farnsworth <simonfar@fb.com>
parents: 28015
diff changeset
    80
    other: source
27027
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    81
  unrecognized entry: x	advisory record
28011
8abd9f785030 merge: add file ancestor linknode to mergestate
Durham Goode <durham@fb.com>
parents: 28003
diff changeset
    82
  file extras: common (ancestorlinknode = 3163e20567cc93074fbb7a53c8b93312e59dbf2c)
27027
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    83
  file: common (record type "F", state "u", hash 94c8c21d08740f5da9eaa38d1f175c592692f0d1)
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    84
    local path: common (flags "")
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    85
    ancestor path: common (node de0a666fdd9c1a0b0698b90d85064d8bd34f74b6)
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    86
    other path: common (node 2f6411de53677f6f1048fef5bf888d67a342e0a5)
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    87
  $ hg resolve -l
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    88
  U common
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    89
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    90
Insert unsupported mandatory merge record:
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    91
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    92
  $ hg --config extensions.fakemergerecord=$TESTDIR/fakemergerecord.py fakemergerecord -X
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    93
  $ hg debugmergestate
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    94
  * version 2 records
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    95
  local: 3e046f2ecedb793b97ed32108086edd1a162f8bc
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
    96
  other: 46f0b057b5c061d276b91491c22151f78698abd2
28634
3ceac01bc29f merge: save merge part labels for later reuse
Simon Farnsworth <simonfar@fb.com>
parents: 28015
diff changeset
    97
  labels:
3ceac01bc29f merge: save merge part labels for later reuse
Simon Farnsworth <simonfar@fb.com>
parents: 28015
diff changeset
    98
    local: dest
3ceac01bc29f merge: save merge part labels for later reuse
Simon Farnsworth <simonfar@fb.com>
parents: 28015
diff changeset
    99
    other: source
28011
8abd9f785030 merge: add file ancestor linknode to mergestate
Durham Goode <durham@fb.com>
parents: 28003
diff changeset
   100
  file extras: common (ancestorlinknode = 3163e20567cc93074fbb7a53c8b93312e59dbf2c)
27027
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
   101
  file: common (record type "F", state "u", hash 94c8c21d08740f5da9eaa38d1f175c592692f0d1)
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
   102
    local path: common (flags "")
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
   103
    ancestor path: common (node de0a666fdd9c1a0b0698b90d85064d8bd34f74b6)
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
   104
    other path: common (node 2f6411de53677f6f1048fef5bf888d67a342e0a5)
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
   105
  unrecognized entry: X	mandatory record
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
   106
  $ hg resolve -l
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
   107
  abort: unsupported merge state records: X
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
   108
  (see https://mercurial-scm.org/wiki/MergeStateRecords for more information)
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
   109
  [255]
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
   110
  $ hg resolve -ma
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
   111
  abort: unsupported merge state records: X
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
   112
  (see https://mercurial-scm.org/wiki/MergeStateRecords for more information)
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
   113
  [255]
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
   114
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
   115
Abort (should clear out unsupported merge state):
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   116
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   117
  $ hg rebase --abort
23835
aa4a1672583e bundles: do not overwrite existing backup bundles (BC)
Durham Goode <durham@fb.com>
parents: 23518
diff changeset
   118
  saved backup bundle to $TESTTMP/a/.hg/strip-backup/3e046f2ecedb-6beef7d5-backup.hg (glob)
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   119
  rebase aborted
27027
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
   120
  $ hg debugmergestate
a01ecbcfaf84 mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents: 26677
diff changeset
   121
  no merge state found
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   122
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   123
  $ hg tglog
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   124
  @  4:draft 'L2'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   125
  |
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   126
  o  3:draft 'L1'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   127
  |
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   128
  | o  2:secret 'C3'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   129
  |/
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   130
  o  1:draft 'C2'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   131
  |
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   132
  o  0:draft 'C1'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   133
  
19848
577f4c562d52 rebase: catch RepoLookupError at restoring rebase state for abort/continue
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18935
diff changeset
   134
Test safety for inconsistent rebase state, which may be created (and
577f4c562d52 rebase: catch RepoLookupError at restoring rebase state for abort/continue
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18935
diff changeset
   135
forgotten) by Mercurial earlier than 2.7. This emulates Mercurial
577f4c562d52 rebase: catch RepoLookupError at restoring rebase state for abort/continue
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18935
diff changeset
   136
earlier than 2.7 by renaming ".hg/rebasestate" temporarily.
577f4c562d52 rebase: catch RepoLookupError at restoring rebase state for abort/continue
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18935
diff changeset
   137
577f4c562d52 rebase: catch RepoLookupError at restoring rebase state for abort/continue
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18935
diff changeset
   138
  $ hg rebase -s 3 -d 2
23517
4f18e80d9c30 rebase: show more useful status information while rebasing
Mads Kiilerich <madski@unity3d.com>
parents: 23516
diff changeset
   139
  rebasing 3:3163e20567cc "L1"
4f18e80d9c30 rebase: show more useful status information while rebasing
Mads Kiilerich <madski@unity3d.com>
parents: 23516
diff changeset
   140
  rebasing 4:46f0b057b5c0 "L2" (tip)
19848
577f4c562d52 rebase: catch RepoLookupError at restoring rebase state for abort/continue
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18935
diff changeset
   141
  merging common
26614
ef1eb6df7071 simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents: 25382
diff changeset
   142
  warning: conflicts while merging common! (edit, then use 'hg resolve --mark')
19848
577f4c562d52 rebase: catch RepoLookupError at restoring rebase state for abort/continue
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18935
diff changeset
   143
  unresolved conflicts (see hg resolve, then hg rebase --continue)
577f4c562d52 rebase: catch RepoLookupError at restoring rebase state for abort/continue
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18935
diff changeset
   144
  [1]
577f4c562d52 rebase: catch RepoLookupError at restoring rebase state for abort/continue
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18935
diff changeset
   145
577f4c562d52 rebase: catch RepoLookupError at restoring rebase state for abort/continue
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18935
diff changeset
   146
  $ mv .hg/rebasestate .hg/rebasestate.back
577f4c562d52 rebase: catch RepoLookupError at restoring rebase state for abort/continue
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18935
diff changeset
   147
  $ hg update --quiet --clean 2
577f4c562d52 rebase: catch RepoLookupError at restoring rebase state for abort/continue
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18935
diff changeset
   148
  $ hg --config extensions.mq= strip --quiet "destination()"
577f4c562d52 rebase: catch RepoLookupError at restoring rebase state for abort/continue
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18935
diff changeset
   149
  $ mv .hg/rebasestate.back .hg/rebasestate
577f4c562d52 rebase: catch RepoLookupError at restoring rebase state for abort/continue
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18935
diff changeset
   150
577f4c562d52 rebase: catch RepoLookupError at restoring rebase state for abort/continue
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18935
diff changeset
   151
  $ hg rebase --continue
577f4c562d52 rebase: catch RepoLookupError at restoring rebase state for abort/continue
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18935
diff changeset
   152
  abort: cannot continue inconsistent rebase
20313
dcd65ce87260 hgext: fix one typo in rebase
Simon Heimberg <simohe@besonet.ch>
parents: 20117
diff changeset
   153
  (use "hg rebase --abort" to clear broken state)
19848
577f4c562d52 rebase: catch RepoLookupError at restoring rebase state for abort/continue
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18935
diff changeset
   154
  [255]
19849
e7fa36d2ad3a rebase: catch RepoLookupError at restoring rebase state for summary
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19848
diff changeset
   155
  $ hg summary | grep '^rebase: '
e7fa36d2ad3a rebase: catch RepoLookupError at restoring rebase state for summary
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19848
diff changeset
   156
  rebase: (use "hg rebase --abort" to clear broken state)
19848
577f4c562d52 rebase: catch RepoLookupError at restoring rebase state for abort/continue
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18935
diff changeset
   157
  $ hg rebase --abort
577f4c562d52 rebase: catch RepoLookupError at restoring rebase state for abort/continue
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18935
diff changeset
   158
  rebase aborted (no revision is removed, only broken state is cleared)
577f4c562d52 rebase: catch RepoLookupError at restoring rebase state for abort/continue
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 18935
diff changeset
   159
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   160
  $ cd ..
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   161
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   162
17477
b1dfca74e3d0 spelling: Construct
timeless@mozdev.org
parents: 16913
diff changeset
   163
Construct new repo:
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   164
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   165
  $ hg init b
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   166
  $ cd b
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   167
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   168
  $ echo a > a
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   169
  $ hg ci -Am A
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   170
  adding a
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   171
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   172
  $ echo b > b
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   173
  $ hg ci -Am B
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   174
  adding b
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   175
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   176
  $ echo c > c
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   177
  $ hg ci -Am C
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   178
  adding c
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   179
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   180
  $ hg up -q 0
11316
7fa3968004c1 rebase: --abort doesn't strip away the target changeset (issue2220)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 11208
diff changeset
   181
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   182
  $ echo b > b
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   183
  $ hg ci -Am 'B bis'
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   184
  adding b
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   185
  created new head
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   186
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   187
  $ echo c1 > c
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   188
  $ hg ci -Am C1
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   189
  adding c
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   190
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   191
  $ hg phase --force --secret 1
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   192
  $ hg phase --public 1
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   193
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   194
Rebase and abort without generating new changesets:
6906
808f03f61ebe Add rebase extension
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   195
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   196
  $ hg tglog
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   197
  @  4:draft 'C1'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   198
  |
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   199
  o  3:draft 'B bis'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   200
  |
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   201
  | o  2:secret 'C'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   202
  | |
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   203
  | o  1:public 'B'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   204
  |/
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   205
  o  0:public 'A'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   206
  
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   207
  $ hg rebase -b 4 -d 2
23517
4f18e80d9c30 rebase: show more useful status information while rebasing
Mads Kiilerich <madski@unity3d.com>
parents: 23516
diff changeset
   208
  rebasing 3:a6484957d6b9 "B bis"
23518
2fb0504b8175 rebase: show warning when rebase creates no changes to commit
Mads Kiilerich <madski@unity3d.com>
parents: 23517
diff changeset
   209
  note: rebase of 3:a6484957d6b9 created no changes to commit
23517
4f18e80d9c30 rebase: show more useful status information while rebasing
Mads Kiilerich <madski@unity3d.com>
parents: 23516
diff changeset
   210
  rebasing 4:145842775fec "C1" (tip)
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   211
  merging c
26614
ef1eb6df7071 simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents: 25382
diff changeset
   212
  warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
18933
42b620fc89e2 rebase: switch from util.Abort to util.InterventionRequired where appropriate (bc)
Augie Fackler <raf@durin42.com>
parents: 17477
diff changeset
   213
  unresolved conflicts (see hg resolve, then hg rebase --continue)
18935
e5d9441ec281 dispatch: exit with status 1 for an InterventionRequired exception (bc)
Augie Fackler <raf@durin42.com>
parents: 18933
diff changeset
   214
  [1]
11316
7fa3968004c1 rebase: --abort doesn't strip away the target changeset (issue2220)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 11208
diff changeset
   215
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   216
  $ hg tglog
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   217
  @  4:draft 'C1'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   218
  |
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   219
  o  3:draft 'B bis'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   220
  |
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   221
  | @  2:secret 'C'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   222
  | |
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   223
  | o  1:public 'B'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   224
  |/
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   225
  o  0:public 'A'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   226
  
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   227
  $ hg rebase -a
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   228
  rebase aborted
11316
7fa3968004c1 rebase: --abort doesn't strip away the target changeset (issue2220)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 11208
diff changeset
   229
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   230
  $ hg tglog
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   231
  @  4:draft 'C1'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   232
  |
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   233
  o  3:draft 'B bis'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   234
  |
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   235
  | o  2:secret 'C'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   236
  | |
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   237
  | o  1:public 'B'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   238
  |/
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   239
  o  0:public 'A'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11316
diff changeset
   240
  
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15917
diff changeset
   241
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15917
diff changeset
   242
  $ cd ..
19984
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   243
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   244
rebase abort should not leave working copy in a merge state if tip-1 is public
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   245
(issue4082)
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   246
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   247
  $ hg init abortpublic
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   248
  $ cd abortpublic
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   249
  $ echo a > a && hg ci -Aqm a
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   250
  $ hg book master
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   251
  $ hg book foo
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   252
  $ echo b > b && hg ci -Aqm b
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   253
  $ hg up -q master
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   254
  $ echo c > c && hg ci -Aqm c
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   255
  $ hg phase -p -r .
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   256
  $ hg up -q foo
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   257
  $ echo C > c && hg ci -Aqm C
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   258
  $ hg log -G --template "{rev} {desc} {bookmarks}"
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   259
  @  3 C foo
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   260
  |
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   261
  | o  2 c master
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   262
  | |
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   263
  o |  1 b
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   264
  |/
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   265
  o  0 a
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   266
  
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   267
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   268
  $ hg rebase -d master -r foo
34290
4f969b9e0cf5 rebase: also include other namespaces in changeset description
Martin von Zweigbergk <martinvonz@google.com>
parents: 33121
diff changeset
   269
  rebasing 3:6c0f977a22d8 "C" (foo tip)
19984
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   270
  merging c
26614
ef1eb6df7071 simplemerge: move conflict warning message to filemerge
Siddharth Agarwal <sid0@fb.com>
parents: 25382
diff changeset
   271
  warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
19984
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   272
  unresolved conflicts (see hg resolve, then hg rebase --continue)
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   273
  [1]
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   274
  $ hg rebase --abort
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   275
  rebase aborted
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   276
  $ hg log -G --template "{rev} {desc} {bookmarks}"
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   277
  @  3 C foo
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   278
  |
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   279
  | o  2 c master
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   280
  | |
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   281
  o |  1 b
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   282
  |/
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   283
  o  0 a
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   284
  
7d5e7799a29f rebase: fix rebase aborts when 'tip-1' is public (issue4082)
Durham Goode <durham@fb.com>
parents: 19849
diff changeset
   285
  $ cd ..
25069
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   286
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   287
Make sure we don't clobber changes in the working directory when the
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   288
user has somehow managed to update to a different revision (issue4009)
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   289
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   290
  $ hg init noupdate
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   291
  $ cd noupdate
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   292
  $ hg book @
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   293
  $ echo original > a
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   294
  $ hg add a
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   295
  $ hg commit -m a
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   296
  $ echo x > b
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   297
  $ hg add b
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   298
  $ hg commit -m b1
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   299
  $ hg up 0
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   300
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   301
  (leaving bookmark @)
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   302
  $ hg book foo
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   303
  $ echo y > b
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   304
  $ hg add b
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   305
  $ hg commit -m b2
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   306
  created new head
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   307
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   308
  $ hg rebase -d @ -b foo --tool=internal:fail
34290
4f969b9e0cf5 rebase: also include other namespaces in changeset description
Martin von Zweigbergk <martinvonz@google.com>
parents: 33121
diff changeset
   309
  rebasing 2:070cf4580bb5 "b2" (foo tip)
25069
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   310
  unresolved conflicts (see hg resolve, then hg rebase --continue)
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   311
  [1]
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   312
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   313
  $ mv .hg/rebasestate ./ # so we're allowed to hg up like in mercurial <2.6.3
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   314
  $ hg up -C 0            # user does other stuff in the repo
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   315
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   316
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   317
  $ mv rebasestate .hg/   # user upgrades to 2.7
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   318
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   319
  $ echo new > a
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   320
  $ hg up 1               # user gets an error saying to run hg rebase --abort
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   321
  abort: rebase in progress
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   322
  (use 'hg rebase --continue' or 'hg rebase --abort')
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   323
  [255]
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   324
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   325
  $ cat a
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   326
  new
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   327
  $ hg rebase --abort
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   328
  rebase aborted
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   329
  $ cat a
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   330
  new
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   331
01ad8daae5be test-rebase-abort: add test from issue4009
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 23835
diff changeset
   332
  $ cd ..
25070
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   333
27988
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   334
test aborting an interrupted series (issue5084)
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   335
  $ hg init interrupted
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   336
  $ cd interrupted
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   337
  $ touch base
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   338
  $ hg add base
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   339
  $ hg commit -m base
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   340
  $ touch a
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   341
  $ hg add a
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   342
  $ hg commit -m a
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   343
  $ echo 1 > a
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   344
  $ hg commit -m 1
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   345
  $ touch b
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   346
  $ hg add b
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   347
  $ hg commit -m b
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   348
  $ echo 2 >> a
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   349
  $ hg commit -m c
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   350
  $ touch d
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   351
  $ hg add d
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   352
  $ hg commit -m d
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   353
  $ hg co -q 1
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   354
  $ hg rm a
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   355
  $ hg commit -m no-a
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   356
  created new head
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   357
  $ hg co 0
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   358
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   359
  $ hg log -G --template "{rev} {desc} {bookmarks}"
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   360
  o  6 no-a
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   361
  |
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   362
  | o  5 d
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   363
  | |
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   364
  | o  4 c
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   365
  | |
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   366
  | o  3 b
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   367
  | |
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   368
  | o  2 1
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   369
  |/
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   370
  o  1 a
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   371
  |
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   372
  @  0 base
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   373
  
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   374
  $ hg --config extensions.n=$TESTDIR/failfilemerge.py rebase -s 3 -d tip
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   375
  rebasing 3:3a71550954f1 "b"
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   376
  rebasing 4:e80b69427d80 "c"
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   377
  abort: ^C
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   378
  [255]
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   379
  $ hg rebase --abort
33121
a5abaa81fad6 rebase: backed out changeset cf8ad0e6c0e4 (issue5610)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 31226
diff changeset
   380
  saved backup bundle to $TESTTMP/interrupted/.hg/strip-backup/3d8812cf300d-93041a90-backup.hg (glob)
27988
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   381
  rebase aborted
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   382
  $ hg log -G --template "{rev} {desc} {bookmarks}"
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   383
  o  6 no-a
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   384
  |
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   385
  | o  5 d
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   386
  | |
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   387
  | o  4 c
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   388
  | |
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   389
  | o  3 b
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   390
  | |
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   391
  | o  2 1
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   392
  |/
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   393
  o  1 a
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   394
  |
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   395
  @  0 base
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   396
  
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   397
  $ hg summary
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   398
  parent: 0:df4f53cec30a 
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   399
   base
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   400
  branch: default
33121
a5abaa81fad6 rebase: backed out changeset cf8ad0e6c0e4 (issue5610)
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 31226
diff changeset
   401
  commit: (clean)
27988
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   402
  update: 6 new changesets (update)
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   403
  phases: 7 draft
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   404
61f4d59e9a0b rebase: update working directory when aborting (issue5084)
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   405
  $ cd ..
25070
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   406
On the other hand, make sure we *do* clobber changes whenever we
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   407
haven't somehow managed to update the repo to a different revision
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   408
during a rebase (issue4661)
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   409
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   410
  $ hg ini yesupdate
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   411
  $ cd yesupdate
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   412
  $ echo "initial data" > foo.txt
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   413
  $ hg add
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   414
  adding foo.txt
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   415
  $ hg ci -m "initial checkin"
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   416
  $ echo "change 1" > foo.txt
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   417
  $ hg ci -m "change 1"
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   418
  $ hg up 0
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   419
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   420
  $ echo "conflicting change 1" > foo.txt
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   421
  $ hg ci -m "conflicting 1"
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   422
  created new head
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   423
  $ echo "conflicting change 2" > foo.txt
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   424
  $ hg ci -m "conflicting 2"
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   425
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   426
  $ hg rebase -d 1 --tool 'internal:fail'
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   427
  rebasing 2:e4ea5cdc9789 "conflicting 1"
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   428
  unresolved conflicts (see hg resolve, then hg rebase --continue)
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   429
  [1]
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   430
  $ hg rebase --abort
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   431
  rebase aborted
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   432
  $ hg summary
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   433
  parent: 3:b16646383533 tip
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   434
   conflicting 2
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   435
  branch: default
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   436
  commit: (clean)
bd98d073a34f rebase: clear merge when aborting before any rebasing (issue4661)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 25069
diff changeset
   437
  update: 1 new changesets, 2 branch heads (merge)
25382
6084926366b9 summary: move the parents phase marker to commit line (issue4688)
Gilles Moris <gilles.moris@free.fr>
parents: 25111
diff changeset
   438
  phases: 4 draft
28003
a1d4ca0c8483 tests: fix rebase-abort directory nesting
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   439
  $ cd ..
26677
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   440
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   441
test aborting a rebase succeeds after rebasing with skipped commits onto a
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   442
public changeset (issue4896)
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   443
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   444
  $ hg init succeedonpublic
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   445
  $ cd succeedonpublic
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   446
  $ echo 'content' > root
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   447
  $ hg commit -A -m 'root' -q
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   448
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   449
set up public branch
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   450
  $ echo 'content' > disappear
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   451
  $ hg commit -A -m 'disappear public' -q
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   452
commit will cause merge conflict on rebase
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   453
  $ echo '' > root
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   454
  $ hg commit -m 'remove content public' -q
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   455
  $ hg phase --public
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   456
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   457
setup the draft branch that will be rebased onto public commit
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   458
  $ hg up -r 0 -q
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   459
  $ echo 'content' > disappear
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   460
commit will disappear
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   461
  $ hg commit -A -m 'disappear draft' -q
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   462
  $ echo 'addedcontADDEDentadded' > root
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   463
commit will cause merge conflict on rebase
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   464
  $ hg commit -m 'add content draft' -q
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   465
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   466
  $ hg rebase -d 'public()' --tool :merge -q
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   467
  note: rebase of 3:0682fd3dabf5 created no changes to commit
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   468
  warning: conflicts while merging root! (edit, then use 'hg resolve --mark')
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   469
  unresolved conflicts (see hg resolve, then hg rebase --continue)
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   470
  [1]
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   471
  $ hg rebase --abort
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   472
  rebase aborted
28003
a1d4ca0c8483 tests: fix rebase-abort directory nesting
timeless <timeless@mozdev.org>
parents: 27027
diff changeset
   473
  $ cd ..
26677
e9b3d523f2e6 rebase: properly abort when destination is public (issue4896)
Christian Delahousse <cdelahousse@fb.com>
parents: 26614
diff changeset
   474