tests/test-histedit-arguments.t
author Gregory Szorc <gregory.szorc@gmail.com>
Sat, 24 Oct 2015 19:56:39 +0100
changeset 27262 3d0feb2f978b
parent 27217 1ec23f3e62f3
child 27349 5b68f72c2ba9
permissions -rw-r--r--
histedit: pick an appropriate base changeset by default (BC) Previously, `hg histedit` required a revision argument specifying which revision to use as the base for the current histedit operation. There was an undocumented and experimental "histedit.defaultrev" option that supported defining a single revision to be used if no argument is passed. Mercurial knows what changesets can be edited. And in most scenarios, people want to edit this history of everything on the current head that is rewritable. Making histedit do this by default and not require an explicit argument or additional configuration is a major usability win and will enable more people to use histedit. This patch changes the behavior of the experimental and undocumented "histedit.defaultrev" config option to select an appropriate base revision by default. Comprehensive tests exercising the edge cases in the new, somewhat complicated default revset have been added. Surprisingly, no tests broke. I guess we were never testing the behavior with no ANCESTOR argument (it used to fail with "abort: histedit requires exactly one ancestor revision"). The new behavior is much more user friendly. The functionality for choosing the default base revision has been moved to destutil.py, where it can easily be modified by extensions.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19035
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     1
Test argument handling and various data parsing
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     2
==================================================
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     3
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     4
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     5
Enable extensions used by this test.
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     6
  $ cat >>$HGRCPATH <<EOF
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     7
  > [extensions]
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     8
  > histedit=
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     9
  > EOF
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    10
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    11
Repo setup.
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    12
  $ hg init foo
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    13
  $ cd foo
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    14
  $ echo alpha >> alpha
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    15
  $ hg addr
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    16
  adding alpha
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    17
  $ hg ci -m one
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    18
  $ echo alpha >> alpha
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    19
  $ hg ci -m two
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    20
  $ echo alpha >> alpha
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    21
  $ hg ci -m three
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    22
  $ echo alpha >> alpha
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    23
  $ hg ci -m four
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    24
  $ echo alpha >> alpha
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    25
  $ hg ci -m five
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    26
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    27
  $ hg log --style compact --graph
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    28
  @  4[tip]   08d98a8350f3   1970-01-01 00:00 +0000   test
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    29
  |    five
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    30
  |
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    31
  o  3   c8e68270e35a   1970-01-01 00:00 +0000   test
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    32
  |    four
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    33
  |
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    34
  o  2   eb57da33312f   1970-01-01 00:00 +0000   test
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    35
  |    three
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    36
  |
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    37
  o  1   579e40513370   1970-01-01 00:00 +0000   test
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    38
  |    two
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    39
  |
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    40
  o  0   6058cbb6cfd7   1970-01-01 00:00 +0000   test
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    41
       one
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    42
  
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    43
22368
802dffd62de5 histedit: abort gracefully on --continue/--abort with no state
Siddharth Agarwal <sid0@fb.com>
parents: 21858
diff changeset
    44
histedit --continue/--abort with no existing state
802dffd62de5 histedit: abort gracefully on --continue/--abort with no state
Siddharth Agarwal <sid0@fb.com>
parents: 21858
diff changeset
    45
--------------------------------------------------
802dffd62de5 histedit: abort gracefully on --continue/--abort with no state
Siddharth Agarwal <sid0@fb.com>
parents: 21858
diff changeset
    46
802dffd62de5 histedit: abort gracefully on --continue/--abort with no state
Siddharth Agarwal <sid0@fb.com>
parents: 21858
diff changeset
    47
  $ hg histedit --continue
802dffd62de5 histedit: abort gracefully on --continue/--abort with no state
Siddharth Agarwal <sid0@fb.com>
parents: 21858
diff changeset
    48
  abort: no histedit in progress
802dffd62de5 histedit: abort gracefully on --continue/--abort with no state
Siddharth Agarwal <sid0@fb.com>
parents: 21858
diff changeset
    49
  [255]
802dffd62de5 histedit: abort gracefully on --continue/--abort with no state
Siddharth Agarwal <sid0@fb.com>
parents: 21858
diff changeset
    50
  $ hg histedit --abort
802dffd62de5 histedit: abort gracefully on --continue/--abort with no state
Siddharth Agarwal <sid0@fb.com>
parents: 21858
diff changeset
    51
  abort: no histedit in progress
802dffd62de5 histedit: abort gracefully on --continue/--abort with no state
Siddharth Agarwal <sid0@fb.com>
parents: 21858
diff changeset
    52
  [255]
802dffd62de5 histedit: abort gracefully on --continue/--abort with no state
Siddharth Agarwal <sid0@fb.com>
parents: 21858
diff changeset
    53
19035
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    54
Run a dummy edit to make sure we get tip^^ correctly via revsingle.
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    55
--------------------------------------------------------------------
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    56
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    57
  $ HGEDITOR=cat hg histedit "tip^^"
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    58
  pick eb57da33312f 2 three
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    59
  pick c8e68270e35a 3 four
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    60
  pick 08d98a8350f3 4 five
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    61
  
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    62
  # Edit history between eb57da33312f and 08d98a8350f3
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    63
  #
20503
23dc77874191 histedit: clarify description of fold command
Adrian Zgorzałek <adek@fb.com>
parents: 19847
diff changeset
    64
  # Commits are listed from least to most recent
23dc77874191 histedit: clarify description of fold command
Adrian Zgorzałek <adek@fb.com>
parents: 19847
diff changeset
    65
  #
19035
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    66
  # Commands:
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    67
  #  p, pick = use commit
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    68
  #  e, edit = use commit, but stop for amending
20511
5840da876235 histedit: shorten new fold message
Matt Mackall <mpm@selenic.com>
parents: 20503
diff changeset
    69
  #  f, fold = use commit, but combine it with the one above
22152
d2a5986cb89d histedit: add "roll" command to fold commit data and drop message (issue4256)
Mike Edgar <adgar@google.com>
parents: 21858
diff changeset
    70
  #  r, roll = like fold, but discard this commit's description
19035
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    71
  #  d, drop = remove commit from history
26100
5706d130ec16 histedit: improve discoverability of edit commit message
timeless@mozdev.org
parents: 25330
diff changeset
    72
  #  m, mess = edit commit message without changing commit content
19035
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    73
  #
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    74
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    75
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    76
Run on a revision not ancestors of the current working directory.
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    77
--------------------------------------------------------------------
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    78
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    79
  $ hg up 2
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    80
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    81
  $ hg histedit -r 4
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    82
  abort: 08d98a8350f3 is not an ancestor of working directory
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    83
  [255]
19039
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
    84
  $ hg up --quiet
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
    85
20806
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
    86
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
    87
Test that we pick the minimum of a revrange
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
    88
---------------------------------------
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
    89
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
    90
  $ HGEDITOR=cat hg histedit '2::' --commands - << EOF
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
    91
  > pick eb57da33312f 2 three
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
    92
  > pick c8e68270e35a 3 four
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
    93
  > pick 08d98a8350f3 4 five
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
    94
  > EOF
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
    95
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
    96
  $ hg up --quiet
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
    97
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
    98
  $ HGEDITOR=cat hg histedit 'tip:2' --commands - << EOF
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
    99
  > pick eb57da33312f 2 three
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
   100
  > pick c8e68270e35a 3 four
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
   101
  > pick 08d98a8350f3 4 five
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
   102
  > EOF
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
   103
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
   104
  $ hg up --quiet
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
   105
24009
00d331763442 histedit: allow configuring default behavior
Durham Goode <durham@fb.com>
parents: 22369
diff changeset
   106
Test config specified default
00d331763442 histedit: allow configuring default behavior
Durham Goode <durham@fb.com>
parents: 22369
diff changeset
   107
-----------------------------
00d331763442 histedit: allow configuring default behavior
Durham Goode <durham@fb.com>
parents: 22369
diff changeset
   108
00d331763442 histedit: allow configuring default behavior
Durham Goode <durham@fb.com>
parents: 22369
diff changeset
   109
  $ HGEDITOR=cat hg histedit --config "histedit.defaultrev=only(.) - ::eb57da33312f" --commands - << EOF
00d331763442 histedit: allow configuring default behavior
Durham Goode <durham@fb.com>
parents: 22369
diff changeset
   110
  > pick c8e68270e35a 3 four
00d331763442 histedit: allow configuring default behavior
Durham Goode <durham@fb.com>
parents: 22369
diff changeset
   111
  > pick 08d98a8350f3 4 five
00d331763442 histedit: allow configuring default behavior
Durham Goode <durham@fb.com>
parents: 22369
diff changeset
   112
  > EOF
00d331763442 histedit: allow configuring default behavior
Durham Goode <durham@fb.com>
parents: 22369
diff changeset
   113
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
00d331763442 histedit: allow configuring default behavior
Durham Goode <durham@fb.com>
parents: 22369
diff changeset
   114
19847
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   115
Run on a revision not descendants of the initial parent
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   116
--------------------------------------------------------------------
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   117
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   118
Test the message shown for inconsistent histedit state, which may be
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   119
created (and forgotten) by Mercurial earlier than 2.7. This emulates
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   120
Mercurial earlier than 2.7 by renaming ".hg/histedit-state"
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   121
temporarily.
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   122
24764
4dcd55802237 histedit: allow histedit --continue when not on a descendant (BC)
Durham Goode <durham@fb.com>
parents: 24009
diff changeset
   123
  $ hg log -G -T '{rev} {shortest(node)} {desc}\n' -r 2::
4dcd55802237 histedit: allow histedit --continue when not on a descendant (BC)
Durham Goode <durham@fb.com>
parents: 24009
diff changeset
   124
  @  4 08d9 five
4dcd55802237 histedit: allow histedit --continue when not on a descendant (BC)
Durham Goode <durham@fb.com>
parents: 24009
diff changeset
   125
  |
4dcd55802237 histedit: allow histedit --continue when not on a descendant (BC)
Durham Goode <durham@fb.com>
parents: 24009
diff changeset
   126
  o  3 c8e6 four
4dcd55802237 histedit: allow histedit --continue when not on a descendant (BC)
Durham Goode <durham@fb.com>
parents: 24009
diff changeset
   127
  |
4dcd55802237 histedit: allow histedit --continue when not on a descendant (BC)
Durham Goode <durham@fb.com>
parents: 24009
diff changeset
   128
  o  2 eb57 three
4dcd55802237 histedit: allow histedit --continue when not on a descendant (BC)
Durham Goode <durham@fb.com>
parents: 24009
diff changeset
   129
  |
19847
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   130
  $ HGEDITOR=cat hg histedit -r 4 --commands - << EOF
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   131
  > edit 08d98a8350f3 4 five
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   132
  > EOF
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   133
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   134
  reverting alpha
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   135
  Make changes as needed, you may commit or record as needed now.
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   136
  When you are finished, run hg histedit --continue to resume.
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   137
  [1]
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   138
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   139
  $ mv .hg/histedit-state .hg/histedit-state.back
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   140
  $ hg update --quiet --clean 2
24764
4dcd55802237 histedit: allow histedit --continue when not on a descendant (BC)
Durham Goode <durham@fb.com>
parents: 24009
diff changeset
   141
  $ echo alpha >> alpha
19847
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   142
  $ mv .hg/histedit-state.back .hg/histedit-state
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   143
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   144
  $ hg histedit --continue
24764
4dcd55802237 histedit: allow histedit --continue when not on a descendant (BC)
Durham Goode <durham@fb.com>
parents: 24009
diff changeset
   145
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
4dcd55802237 histedit: allow histedit --continue when not on a descendant (BC)
Durham Goode <durham@fb.com>
parents: 24009
diff changeset
   146
  saved backup bundle to $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-backup.hg (glob)
4dcd55802237 histedit: allow histedit --continue when not on a descendant (BC)
Durham Goode <durham@fb.com>
parents: 24009
diff changeset
   147
  $ hg log -G -T '{rev} {shortest(node)} {desc}\n' -r 2::
4dcd55802237 histedit: allow histedit --continue when not on a descendant (BC)
Durham Goode <durham@fb.com>
parents: 24009
diff changeset
   148
  @  4 f5ed five
4dcd55802237 histedit: allow histedit --continue when not on a descendant (BC)
Durham Goode <durham@fb.com>
parents: 24009
diff changeset
   149
  |
4dcd55802237 histedit: allow histedit --continue when not on a descendant (BC)
Durham Goode <durham@fb.com>
parents: 24009
diff changeset
   150
  | o  3 c8e6 four
4dcd55802237 histedit: allow histedit --continue when not on a descendant (BC)
Durham Goode <durham@fb.com>
parents: 24009
diff changeset
   151
  |/
4dcd55802237 histedit: allow histedit --continue when not on a descendant (BC)
Durham Goode <durham@fb.com>
parents: 24009
diff changeset
   152
  o  2 eb57 three
4dcd55802237 histedit: allow histedit --continue when not on a descendant (BC)
Durham Goode <durham@fb.com>
parents: 24009
diff changeset
   153
  |
19847
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   154
24764
4dcd55802237 histedit: allow histedit --continue when not on a descendant (BC)
Durham Goode <durham@fb.com>
parents: 24009
diff changeset
   155
  $ hg unbundle -q $TESTTMP/foo/.hg/strip-backup/08d98a8350f3-02594089-backup.hg
4dcd55802237 histedit: allow histedit --continue when not on a descendant (BC)
Durham Goode <durham@fb.com>
parents: 24009
diff changeset
   156
  $ hg strip -q -r f5ed --config extensions.strip=
4dcd55802237 histedit: allow histedit --continue when not on a descendant (BC)
Durham Goode <durham@fb.com>
parents: 24009
diff changeset
   157
  $ hg up -q 08d98a8350f3
19847
45c3086880c7 histedit: suggest "histedit --abort" for inconsistent histedit state
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 19048
diff changeset
   158
19040
7eb6bfe0b5a2 histedit-test: test that missing revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19039
diff changeset
   159
Test that missing revisions are detected
7eb6bfe0b5a2 histedit-test: test that missing revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19039
diff changeset
   160
---------------------------------------
7eb6bfe0b5a2 histedit-test: test that missing revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19039
diff changeset
   161
7eb6bfe0b5a2 histedit-test: test that missing revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19039
diff changeset
   162
  $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
7eb6bfe0b5a2 histedit-test: test that missing revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19039
diff changeset
   163
  > pick eb57da33312f 2 three
7eb6bfe0b5a2 histedit-test: test that missing revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19039
diff changeset
   164
  > pick 08d98a8350f3 4 five
7eb6bfe0b5a2 histedit-test: test that missing revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19039
diff changeset
   165
  > EOF
19048
1163ff06ce89 histedit: more precise user message when changeset is missing
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19047
diff changeset
   166
  abort: missing rules for changeset c8e68270e35a
27217
1ec23f3e62f3 histedit: improve missing rule suggestion
timeless <timeless@mozdev.org>
parents: 27082
diff changeset
   167
  (use "drop c8e68270e35a" to discard the change)
19040
7eb6bfe0b5a2 histedit-test: test that missing revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19039
diff changeset
   168
  [255]
7eb6bfe0b5a2 histedit-test: test that missing revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19039
diff changeset
   169
19041
3b52b15e0b3d histedit-test: test that extra revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19040
diff changeset
   170
Test that extra revisions are detected
3b52b15e0b3d histedit-test: test that extra revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19040
diff changeset
   171
---------------------------------------
3b52b15e0b3d histedit-test: test that extra revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19040
diff changeset
   172
3b52b15e0b3d histedit-test: test that extra revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19040
diff changeset
   173
  $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
3b52b15e0b3d histedit-test: test that extra revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19040
diff changeset
   174
  > pick 6058cbb6cfd7 0 one
3b52b15e0b3d histedit-test: test that extra revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19040
diff changeset
   175
  > pick c8e68270e35a 3 four
3b52b15e0b3d histedit-test: test that extra revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19040
diff changeset
   176
  > pick 08d98a8350f3 4 five
3b52b15e0b3d histedit-test: test that extra revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19040
diff changeset
   177
  > EOF
27082
4898e442f392 histedit: make verification configurable
Mateusz Kwapich <mitrandir@fb.com>
parents: 26952
diff changeset
   178
  abort: may not use "pick" with changesets other than the ones listed
19041
3b52b15e0b3d histedit-test: test that extra revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19040
diff changeset
   179
  [255]
3b52b15e0b3d histedit-test: test that extra revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19040
diff changeset
   180
19042
52366b37f897 histedit-test: test malformed line
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19041
diff changeset
   181
Test malformed line
52366b37f897 histedit-test: test malformed line
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19041
diff changeset
   182
---------------------------------------
52366b37f897 histedit-test: test malformed line
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19041
diff changeset
   183
52366b37f897 histedit-test: test malformed line
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19041
diff changeset
   184
  $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
52366b37f897 histedit-test: test malformed line
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19041
diff changeset
   185
  > pickeb57da33312f2three
52366b37f897 histedit-test: test malformed line
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19041
diff changeset
   186
  > pick c8e68270e35a 3 four
52366b37f897 histedit-test: test malformed line
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19041
diff changeset
   187
  > pick 08d98a8350f3 4 five
52366b37f897 histedit-test: test malformed line
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19041
diff changeset
   188
  > EOF
52366b37f897 histedit-test: test malformed line
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19041
diff changeset
   189
  abort: malformed line "pickeb57da33312f2three"
52366b37f897 histedit-test: test malformed line
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19041
diff changeset
   190
  [255]
52366b37f897 histedit-test: test malformed line
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19041
diff changeset
   191
19043
7d27d80185f0 histedit-test: test unknown changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19042
diff changeset
   192
Test unknown changeset
7d27d80185f0 histedit-test: test unknown changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19042
diff changeset
   193
---------------------------------------
7d27d80185f0 histedit-test: test unknown changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19042
diff changeset
   194
7d27d80185f0 histedit-test: test unknown changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19042
diff changeset
   195
  $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
7d27d80185f0 histedit-test: test unknown changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19042
diff changeset
   196
  > pick 0123456789ab 2 three
7d27d80185f0 histedit-test: test unknown changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19042
diff changeset
   197
  > pick c8e68270e35a 3 four
7d27d80185f0 histedit-test: test unknown changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19042
diff changeset
   198
  > pick 08d98a8350f3 4 five
7d27d80185f0 histedit-test: test unknown changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19042
diff changeset
   199
  > EOF
7d27d80185f0 histedit-test: test unknown changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19042
diff changeset
   200
  abort: unknown changeset 0123456789ab listed
7d27d80185f0 histedit-test: test unknown changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19042
diff changeset
   201
  [255]
7d27d80185f0 histedit-test: test unknown changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19042
diff changeset
   202
19044
f77c23ec09f7 histedit-test: test unknown command
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19043
diff changeset
   203
Test unknown command
f77c23ec09f7 histedit-test: test unknown command
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19043
diff changeset
   204
---------------------------------------
f77c23ec09f7 histedit-test: test unknown command
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19043
diff changeset
   205
f77c23ec09f7 histedit-test: test unknown command
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19043
diff changeset
   206
  $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
f77c23ec09f7 histedit-test: test unknown command
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19043
diff changeset
   207
  > coin eb57da33312f 2 three
f77c23ec09f7 histedit-test: test unknown command
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19043
diff changeset
   208
  > pick c8e68270e35a 3 four
f77c23ec09f7 histedit-test: test unknown command
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19043
diff changeset
   209
  > pick 08d98a8350f3 4 five
f77c23ec09f7 histedit-test: test unknown command
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19043
diff changeset
   210
  > EOF
f77c23ec09f7 histedit-test: test unknown command
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19043
diff changeset
   211
  abort: unknown action "coin"
f77c23ec09f7 histedit-test: test unknown command
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19043
diff changeset
   212
  [255]
f77c23ec09f7 histedit-test: test unknown command
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19043
diff changeset
   213
19047
81de87f8b480 histedit: protect against duplicated entries
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19044
diff changeset
   214
Test duplicated changeset
81de87f8b480 histedit: protect against duplicated entries
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19044
diff changeset
   215
---------------------------------------
81de87f8b480 histedit: protect against duplicated entries
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19044
diff changeset
   216
81de87f8b480 histedit: protect against duplicated entries
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19044
diff changeset
   217
So one is missing and one appear twice.
81de87f8b480 histedit: protect against duplicated entries
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19044
diff changeset
   218
81de87f8b480 histedit: protect against duplicated entries
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19044
diff changeset
   219
  $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
81de87f8b480 histedit: protect against duplicated entries
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19044
diff changeset
   220
  > pick eb57da33312f 2 three
81de87f8b480 histedit: protect against duplicated entries
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19044
diff changeset
   221
  > pick eb57da33312f 2 three
81de87f8b480 histedit: protect against duplicated entries
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19044
diff changeset
   222
  > pick 08d98a8350f3 4 five
81de87f8b480 histedit: protect against duplicated entries
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19044
diff changeset
   223
  > EOF
81de87f8b480 histedit: protect against duplicated entries
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19044
diff changeset
   224
  abort: duplicated command for changeset eb57da33312f
81de87f8b480 histedit: protect against duplicated entries
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19044
diff changeset
   225
  [255]
81de87f8b480 histedit: protect against duplicated entries
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19044
diff changeset
   226
19039
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   227
Test short version of command
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   228
---------------------------------------
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   229
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   230
Note: we use varying amounts of white space between command name and changeset
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   231
short hash. This tests issue3893.
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   232
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   233
  $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   234
  > pick eb57da33312f 2 three
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   235
  > p    c8e68270e35a 3 four
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   236
  > f 08d98a8350f3 4 five
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   237
  > EOF
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   238
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   239
  reverting alpha
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   240
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   241
  four
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   242
  ***
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   243
  five
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   244
  
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   245
  
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   246
  
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   247
  HG: Enter commit message.  Lines beginning with 'HG:' are removed.
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   248
  HG: Leave message empty to abort commit.
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   249
  HG: --
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   250
  HG: user: test
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   251
  HG: branch 'default'
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   252
  HG: changed alpha
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   253
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   254
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   255
  saved backup bundle to $TESTTMP/foo/.hg/strip-backup/*-backup.hg (glob)
26763
50fc80e46786 histedit: make histedit prune when obsolete is enabled
Durham Goode <durham@fb.com>
parents: 26584
diff changeset
   256
  saved backup bundle to $TESTTMP/foo/.hg/strip-backup/c8e68270e35a-23a13bf9-backup.hg (glob)
20806
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
   257
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
   258
  $ hg update -q 2
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
   259
  $ echo x > x
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
   260
  $ hg add x
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
   261
  $ hg commit -m'x' x
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
   262
  created new head
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
   263
  $ hg histedit -r 'heads(all())'
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
   264
  abort: The specified revisions must have exactly one common root
d66862b87ae6 histedit: select the lowest rev when looking for a root in a revset (bc)
David Soria Parra <davidsp@fb.com>
parents: 20511
diff changeset
   265
  [255]
21858
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   266
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   267
Test that trimming description using multi-byte characters
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   268
--------------------------------------------------------------------
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   269
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   270
  $ python <<EOF
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   271
  > fp = open('logfile', 'w')
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   272
  > fp.write('12345678901234567890123456789012345678901234567890' +
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   273
  >          '12345') # there are 5 more columns for 80 columns
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   274
  > 
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   275
  > # 2 x 4 = 8 columns, but 3 x 4 = 12 bytes
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   276
  > fp.write(u'\u3042\u3044\u3046\u3048'.encode('utf-8'))
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   277
  > 
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   278
  > fp.close()
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   279
  > EOF
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   280
  $ echo xx >> x
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   281
  $ hg --encoding utf-8 commit --logfile logfile
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   282
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   283
  $ HGEDITOR=cat hg --encoding utf-8 histedit tip
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   284
  pick 3d3ea1f3a10b 5 1234567890123456789012345678901234567890123456789012345\xe3\x81\x82... (esc)
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   285
  
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   286
  # Edit history between 3d3ea1f3a10b and 3d3ea1f3a10b
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   287
  #
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   288
  # Commits are listed from least to most recent
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   289
  #
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   290
  # Commands:
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   291
  #  p, pick = use commit
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   292
  #  e, edit = use commit, but stop for amending
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   293
  #  f, fold = use commit, but combine it with the one above
22152
d2a5986cb89d histedit: add "roll" command to fold commit data and drop message (issue4256)
Mike Edgar <adgar@google.com>
parents: 21858
diff changeset
   294
  #  r, roll = like fold, but discard this commit's description
21858
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   295
  #  d, drop = remove commit from history
26100
5706d130ec16 histedit: improve discoverability of edit commit message
timeless@mozdev.org
parents: 25330
diff changeset
   296
  #  m, mess = edit commit message without changing commit content
21858
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   297
  #
50fd3a36d166 histedit: use 'util.ellipsis' to trim description of each changesets
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20806
diff changeset
   298
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
25330
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   299
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   300
Test --continue with --keep
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   301
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   302
  $ hg strip -q -r . --config extensions.strip=
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   303
  $ hg histedit '.^' -q --keep --commands - << EOF
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   304
  > edit eb57da33312f 2 three
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   305
  > pick f3cfcca30c44 4 x
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   306
  > EOF
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   307
  Make changes as needed, you may commit or record as needed now.
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   308
  When you are finished, run hg histedit --continue to resume.
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   309
  [1]
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   310
  $ echo edit >> alpha
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   311
  $ hg histedit -q --continue
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   312
  $ hg log -G -T '{rev}:{node|short} {desc}'
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   313
  @  6:8fda0c726bf2 x
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   314
  |
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   315
  o  5:63379946892c three
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   316
  |
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   317
  | o  4:f3cfcca30c44 x
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   318
  | |
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   319
  | | o  3:2a30f3cfee78 four
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   320
  | |/   ***
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   321
  | |    five
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   322
  | o  2:eb57da33312f three
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   323
  |/
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   324
  o  1:579e40513370 two
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   325
  |
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   326
  o  0:6058cbb6cfd7 one
8594d0b3018e histedit: fix keep during --continue
Durham Goode <durham@fb.com>
parents: 24764
diff changeset
   327
  
26584
e28102403d1b histedit: delete histedit statefile on any exception during abort
Christian Delahousse <cdelahousse@fb.com>
parents: 26100
diff changeset
   328
e28102403d1b histedit: delete histedit statefile on any exception during abort
Christian Delahousse <cdelahousse@fb.com>
parents: 26100
diff changeset
   329
Test that abort fails gracefully on exception
e28102403d1b histedit: delete histedit statefile on any exception during abort
Christian Delahousse <cdelahousse@fb.com>
parents: 26100
diff changeset
   330
----------------------------------------------
e28102403d1b histedit: delete histedit statefile on any exception during abort
Christian Delahousse <cdelahousse@fb.com>
parents: 26100
diff changeset
   331
  $ hg histedit . -q --commands - << EOF
e28102403d1b histedit: delete histedit statefile on any exception during abort
Christian Delahousse <cdelahousse@fb.com>
parents: 26100
diff changeset
   332
  > edit 8fda0c726bf2 6 x
e28102403d1b histedit: delete histedit statefile on any exception during abort
Christian Delahousse <cdelahousse@fb.com>
parents: 26100
diff changeset
   333
  > EOF
e28102403d1b histedit: delete histedit statefile on any exception during abort
Christian Delahousse <cdelahousse@fb.com>
parents: 26100
diff changeset
   334
  Make changes as needed, you may commit or record as needed now.
e28102403d1b histedit: delete histedit statefile on any exception during abort
Christian Delahousse <cdelahousse@fb.com>
parents: 26100
diff changeset
   335
  When you are finished, run hg histedit --continue to resume.
e28102403d1b histedit: delete histedit statefile on any exception during abort
Christian Delahousse <cdelahousse@fb.com>
parents: 26100
diff changeset
   336
  [1]
e28102403d1b histedit: delete histedit statefile on any exception during abort
Christian Delahousse <cdelahousse@fb.com>
parents: 26100
diff changeset
   337
Corrupt histedit state file
e28102403d1b histedit: delete histedit statefile on any exception during abort
Christian Delahousse <cdelahousse@fb.com>
parents: 26100
diff changeset
   338
  $ sed 's/8fda0c726bf2/123456789012/' .hg/histedit-state > ../corrupt-histedit
e28102403d1b histedit: delete histedit statefile on any exception during abort
Christian Delahousse <cdelahousse@fb.com>
parents: 26100
diff changeset
   339
  $ mv ../corrupt-histedit .hg/histedit-state
e28102403d1b histedit: delete histedit statefile on any exception during abort
Christian Delahousse <cdelahousse@fb.com>
parents: 26100
diff changeset
   340
  $ hg histedit --abort
e28102403d1b histedit: delete histedit statefile on any exception during abort
Christian Delahousse <cdelahousse@fb.com>
parents: 26100
diff changeset
   341
  warning: encountered an exception during histedit --abort; the repository may not have been completely cleaned up
26952
4e566f513fd8 tests: tolerate differences between Linux and Windows error strings
Matt Harbison <matt_harbison@yahoo.com>
parents: 26763
diff changeset
   342
  abort: .*(No such file or directory:|The system cannot find the file specified).* (re)
26584
e28102403d1b histedit: delete histedit statefile on any exception during abort
Christian Delahousse <cdelahousse@fb.com>
parents: 26100
diff changeset
   343
  [255]
e28102403d1b histedit: delete histedit statefile on any exception during abort
Christian Delahousse <cdelahousse@fb.com>
parents: 26100
diff changeset
   344
Histedit state has been exited
e28102403d1b histedit: delete histedit statefile on any exception during abort
Christian Delahousse <cdelahousse@fb.com>
parents: 26100
diff changeset
   345
  $ hg summary -q
e28102403d1b histedit: delete histedit statefile on any exception during abort
Christian Delahousse <cdelahousse@fb.com>
parents: 26100
diff changeset
   346
  parent: 5:63379946892c 
e28102403d1b histedit: delete histedit statefile on any exception during abort
Christian Delahousse <cdelahousse@fb.com>
parents: 26100
diff changeset
   347
  commit: 1 added, 1 unknown (new branch head)
e28102403d1b histedit: delete histedit statefile on any exception during abort
Christian Delahousse <cdelahousse@fb.com>
parents: 26100
diff changeset
   348
  update: 4 new changesets (update)
e28102403d1b histedit: delete histedit statefile on any exception during abort
Christian Delahousse <cdelahousse@fb.com>
parents: 26100
diff changeset
   349
27262
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   350
  $ cd ..
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   351
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   352
Set up default base revision tests
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   353
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   354
  $ hg init defaultbase
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   355
  $ cd defaultbase
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   356
  $ touch foo
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   357
  $ hg -q commit -A -m root
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   358
  $ echo 1 > foo
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   359
  $ hg commit -m 'public 1'
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   360
  $ hg phase --force --public -r .
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   361
  $ echo 2 > foo
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   362
  $ hg commit -m 'draft after public'
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   363
  $ hg -q up -r 1
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   364
  $ echo 3 > foo
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   365
  $ hg commit -m 'head 1 public'
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   366
  created new head
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   367
  $ hg phase --force --public -r .
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   368
  $ echo 4 > foo
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   369
  $ hg commit -m 'head 1 draft 1'
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   370
  $ echo 5 > foo
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   371
  $ hg commit -m 'head 1 draft 2'
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   372
  $ hg -q up -r 2
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   373
  $ echo 6 > foo
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   374
  $ hg commit -m 'head 2 commit 1'
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   375
  $ echo 7 > foo
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   376
  $ hg commit -m 'head 2 commit 2'
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   377
  $ hg -q up -r 2
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   378
  $ echo 8 > foo
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   379
  $ hg commit -m 'head 3'
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   380
  created new head
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   381
  $ hg -q up -r 2
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   382
  $ echo 9 > foo
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   383
  $ hg commit -m 'head 4'
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   384
  created new head
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   385
  $ hg merge --tool :local -r 8
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   386
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   387
  (branch merge, don't forget to commit)
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   388
  $ hg commit -m 'merge head 3 into head 4'
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   389
  $ echo 11 > foo
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   390
  $ hg commit -m 'commit 1 after merge'
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   391
  $ echo 12 > foo
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   392
  $ hg commit -m 'commit 2 after merge'
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   393
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   394
  $ hg log -G -T '{rev}:{node|short} {phase} {desc}\n'
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   395
  @  12:8cde254db839 draft commit 2 after merge
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   396
  |
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   397
  o  11:6f2f0241f119 draft commit 1 after merge
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   398
  |
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   399
  o    10:90506cc76b00 draft merge head 3 into head 4
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   400
  |\
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   401
  | o  9:f8607a373a97 draft head 4
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   402
  | |
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   403
  o |  8:0da92be05148 draft head 3
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   404
  |/
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   405
  | o  7:4c35cdf97d5e draft head 2 commit 2
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   406
  | |
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   407
  | o  6:931820154288 draft head 2 commit 1
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   408
  |/
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   409
  | o  5:8cdc02b9bc63 draft head 1 draft 2
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   410
  | |
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   411
  | o  4:463b8c0d2973 draft head 1 draft 1
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   412
  | |
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   413
  | o  3:23a0c4eefcbf public head 1 public
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   414
  | |
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   415
  o |  2:4117331c3abb draft draft after public
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   416
  |/
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   417
  o  1:4426d359ea59 public public 1
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   418
  |
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   419
  o  0:54136a8ddf32 public root
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   420
  
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   421
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   422
Default base revision should stop at public changesets
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   423
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   424
  $ hg -q up 8cdc02b9bc63
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   425
  $ hg histedit --commands - <<EOF
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   426
  > pick 463b8c0d2973
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   427
  > pick 8cdc02b9bc63
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   428
  > EOF
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   429
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   430
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   431
Default base revision should stop at branchpoint
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   432
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   433
  $ hg -q up 4c35cdf97d5e
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   434
  $ hg histedit --commands - <<EOF
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   435
  > pick 931820154288
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   436
  > pick 4c35cdf97d5e
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   437
  > EOF
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   438
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   439
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   440
Default base revision should stop at merge commit
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   441
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   442
  $ hg -q up 8cde254db839
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   443
  $ hg histedit --commands - <<EOF
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   444
  > pick 6f2f0241f119
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   445
  > pick 8cde254db839
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   446
  > EOF
3d0feb2f978b histedit: pick an appropriate base changeset by default (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 27217
diff changeset
   447
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved