tests/test-rebase-transaction.t
author Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
Tue, 02 Jul 2019 12:59:58 -0400
changeset 42621 99ebde4fec99
parent 42613 35ebdbb38efb
child 44347 9c9cfecd4600
permissions -rw-r--r--
commit: improve the files field of changelog for merges Currently, the files list of merge commits repeats all the deletions (either actual deletions, or files that got renamed) that happened between base and p2 of the merge. If p2 is the main branch, the list can easily be much bigger than the change being merged. This results in various problems worth improving: - changelog is bigger than necessary - `hg log directory` lists many unrelated merge commits, and `hg log -v -r commit` frequently fills multiple screens worth of files - it possibly slows down adjustlinkrev, by forcing it to read more manifests, and that function can certainly be a bottleneck - the server side of pulls can waste a lot of time simply opening the filelogs for pointless files (the constant factors for opening even a tiny filelog is apparently pretty bad) So stop listing such files as described in the code. Impacted merge commits and their descendants get a different hash than they would have without this. This doesn't seem problematic, except for convert. The previous commit helped with that in the hg->hg case (but if you do svn->hg twice from scratch, hashes can still change). The rest of the description is numbers. I don't have much to report, because recreating the files list of existing repositories is not easy: - debugupgradeformat and bundle/unbundle don't recreate the list - export/import tends to choke quickly applying patches or on description that contain diffs, - merge commits from the convert extension don't have the right files list for reasons orthogonal to the current commit - replaying the merge with hg update/hg merge/hg revert --all/hg commit can end up failing in hg revert - I wasn't sure that using debugsetparents + debugrebuilddirstate would really build the right thing I measured commit time before and after this change, in a case with no files filtered out, several files filtered out (no difference) and 5k files filtered out (+1% time). Recreating the 100 more recent merges in a private repo, the concatenated uncompressed files lists goes from 1.12MB to 0.52MB. Excluding 3 merges that are not representative, then the size goes from 570k to 15k. I converted part of mozilla-central, and observed file list shrinking quite a bit too, starting at the very first merge, 733641d9feaf, going from 550 files to 10 files (although they have relatively few merges, so they probably wouldn't care). Differential Revision: https://phab.mercurial-scm.org/D6613
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
42613
35ebdbb38efb continue: added support for rebase
Taapas Agrawal <taapas2897@gmail.com>
parents: 36927
diff changeset
     1
#testcases continuecommand continueflag
36815
f4e9e89330d4 tests: simplify test-rebase-transaction.t
Martin von Zweigbergk <martinvonz@google.com>
parents: 34504
diff changeset
     2
Rebasing using a single transaction
f4e9e89330d4 tests: simplify test-rebase-transaction.t
Martin von Zweigbergk <martinvonz@google.com>
parents: 34504
diff changeset
     3
30580
51e7c83e05ee rebase: calculate ancestors for --base separately (issue5420)
Jun Wu <quark@fb.com>
parents:
diff changeset
     4
  $ cat >> $HGRCPATH <<EOF
51e7c83e05ee rebase: calculate ancestors for --base separately (issue5420)
Jun Wu <quark@fb.com>
parents:
diff changeset
     5
  > [extensions]
51e7c83e05ee rebase: calculate ancestors for --base separately (issue5420)
Jun Wu <quark@fb.com>
parents:
diff changeset
     6
  > rebase=
51e7c83e05ee rebase: calculate ancestors for --base separately (issue5420)
Jun Wu <quark@fb.com>
parents:
diff changeset
     7
  > drawdag=$TESTDIR/drawdag.py
51e7c83e05ee rebase: calculate ancestors for --base separately (issue5420)
Jun Wu <quark@fb.com>
parents:
diff changeset
     8
  > 
36815
f4e9e89330d4 tests: simplify test-rebase-transaction.t
Martin von Zweigbergk <martinvonz@google.com>
parents: 34504
diff changeset
     9
  > [rebase]
f4e9e89330d4 tests: simplify test-rebase-transaction.t
Martin von Zweigbergk <martinvonz@google.com>
parents: 34504
diff changeset
    10
  > singletransaction=True
f4e9e89330d4 tests: simplify test-rebase-transaction.t
Martin von Zweigbergk <martinvonz@google.com>
parents: 34504
diff changeset
    11
  > 
30580
51e7c83e05ee rebase: calculate ancestors for --base separately (issue5420)
Jun Wu <quark@fb.com>
parents:
diff changeset
    12
  > [phases]
51e7c83e05ee rebase: calculate ancestors for --base separately (issue5420)
Jun Wu <quark@fb.com>
parents:
diff changeset
    13
  > publish=False
51e7c83e05ee rebase: calculate ancestors for --base separately (issue5420)
Jun Wu <quark@fb.com>
parents:
diff changeset
    14
  > 
51e7c83e05ee rebase: calculate ancestors for --base separately (issue5420)
Jun Wu <quark@fb.com>
parents:
diff changeset
    15
  > [alias]
51e7c83e05ee rebase: calculate ancestors for --base separately (issue5420)
Jun Wu <quark@fb.com>
parents:
diff changeset
    16
  > tglog = log -G --template "{rev}: {desc}"
51e7c83e05ee rebase: calculate ancestors for --base separately (issue5420)
Jun Wu <quark@fb.com>
parents:
diff changeset
    17
  > EOF
51e7c83e05ee rebase: calculate ancestors for --base separately (issue5420)
Jun Wu <quark@fb.com>
parents:
diff changeset
    18
42613
35ebdbb38efb continue: added support for rebase
Taapas Agrawal <taapas2897@gmail.com>
parents: 36927
diff changeset
    19
#if continueflag
35ebdbb38efb continue: added support for rebase
Taapas Agrawal <taapas2897@gmail.com>
parents: 36927
diff changeset
    20
  $ cat >> $HGRCPATH <<EOF
35ebdbb38efb continue: added support for rebase
Taapas Agrawal <taapas2897@gmail.com>
parents: 36927
diff changeset
    21
  > [alias]
35ebdbb38efb continue: added support for rebase
Taapas Agrawal <taapas2897@gmail.com>
parents: 36927
diff changeset
    22
  > continue = rebase --continue
35ebdbb38efb continue: added support for rebase
Taapas Agrawal <taapas2897@gmail.com>
parents: 36927
diff changeset
    23
  > EOF
35ebdbb38efb continue: added support for rebase
Taapas Agrawal <taapas2897@gmail.com>
parents: 36927
diff changeset
    24
#endif
35ebdbb38efb continue: added support for rebase
Taapas Agrawal <taapas2897@gmail.com>
parents: 36927
diff changeset
    25
36815
f4e9e89330d4 tests: simplify test-rebase-transaction.t
Martin von Zweigbergk <martinvonz@google.com>
parents: 34504
diff changeset
    26
Check that a simple rebase works
33619
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    27
36815
f4e9e89330d4 tests: simplify test-rebase-transaction.t
Martin von Zweigbergk <martinvonz@google.com>
parents: 34504
diff changeset
    28
  $ hg init simple && cd simple
33619
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    29
  $ hg debugdrawdag <<'EOF'
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    30
  >   Z
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    31
  >   |
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    32
  >   | D
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    33
  >   | |
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    34
  >   | C
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    35
  >   | |
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    36
  >   Y B
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    37
  >   |/
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    38
  >   A
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    39
  > EOF
36927
17a744c5e270 rebase: also include commit of collapsed commits in single transaction
Martin von Zweigbergk <martinvonz@google.com>
parents: 36816
diff changeset
    40
- We should only see one status stored message. It comes from the start.
33619
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    41
  $ hg rebase --debug -b D -d Z | grep 'status stored'
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    42
  rebase status stored
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    43
  $ hg tglog
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    44
  o  5: D
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    45
  |
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    46
  o  4: C
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    47
  |
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    48
  o  3: B
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    49
  |
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    50
  o  2: Z
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    51
  |
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    52
  o  1: Y
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    53
  |
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    54
  o  0: A
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    55
  
609606d21765 rebase: use one dirstateguard for when using rebase.singletransaction
Durham Goode <durham@fb.com>
parents: 33558
diff changeset
    56
  $ cd ..
36816
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    57
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    58
Check that --collapse works
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    59
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    60
  $ hg init collapse && cd collapse
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    61
  $ hg debugdrawdag <<'EOF'
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    62
  >   Z
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    63
  >   |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    64
  >   | D
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    65
  >   | |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    66
  >   | C
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    67
  >   | |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    68
  >   Y B
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    69
  >   |/
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    70
  >   A
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    71
  > EOF
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    72
- We should only see two status stored messages. One from the start, one from
36927
17a744c5e270 rebase: also include commit of collapsed commits in single transaction
Martin von Zweigbergk <martinvonz@google.com>
parents: 36816
diff changeset
    73
- cmdutil.commitforceeditor() which forces tr.writepending()
36816
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    74
  $ hg rebase --collapse --debug -b D -d Z | grep 'status stored'
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    75
  rebase status stored
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    76
  rebase status stored
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    77
  $ hg tglog
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    78
  o  3: Collapsed revision
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    79
  |  * B
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    80
  |  * C
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    81
  |  * D
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    82
  o  2: Z
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    83
  |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    84
  o  1: Y
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    85
  |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    86
  o  0: A
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    87
  
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    88
  $ cd ..
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    89
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    90
With --collapse, check that conflicts can be resolved and rebase can then be
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    91
continued
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    92
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    93
  $ hg init collapse-conflict && cd collapse-conflict
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    94
  $ hg debugdrawdag <<'EOF'
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    95
  >   Z   # Z/conflict=Z
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    96
  >   |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    97
  >   | D
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    98
  >   | |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
    99
  >   | C # C/conflict=C
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   100
  >   | |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   101
  >   Y B
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   102
  >   |/
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   103
  >   A
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   104
  > EOF
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   105
  $ hg rebase --collapse -b D -d Z
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   106
  rebasing 1:112478962961 "B" (B)
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   107
  rebasing 3:c26739dbe603 "C" (C)
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   108
  merging conflict
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   109
  warning: conflicts while merging conflict! (edit, then use 'hg resolve --mark')
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   110
  unresolved conflicts (see hg resolve, then hg rebase --continue)
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   111
  [1]
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   112
  $ hg tglog
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   113
  o  5: D
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   114
  |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   115
  | @  4: Z
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   116
  | |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   117
  @ |  3: C
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   118
  | |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   119
  | o  2: Y
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   120
  | |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   121
  o |  1: B
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   122
  |/
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   123
  o  0: A
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   124
  
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   125
  $ hg st
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   126
  M C
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   127
  M conflict
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   128
  A B
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   129
  ? conflict.orig
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   130
  $ echo resolved > conflict
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   131
  $ hg resolve -m
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   132
  (no more unresolved files)
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   133
  continue: hg rebase --continue
42613
35ebdbb38efb continue: added support for rebase
Taapas Agrawal <taapas2897@gmail.com>
parents: 36927
diff changeset
   134
  $ hg continue
36816
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   135
  already rebased 1:112478962961 "B" (B) as 79bc8f4973ce
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   136
  rebasing 3:c26739dbe603 "C" (C)
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   137
  rebasing 5:d24bb333861c "D" (D tip)
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   138
  saved backup bundle to $TESTTMP/collapse-conflict/.hg/strip-backup/112478962961-b5b34645-rebase.hg
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   139
  $ hg tglog
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   140
  o  3: Collapsed revision
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   141
  |  * B
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   142
  |  * C
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   143
  |  * D
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   144
  o  2: Z
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   145
  |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   146
  o  1: Y
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   147
  |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   148
  o  0: A
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   149
  
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   150
  $ cd ..
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   151
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   152
With --collapse, check that the commit message editing can be canceled and
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   153
rebase can then be continued
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   154
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   155
  $ hg init collapse-cancel-editor && cd collapse-cancel-editor
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   156
  $ hg debugdrawdag <<'EOF'
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   157
  >   Z
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   158
  >   |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   159
  >   | D
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   160
  >   | |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   161
  >   | C
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   162
  >   | |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   163
  >   Y B
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   164
  >   |/
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   165
  >   A
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   166
  > EOF
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   167
  $ HGEDITOR=false hg --config ui.interactive=1 rebase --collapse -b D -d Z
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   168
  rebasing 1:112478962961 "B" (B)
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   169
  rebasing 3:26805aba1e60 "C" (C)
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   170
  rebasing 5:f585351a92f8 "D" (D tip)
36927
17a744c5e270 rebase: also include commit of collapsed commits in single transaction
Martin von Zweigbergk <martinvonz@google.com>
parents: 36816
diff changeset
   171
  transaction abort!
17a744c5e270 rebase: also include commit of collapsed commits in single transaction
Martin von Zweigbergk <martinvonz@google.com>
parents: 36816
diff changeset
   172
  rollback completed
36816
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   173
  abort: edit failed: false exited with status 1
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   174
  [255]
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   175
  $ hg tglog
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   176
  o  5: D
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   177
  |
36927
17a744c5e270 rebase: also include commit of collapsed commits in single transaction
Martin von Zweigbergk <martinvonz@google.com>
parents: 36816
diff changeset
   178
  | o  4: Z
36816
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   179
  | |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   180
  o |  3: C
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   181
  | |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   182
  | o  2: Y
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   183
  | |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   184
  o |  1: B
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   185
  |/
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   186
  o  0: A
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   187
  
42613
35ebdbb38efb continue: added support for rebase
Taapas Agrawal <taapas2897@gmail.com>
parents: 36927
diff changeset
   188
  $ hg continue
36927
17a744c5e270 rebase: also include commit of collapsed commits in single transaction
Martin von Zweigbergk <martinvonz@google.com>
parents: 36816
diff changeset
   189
  rebasing 1:112478962961 "B" (B)
17a744c5e270 rebase: also include commit of collapsed commits in single transaction
Martin von Zweigbergk <martinvonz@google.com>
parents: 36816
diff changeset
   190
  rebasing 3:26805aba1e60 "C" (C)
17a744c5e270 rebase: also include commit of collapsed commits in single transaction
Martin von Zweigbergk <martinvonz@google.com>
parents: 36816
diff changeset
   191
  rebasing 5:f585351a92f8 "D" (D tip)
36816
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   192
  saved backup bundle to $TESTTMP/collapse-cancel-editor/.hg/strip-backup/112478962961-cb2a9b47-rebase.hg
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   193
  $ hg tglog
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   194
  o  3: Collapsed revision
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   195
  |  * B
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   196
  |  * C
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   197
  |  * D
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   198
  o  2: Z
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   199
  |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   200
  o  1: Y
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   201
  |
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   202
  o  0: A
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   203
  
9ab7eba99fe5 tests: add a few tests involving --collapse and rebase.singletransaction=1
Martin von Zweigbergk <martinvonz@google.com>
parents: 36815
diff changeset
   204
  $ cd ..