tests/test-histedit-obsolete.t
author Pierre-Yves David <pierre-yves.david@logilab.fr>
Wed, 16 Jan 2013 19:14:22 +0100
changeset 18437 358c23e8f1c6
parent 18398 1a00c8451640
child 18438 81e77a8820f3
permissions -rw-r--r--
histedit: record histedit source (issue3681) Have histedit record the hex of the original changeset as already done by: - graft - commit --amend - rebase My main motivation for adding this is to prevent the creation of obsolescence cycle (see issue3681). Note that commit created during edit are not affected yet.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17759
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     1
  $ . "$TESTDIR/histedit-helpers.sh"
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     2
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     3
Enable obsolete
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     4
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     5
  $ cat > ${TESTTMP}/obs.py << EOF
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     6
  > import mercurial.obsolete
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     7
  > mercurial.obsolete._enabled = True
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     8
  > EOF
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     9
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    10
  $ cat >> $HGRCPATH << EOF
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    11
  > [ui]
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    12
  > logtemplate= {rev}:{node|short} {desc|firstline}
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    13
  > [phases]
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    14
  > publish=False
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    15
  > [extensions]'
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    16
  > histedit=
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    17
  > 
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    18
  > obs=${TESTTMP}/obs.py
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    19
  > EOF
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    20
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    21
  $ hg init base
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    22
  $ cd base
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    23
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    24
  $ for x in a b c d e f ; do
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    25
  >     echo $x > $x
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    26
  >     hg add $x
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    27
  >     hg ci -m $x
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    28
  > done
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    29
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    30
  $ hg log --graph
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    31
  @  5:652413bf663e f
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    32
  |
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    33
  o  4:e860deea161a e
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    34
  |
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    35
  o  3:055a42cdd887 d
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    36
  |
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    37
  o  2:177f92b77385 c
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    38
  |
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    39
  o  1:d2ae7f538514 b
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    40
  |
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    41
  o  0:cb9a9f314b8b a
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    42
  
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    43
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    44
  $ HGEDITOR=cat hg histedit 1
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    45
  pick d2ae7f538514 1 b
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    46
  pick 177f92b77385 2 c
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    47
  pick 055a42cdd887 3 d
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    48
  pick e860deea161a 4 e
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    49
  pick 652413bf663e 5 f
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    50
  
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    51
  # Edit history between d2ae7f538514 and 652413bf663e
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    52
  #
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    53
  # Commands:
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    54
  #  p, pick = use commit
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    55
  #  e, edit = use commit, but stop for amending
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    56
  #  f, fold = use commit, but fold into previous commit (combines N and N-1)
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    57
  #  d, drop = remove commit from history
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    58
  #  m, mess = edit message without changing commit content
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    59
  #
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    60
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
17764
c1b661ee29ff test: fix invalid redirection for histedit text
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17762
diff changeset
    61
  $ cat > commands.txt <<EOF
17759
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    62
  > pick 177f92b77385 2 c
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    63
  > drop d2ae7f538514 1 b
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    64
  > pick 055a42cdd887 3 d
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    65
  > fold e860deea161a 4 e
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    66
  > pick 652413bf663e 5 f
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    67
  > EOF
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    68
  $ hg histedit 1 --commands commands.txt --verbose | grep histedit
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18398
diff changeset
    69
  saved backup bundle to $TESTTMP/base/.hg/strip-backup/96e494a2d553-backup.hg (glob)
17759
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    70
  $ hg log --graph --hidden
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18398
diff changeset
    71
  @  8:cacdfd884a93 f
17759
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    72
  |
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18398
diff changeset
    73
  o  7:59d9f330561f d
17759
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    74
  |
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18398
diff changeset
    75
  o  6:b346ab9a313d c
17759
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    76
  |
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    77
  | x  5:652413bf663e f
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    78
  | |
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    79
  | x  4:e860deea161a e
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    80
  | |
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    81
  | x  3:055a42cdd887 d
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    82
  | |
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    83
  | x  2:177f92b77385 c
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    84
  | |
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    85
  | x  1:d2ae7f538514 b
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    86
  |/
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    87
  o  0:cb9a9f314b8b a
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    88
  
9c7497cd39fd histedit: add obsolete support
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    89
  $ hg debugobsolete
17771
dcfa526b180b histedit: create obsolescence markers in deterministic order
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17764
diff changeset
    90
  d2ae7f538514cd87c17547b0de4cea71fe1af9fb 0 {'date': '* *', 'user': 'test'} (glob)
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18398
diff changeset
    91
  177f92b773850b59254aa5e923436f921b55483b b346ab9a313db8537ecf96fca3ca3ca984ef3bd7 0 {'date': '* *', 'user': 'test'} (glob)
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18398
diff changeset
    92
  055a42cdd88768532f9cf79daa407fc8d138de9b 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 {'date': '* *', 'user': 'test'} (glob)
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18398
diff changeset
    93
  e860deea161a2f77de56603b340ebbb4536308ae 59d9f330561fd6c88b1a6b32f0e45034d88db784 0 {'date': '* *', 'user': 'test'} (glob)
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18398
diff changeset
    94
  652413bf663ef2a641cab26574e46d5f5a64a55a cacdfd884a9321ec4e1de275ef3949fa953a1f83 0 {'date': '* *', 'user': 'test'} (glob)
17771
dcfa526b180b histedit: create obsolescence markers in deterministic order
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17764
diff changeset
    95
17761
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
    96
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
    97
Ensure hidden revision does not prevent histedit
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
    98
-------------------------------------------------
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
    99
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
   100
create an hidden revision
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
   101
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
   102
  $ cat > commands.txt <<EOF
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18398
diff changeset
   103
  > pick b346ab9a313d 6 c
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18398
diff changeset
   104
  > drop 59d9f330561f 7 d
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18398
diff changeset
   105
  > pick cacdfd884a93 8 f
17761
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
   106
  > EOF
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
   107
  $ hg histedit 6 --commands commands.txt
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
   108
  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
   109
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
   110
  $ hg log --graph
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18398
diff changeset
   111
  @  9:c13eb81022ca f
17761
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
   112
  |
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18398
diff changeset
   113
  o  6:b346ab9a313d c
17761
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
   114
  |
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
   115
  o  0:cb9a9f314b8b a
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
   116
  
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
   117
check hidden revision are ignored (6 have hidden children 7 and 8)
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
   118
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
   119
  $ cat > commands.txt <<EOF
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18398
diff changeset
   120
  > pick b346ab9a313d 6 c
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18398
diff changeset
   121
  > pick c13eb81022ca 8 f
17761
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
   122
  > EOF
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
   123
  $ hg histedit 6 --commands commands.txt
c80a7a0c7d22 histedit: ignores hidden revision when checking for orphaned nodes
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17759
diff changeset
   124
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
17762
57f27cbfc5bb histedit: refuse to edit public changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17761
diff changeset
   125
57f27cbfc5bb histedit: refuse to edit public changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17761
diff changeset
   126
57f27cbfc5bb histedit: refuse to edit public changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17761
diff changeset
   127
Check that histedit respect phases
57f27cbfc5bb histedit: refuse to edit public changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17761
diff changeset
   128
=========================================
57f27cbfc5bb histedit: refuse to edit public changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17761
diff changeset
   129
57f27cbfc5bb histedit: refuse to edit public changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17761
diff changeset
   130
(not directly related to the test file but doesn't deserve it's own test case)
57f27cbfc5bb histedit: refuse to edit public changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17761
diff changeset
   131
57f27cbfc5bb histedit: refuse to edit public changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17761
diff changeset
   132
  $ hg log -G
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18398
diff changeset
   133
  @  9:c13eb81022ca f
17762
57f27cbfc5bb histedit: refuse to edit public changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17761
diff changeset
   134
  |
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18398
diff changeset
   135
  o  6:b346ab9a313d c
17762
57f27cbfc5bb histedit: refuse to edit public changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17761
diff changeset
   136
  |
57f27cbfc5bb histedit: refuse to edit public changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17761
diff changeset
   137
  o  0:cb9a9f314b8b a
57f27cbfc5bb histedit: refuse to edit public changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17761
diff changeset
   138
  
57f27cbfc5bb histedit: refuse to edit public changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17761
diff changeset
   139
  $ hg ph -pv '.^'
57f27cbfc5bb histedit: refuse to edit public changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17761
diff changeset
   140
  phase changed for 2 changesets
57f27cbfc5bb histedit: refuse to edit public changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17761
diff changeset
   141
  $ hg histedit -r '.~2'
57f27cbfc5bb histedit: refuse to edit public changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17761
diff changeset
   142
  abort: cannot edit immutable changeset: cb9a9f314b8b
57f27cbfc5bb histedit: refuse to edit public changeset
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17761
diff changeset
   143
  [255]
18165
0f5a0a2073a8 histedit: allow operation from non-head if obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17771
diff changeset
   144
0f5a0a2073a8 histedit: allow operation from non-head if obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17771
diff changeset
   145
18398
1a00c8451640 test: fix in-test comments related to obsolescence
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18165
diff changeset
   146
Test that rewriting leaving instability behind is allowed
1a00c8451640 test: fix in-test comments related to obsolescence
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 18165
diff changeset
   147
---------------------------------------------------------------------
18165
0f5a0a2073a8 histedit: allow operation from non-head if obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17771
diff changeset
   148
0f5a0a2073a8 histedit: allow operation from non-head if obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17771
diff changeset
   149
  $ hg up '.^'
0f5a0a2073a8 histedit: allow operation from non-head if obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17771
diff changeset
   150
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
0f5a0a2073a8 histedit: allow operation from non-head if obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17771
diff changeset
   151
  $ hg phase --force --draft .
0f5a0a2073a8 histedit: allow operation from non-head if obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17771
diff changeset
   152
  $ hg log -r 'children(.)'
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18398
diff changeset
   153
  9:c13eb81022ca f (no-eol)
18165
0f5a0a2073a8 histedit: allow operation from non-head if obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17771
diff changeset
   154
  $ hg histedit -r '.'
0f5a0a2073a8 histedit: allow operation from non-head if obsolete is enabled
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17771
diff changeset
   155
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved