tests/test-rebase-detach.t
author Denis Laxalde <denis.laxalde@logilab.fr>
Tue, 17 Oct 2017 21:15:31 +0200
changeset 34857 84c6b9384d6a
parent 33560 d4df141f90d1
child 35394 469b06b4c3ca
permissions -rw-r--r--
log: add -L/--line-range option to follow file history by line range We add an experimental -L/--line-range option to 'hg log' taking file patterns along with a line range using the (new) FILE,FROMLINE-TOLINE syntax where FILE may be a pattern (matching exactly one file). The resulting history is similar to what the "followlines" revset except that, if --patch is specified, only diff hunks within specified line range are shown. Basically, this brings the CLI on par with what currently only exists in hgweb through line selection in "file" and "annotate" views resulting in a file log with filtered patch to only display followed line range. The option may be specified multiple times and can be combined with --rev and regular file patterns to further restrict revisions. Usage of this option requires --follow; revisions are shown in descending order and renames are followed. Only the --graph option is currently not supported. The UI is the result of a consensus from review feedback at: https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-October/106749.html The implementation spreads between commands.log() and cmdutil module. In commands.log(), the main loop may now use a "hunksfilter" factory (similar to "filematcher") that, for a given "rev", produces a filtering function for diff hunks for a given file context object. The logic to build revisions from -L/--line-range options lives in cmdutil.getloglinerangerevs() which produces "revs", "filematcher" and "hunksfilter" information. Revisions obtained by following files' line range are filtered if they do not match the revset specified by --rev option. If regular FILE arguments are passed along with -L options, both filematchers are combined into a new matcher. .. feature:: Add an experimental -L/--line-range FILE,FROMLINE-TOLINE option to 'hg log' command to follow the history of files by line range. In combination with -p/--patch option, only diff hunks within specified line range will be displayed. Feedback, especially on UX aspects, is welcome.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
     1
  $ cat >> $HGRCPATH <<EOF
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
     2
  > [extensions]
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
     3
  > rebase=
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
     4
  > 
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
     5
  > [alias]
33559
094634292d34 tests: simplify config in test-rebase-detach.t
Martin von Zweigbergk <martinvonz@google.com>
parents: 33332
diff changeset
     6
  > tglog = log -G --template "{rev}: '{desc}'\n"
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
     7
  > 
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
     8
  > [extensions]
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
     9
  > drawdag=$TESTDIR/drawdag.py
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    10
  > EOF
10352
66d954e76ffb rebase: add --detach option to detach intermediate revisions (issue1950)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    11
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    12
Rebasing D onto B detaching from C (one commit):
11198
b345b1cc124f rebase: use helpers.sh in tests
Matt Mackall <mpm@selenic.com>
parents: 10352
diff changeset
    13
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    14
  $ hg init a1
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    15
  $ cd a1
10352
66d954e76ffb rebase: add --detach option to detach intermediate revisions (issue1950)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    16
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    17
  $ hg debugdrawdag <<EOF
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    18
  > D
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    19
  > |
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    20
  > C B
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    21
  > |/
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    22
  > A
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    23
  > EOF
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    24
  $ hg phase --force --secret D
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    25
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    26
  $ hg rebase -s D -d B
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    27
  rebasing 3:e7b3f00ed42e "D" (D tip)
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    28
  saved backup bundle to $TESTTMP/a1/.hg/strip-backup/e7b3f00ed42e-6f368371-rebase.hg (glob)
10352
66d954e76ffb rebase: add --detach option to detach intermediate revisions (issue1950)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    29
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
    30
  $ hg log -G --template "{rev}:{phase} '{desc}' {branches}\n"
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    31
  o  3:secret 'D'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    32
  |
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
    33
  | o  2:draft 'C'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    34
  | |
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    35
  o |  1:draft 'B'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    36
  |/
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
    37
  o  0:draft 'A'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    38
  
19924
c23c62209cc4 tests: prepare rebase test for wc parent preservation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18935
diff changeset
    39
  $ hg manifest --rev tip
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    40
  A
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    41
  B
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    42
  D
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    43
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    44
  $ cd ..
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    45
10352
66d954e76ffb rebase: add --detach option to detach intermediate revisions (issue1950)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
    46
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    47
Rebasing D onto B detaching from C (two commits):
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    48
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    49
  $ hg init a2
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    50
  $ cd a2
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    51
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    52
  $ hg debugdrawdag <<EOF
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    53
  > E
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    54
  > |
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    55
  > D
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    56
  > |
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    57
  > C B
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    58
  > |/
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    59
  > A
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    60
  > EOF
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    61
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    62
  $ hg rebase -s D -d B
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    63
  rebasing 3:e7b3f00ed42e "D" (D)
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    64
  rebasing 4:69a34c08022a "E" (E tip)
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    65
  saved backup bundle to $TESTTMP/a2/.hg/strip-backup/e7b3f00ed42e-a2ec7cea-rebase.hg (glob)
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    66
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    67
  $ hg tglog
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    68
  o  4: 'E'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    69
  |
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    70
  o  3: 'D'
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    71
  |
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    72
  | o  2: 'C'
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    73
  | |
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    74
  o |  1: 'B'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    75
  |/
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    76
  o  0: 'A'
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    77
  
19924
c23c62209cc4 tests: prepare rebase test for wc parent preservation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18935
diff changeset
    78
  $ hg manifest --rev tip
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
    79
  A
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    80
  B
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    81
  D
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    82
  E
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    83
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    84
  $ cd ..
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    85
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    86
Rebasing C onto B using detach (same as not using it):
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    87
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    88
  $ hg init a3
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    89
  $ cd a3
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    90
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    91
  $ hg debugdrawdag <<EOF
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    92
  > D
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    93
  > |
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    94
  > C B
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    95
  > |/
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    96
  > A
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    97
  > EOF
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    98
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
    99
  $ hg rebase -s C -d B
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   100
  rebasing 2:dc0947a82db8 "C" (C)
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   101
  rebasing 3:e7b3f00ed42e "D" (D tip)
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   102
  saved backup bundle to $TESTTMP/a3/.hg/strip-backup/dc0947a82db8-b8481714-rebase.hg (glob)
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   103
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   104
  $ hg tglog
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   105
  o  3: 'D'
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   106
  |
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   107
  o  2: 'C'
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   108
  |
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   109
  o  1: 'B'
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   110
  |
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   111
  o  0: 'A'
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   112
  
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   113
  $ hg manifest --rev tip
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   114
  A
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   115
  B
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   116
  C
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   117
  D
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   118
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   119
  $ cd ..
10352
66d954e76ffb rebase: add --detach option to detach intermediate revisions (issue1950)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   120
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   121
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   122
Rebasing D onto B detaching from C and collapsing:
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   123
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   124
  $ hg init a4
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   125
  $ cd a4
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   126
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   127
  $ hg debugdrawdag <<EOF
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   128
  > E
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   129
  > |
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   130
  > D
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   131
  > |
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   132
  > C B
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   133
  > |/
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   134
  > A
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   135
  > EOF
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   136
  $ hg phase --force --secret E
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   137
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   138
  $ hg rebase --collapse -s D -d B
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   139
  rebasing 3:e7b3f00ed42e "D" (D)
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   140
  rebasing 4:69a34c08022a "E" (E tip)
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   141
  saved backup bundle to $TESTTMP/a4/.hg/strip-backup/e7b3f00ed42e-a2ec7cea-rebase.hg (glob)
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   142
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   143
  $ hg  log -G --template "{rev}:{phase} '{desc}' {branches}\n"
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   144
  o  3:secret 'Collapsed revision
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   145
  |  * D
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   146
  |  * E'
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   147
  | o  2:draft 'C'
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   148
  | |
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   149
  o |  1:draft 'B'
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   150
  |/
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   151
  o  0:draft 'A'
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   152
  
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   153
  $ hg manifest --rev tip
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   154
  A
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   155
  B
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   156
  D
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   157
  E
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   158
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   159
  $ cd ..
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   160
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   161
Rebasing across null as ancestor
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   162
  $ hg init a5
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   163
  $ cd a5
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   164
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   165
  $ hg debugdrawdag <<EOF
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   166
  > E
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   167
  > |
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   168
  > D
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   169
  > |
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   170
  > C
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   171
  > |
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   172
  > A B
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   173
  > EOF
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   174
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   175
  $ hg rebase -s C -d B
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   176
  rebasing 2:dc0947a82db8 "C" (C)
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   177
  rebasing 3:e7b3f00ed42e "D" (D)
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   178
  rebasing 4:69a34c08022a "E" (E tip)
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   179
  saved backup bundle to $TESTTMP/a5/.hg/strip-backup/dc0947a82db8-3eefec98-rebase.hg (glob)
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   180
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   181
  $ hg tglog
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   182
  o  4: 'E'
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   183
  |
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   184
  o  3: 'D'
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   185
  |
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   186
  o  2: 'C'
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   187
  |
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   188
  o  1: 'B'
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   189
  
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   190
  o  0: 'A'
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   191
  
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   192
  $ hg rebase -d 1 -s 3
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   193
  rebasing 3:e9153d36a1af "D"
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   194
  rebasing 4:e3d0c70d606d "E" (tip)
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   195
  saved backup bundle to $TESTTMP/a5/.hg/strip-backup/e9153d36a1af-db7388ed-rebase.hg (glob)
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   196
  $ hg tglog
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   197
  o  4: 'E'
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   198
  |
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   199
  o  3: 'D'
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   200
  |
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   201
  | o  2: 'C'
14121
012c719103ab tests: change test-rebase-detach to use bundle/rebase.hg
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 13021
diff changeset
   202
  |/
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   203
  o  1: 'B'
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   204
  
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   205
  o  0: 'A'
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   206
  
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   207
  $ cd ..
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   208
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   209
Verify that target is not selected as external rev (issue3085)
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   210
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   211
  $ hg init a6
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   212
  $ cd a6
10352
66d954e76ffb rebase: add --detach option to detach intermediate revisions (issue1950)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   213
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   214
  $ hg debugdrawdag <<EOF
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   215
  > H
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   216
  > | G
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   217
  > |/|
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   218
  > F E
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   219
  > |/
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   220
  > A
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   221
  > EOF
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   222
  $ hg up -q G
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   223
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   224
  $ echo "I" >> E
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   225
  $ hg ci -m "I"
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   226
  $ hg tag --local I
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   227
  $ hg merge H
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   228
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   229
  (branch merge, don't forget to commit)
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   230
  $ hg ci -m "Merge"
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   231
  $ echo "J" >> F
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   232
  $ hg ci -m "J"
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   233
  $ hg tglog
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   234
  @  7: 'J'
14121
012c719103ab tests: change test-rebase-detach to use bundle/rebase.hg
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 13021
diff changeset
   235
  |
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   236
  o    6: 'Merge'
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   237
  |\
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   238
  | o  5: 'I'
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   239
  | |
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   240
  o |  4: 'H'
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   241
  | |
14121
012c719103ab tests: change test-rebase-detach to use bundle/rebase.hg
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 13021
diff changeset
   242
  | o  3: 'G'
012c719103ab tests: change test-rebase-detach to use bundle/rebase.hg
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 13021
diff changeset
   243
  |/|
012c719103ab tests: change test-rebase-detach to use bundle/rebase.hg
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 13021
diff changeset
   244
  o |  2: 'F'
012c719103ab tests: change test-rebase-detach to use bundle/rebase.hg
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 13021
diff changeset
   245
  | |
012c719103ab tests: change test-rebase-detach to use bundle/rebase.hg
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 13021
diff changeset
   246
  | o  1: 'E'
012c719103ab tests: change test-rebase-detach to use bundle/rebase.hg
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 13021
diff changeset
   247
  |/
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   248
  o  0: 'A'
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   249
  
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   250
  $ hg rebase -s I -d H --collapse --config ui.merge=internal:other
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   251
  rebasing 5:b92d164ad3cb "I" (I)
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   252
  rebasing 6:0cfbc7e8faaf "Merge"
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   253
  rebasing 7:c6aaf0d259c0 "J" (tip)
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   254
  saved backup bundle to $TESTTMP/a6/.hg/strip-backup/b92d164ad3cb-88fd7ab7-rebase.hg (glob)
10352
66d954e76ffb rebase: add --detach option to detach intermediate revisions (issue1950)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
   255
12608
16b854cb80f1 tests: unify test-rebase*
Adrian Buehlmann <adrian@cadifra.com>
parents: 11208
diff changeset
   256
  $ hg tglog
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   257
  @  5: 'Collapsed revision
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   258
  |  * I
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   259
  |  * Merge
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   260
  |  * J'
14121
012c719103ab tests: change test-rebase-detach to use bundle/rebase.hg
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 13021
diff changeset
   261
  o  4: 'H'
13021
6c800e7ef2f6 rebase: support --detach when null is common ancestor
Henrik Stuart <hg@hstuart.dk>
parents: 12640
diff changeset
   262
  |
14121
012c719103ab tests: change test-rebase-detach to use bundle/rebase.hg
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 13021
diff changeset
   263
  | o  3: 'G'
012c719103ab tests: change test-rebase-detach to use bundle/rebase.hg
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 13021
diff changeset
   264
  |/|
012c719103ab tests: change test-rebase-detach to use bundle/rebase.hg
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 13021
diff changeset
   265
  o |  2: 'F'
012c719103ab tests: change test-rebase-detach to use bundle/rebase.hg
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 13021
diff changeset
   266
  | |
012c719103ab tests: change test-rebase-detach to use bundle/rebase.hg
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 13021
diff changeset
   267
  | o  1: 'E'
012c719103ab tests: change test-rebase-detach to use bundle/rebase.hg
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 13021
diff changeset
   268
  |/
13021
6c800e7ef2f6 rebase: support --detach when null is common ancestor
Henrik Stuart <hg@hstuart.dk>
parents: 12640
diff changeset
   269
  o  0: 'A'
6c800e7ef2f6 rebase: support --detach when null is common ancestor
Henrik Stuart <hg@hstuart.dk>
parents: 12640
diff changeset
   270
  
15132
81f76098211e rebase: allow rebase to ancestor (issue3010)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 14121
diff changeset
   271
19924
c23c62209cc4 tests: prepare rebase test for wc parent preservation
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18935
diff changeset
   272
  $ hg log --rev tip
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   273
  changeset:   5:65079693dac4
15469
ad336e093a59 rebase: ensure target is not taken as external (issue3085)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 15464
diff changeset
   274
  tag:         tip
ad336e093a59 rebase: ensure target is not taken as external (issue3085)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 15464
diff changeset
   275
  user:        test
ad336e093a59 rebase: ensure target is not taken as external (issue3085)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 15464
diff changeset
   276
  date:        Thu Jan 01 00:00:00 1970 +0000
ad336e093a59 rebase: ensure target is not taken as external (issue3085)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 15464
diff changeset
   277
  summary:     Collapsed revision
ad336e093a59 rebase: ensure target is not taken as external (issue3085)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 15464
diff changeset
   278
  
ad336e093a59 rebase: ensure target is not taken as external (issue3085)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 15464
diff changeset
   279
ad336e093a59 rebase: ensure target is not taken as external (issue3085)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 15464
diff changeset
   280
  $ cd ..
ad336e093a59 rebase: ensure target is not taken as external (issue3085)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 15464
diff changeset
   281
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   282
Ensure --continue restores a correct state (issue3046) and phase:
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   283
  $ hg init a7
15469
ad336e093a59 rebase: ensure target is not taken as external (issue3085)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 15464
diff changeset
   284
  $ cd a7
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   285
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   286
  $ hg debugdrawdag <<EOF
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   287
  > C B
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   288
  > |/
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   289
  > A
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   290
  > EOF
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   291
  $ hg up -q C
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   292
  $ echo 'B2' > B
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   293
  $ hg ci -A -m 'B2'
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   294
  adding B
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   295
  $ hg phase --force --secret .
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   296
  $ hg rebase -s . -d B --config ui.merge=internal:fail
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   297
  rebasing 3:17b4880d2402 "B2" (tip)
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   298
  merging B
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   299
  warning: conflicts while merging B! (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: 18778
diff changeset
   300
  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
   301
  [1]
15464
3411a83e232a rebase: treat nullmerge as a special case in rebasestate (issue3046)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 15132
diff changeset
   302
  $ hg resolve --all -t internal:local
21947
b081decd9062 resolve: add parenthesis around "no more unresolved files" message
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 21267
diff changeset
   303
  (no more unresolved files)
27626
157675d0f600 rebase: hook afterresolvedstates
timeless <timeless@mozdev.org>
parents: 26811
diff changeset
   304
  continue: hg rebase --continue
15464
3411a83e232a rebase: treat nullmerge as a special case in rebasestate (issue3046)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 15132
diff changeset
   305
  $ hg rebase -c
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   306
  rebasing 3:17b4880d2402 "B2" (tip)
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   307
  note: rebase of 3:17b4880d2402 created no changes to commit
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   308
  saved backup bundle to $TESTTMP/a7/.hg/strip-backup/17b4880d2402-1ae1f6cc-rebase.hg (glob)
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   309
  $ hg  log -G --template "{rev}:{phase} '{desc}' {branches}\n"
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   310
  o  2:draft 'C'
15464
3411a83e232a rebase: treat nullmerge as a special case in rebasestate (issue3046)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 15132
diff changeset
   311
  |
33560
d4df141f90d1 tests: rewrite test-rebase-detach.t using drawdag
Martin von Zweigbergk <martinvonz@google.com>
parents: 33559
diff changeset
   312
  | @  1:draft 'B'
15464
3411a83e232a rebase: treat nullmerge as a special case in rebasestate (issue3046)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 15132
diff changeset
   313
  |/
15917
e66084ef8449 rebase: fix phases movement
Alain Leufroy <alain.leufroyATgmailMYDOTcom>
parents: 15742
diff changeset
   314
  o  0:draft 'A'
15464
3411a83e232a rebase: treat nullmerge as a special case in rebasestate (issue3046)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents: 15132
diff changeset
   315
  
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16509
diff changeset
   316
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 16509
diff changeset
   317
  $ cd ..