| 1 |
$ . "$TESTDIR/histedit-helpers.sh" |
| 2 |
|
| 3 |
$ cat >> $HGRCPATH <<EOF |
| 4 |
> [extensions] |
| 5 |
> histedit= |
| 6 |
> EOF |
| 7 |
|
| 8 |
$ hg init r |
| 9 |
$ cd r |
| 10 |
|
| 11 |
$ for x in a b c d e f ; do |
| 12 |
> echo $x > $x |
| 13 |
> hg add $x |
| 14 |
> hg ci -m $x |
| 15 |
> done |
| 16 |
|
| 17 |
$ hg book -r 1 will-move-backwards |
| 18 |
$ hg book -r 2 two |
| 19 |
$ hg book -r 2 also-two |
| 20 |
$ hg book -r 3 three |
| 21 |
$ hg book -r 4 four |
| 22 |
$ hg book -r tip five |
| 23 |
$ hg log --graph |
| 24 |
@ changeset: 5:652413bf663e |
| 25 |
| bookmark: five |
| 26 |
| tag: tip |
| 27 |
| user: test |
| 28 |
| date: Thu Jan 01 00:00:00 1970 +0000 |
| 29 |
| summary: f |
| 30 |
| |
| 31 |
o changeset: 4:e860deea161a |
| 32 |
| bookmark: four |
| 33 |
| user: test |
| 34 |
| date: Thu Jan 01 00:00:00 1970 +0000 |
| 35 |
| summary: e |
| 36 |
| |
| 37 |
o changeset: 3:055a42cdd887 |
| 38 |
| bookmark: three |
| 39 |
| user: test |
| 40 |
| date: Thu Jan 01 00:00:00 1970 +0000 |
| 41 |
| summary: d |
| 42 |
| |
| 43 |
o changeset: 2:177f92b77385 |
| 44 |
| bookmark: also-two |
| 45 |
| bookmark: two |
| 46 |
| user: test |
| 47 |
| date: Thu Jan 01 00:00:00 1970 +0000 |
| 48 |
| summary: c |
| 49 |
| |
| 50 |
o changeset: 1:d2ae7f538514 |
| 51 |
| bookmark: will-move-backwards |
| 52 |
| user: test |
| 53 |
| date: Thu Jan 01 00:00:00 1970 +0000 |
| 54 |
| summary: b |
| 55 |
| |
| 56 |
o changeset: 0:cb9a9f314b8b |
| 57 |
user: test |
| 58 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 59 |
summary: a |
| 60 |
|
| 61 |
$ HGEDITOR=cat hg histedit 1 |
| 62 |
pick d2ae7f538514 1 b |
| 63 |
pick 177f92b77385 2 c |
| 64 |
pick 055a42cdd887 3 d |
| 65 |
pick e860deea161a 4 e |
| 66 |
pick 652413bf663e 5 f |
| 67 |
|
| 68 |
# Edit history between d2ae7f538514 and 652413bf663e |
| 69 |
# |
| 70 |
# Commits are listed from least to most recent |
| 71 |
# |
| 72 |
# You can reorder changesets by reordering the lines |
| 73 |
# |
| 74 |
# Commands: |
| 75 |
# |
| 76 |
# e, edit = use commit, but allow edits before making new commit |
| 77 |
# m, mess = edit commit message without changing commit content |
| 78 |
# p, pick = use commit |
| 79 |
# b, base = checkout changeset and apply further changesets from there |
| 80 |
# d, drop = remove commit from history |
| 81 |
# f, fold = use commit, but combine it with the one above |
| 82 |
# r, roll = like fold, but discard this commit's description and date |
| 83 |
# |
| 84 |
$ hg histedit 1 --commands - --verbose << EOF | grep histedit |
| 85 |
> pick 177f92b77385 2 c |
| 86 |
> drop d2ae7f538514 1 b |
| 87 |
> pick 055a42cdd887 3 d |
| 88 |
> fold e860deea161a 4 e |
| 89 |
> pick 652413bf663e 5 f |
| 90 |
> EOF |
| 91 |
saved backup bundle to $TESTTMP/r/.hg/strip-backup/96e494a2d553-45c027ab-histedit.hg |
| 92 |
$ hg log --graph |
| 93 |
@ changeset: 3:cacdfd884a93 |
| 94 |
| bookmark: five |
| 95 |
| tag: tip |
| 96 |
| user: test |
| 97 |
| date: Thu Jan 01 00:00:00 1970 +0000 |
| 98 |
| summary: f |
| 99 |
| |
| 100 |
o changeset: 2:59d9f330561f |
| 101 |
| bookmark: four |
| 102 |
| bookmark: three |
| 103 |
| user: test |
| 104 |
| date: Thu Jan 01 00:00:00 1970 +0000 |
| 105 |
| summary: d |
| 106 |
| |
| 107 |
o changeset: 1:b346ab9a313d |
| 108 |
| bookmark: also-two |
| 109 |
| bookmark: two |
| 110 |
| user: test |
| 111 |
| date: Thu Jan 01 00:00:00 1970 +0000 |
| 112 |
| summary: c |
| 113 |
| |
| 114 |
o changeset: 0:cb9a9f314b8b |
| 115 |
bookmark: will-move-backwards |
| 116 |
user: test |
| 117 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 118 |
summary: a |
| 119 |
|
| 120 |
$ HGEDITOR=cat hg histedit 1 |
| 121 |
pick b346ab9a313d 1 c |
| 122 |
pick 59d9f330561f 2 d |
| 123 |
pick cacdfd884a93 3 f |
| 124 |
|
| 125 |
# Edit history between b346ab9a313d and cacdfd884a93 |
| 126 |
# |
| 127 |
# Commits are listed from least to most recent |
| 128 |
# |
| 129 |
# You can reorder changesets by reordering the lines |
| 130 |
# |
| 131 |
# Commands: |
| 132 |
# |
| 133 |
# e, edit = use commit, but allow edits before making new commit |
| 134 |
# m, mess = edit commit message without changing commit content |
| 135 |
# p, pick = use commit |
| 136 |
# b, base = checkout changeset and apply further changesets from there |
| 137 |
# d, drop = remove commit from history |
| 138 |
# f, fold = use commit, but combine it with the one above |
| 139 |
# r, roll = like fold, but discard this commit's description and date |
| 140 |
# |
| 141 |
$ hg histedit 1 --commands - --verbose << EOF | grep histedit |
| 142 |
> pick b346ab9a313d 1 c |
| 143 |
> pick cacdfd884a93 3 f |
| 144 |
> pick 59d9f330561f 2 d |
| 145 |
> EOF |
| 146 |
saved backup bundle to $TESTTMP/r/.hg/strip-backup/59d9f330561f-073008af-histedit.hg |
| 147 |
|
| 148 |
We expect 'five' to stay at tip, since the tipmost bookmark is most |
| 149 |
likely the useful signal. |
| 150 |
|
| 151 |
$ hg log --graph |
| 152 |
@ changeset: 3:c04e50810e4b |
| 153 |
| bookmark: five |
| 154 |
| bookmark: four |
| 155 |
| bookmark: three |
| 156 |
| tag: tip |
| 157 |
| user: test |
| 158 |
| date: Thu Jan 01 00:00:00 1970 +0000 |
| 159 |
| summary: d |
| 160 |
| |
| 161 |
o changeset: 2:c13eb81022ca |
| 162 |
| user: test |
| 163 |
| date: Thu Jan 01 00:00:00 1970 +0000 |
| 164 |
| summary: f |
| 165 |
| |
| 166 |
o changeset: 1:b346ab9a313d |
| 167 |
| bookmark: also-two |
| 168 |
| bookmark: two |
| 169 |
| user: test |
| 170 |
| date: Thu Jan 01 00:00:00 1970 +0000 |
| 171 |
| summary: c |
| 172 |
| |
| 173 |
o changeset: 0:cb9a9f314b8b |
| 174 |
bookmark: will-move-backwards |
| 175 |
user: test |
| 176 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 177 |
summary: a |
| 178 |
|