annotate tests/test-histedit-edit.t @ 23702:c48924787eaa

filectx.parents: enforce changeid of parent to be in own changectx ancestors Because of the way filenodes are computed, you can have multiple changesets "introducing" the same file revision. For example, in the changeset graph below, changeset 2 and 3 both change a file -to- and -from- the same content. o 3: content = new | | o 2: content = new |/ o 1: content = old In such cases, the file revision is create once, when 2 is added, and just reused for 3. So the file change in '3' (from "old" to "new)" has no linkrev pointing to it). We'll call this situation "linkrev-shadowing". As the linkrev is used for optimization purposes when walking a file history, the linkrev-shadowing results in an unexpected jump to another branch during such a walk.. This leads to multiple bugs with log, annotate and rename detection. One element to fix such bugs is to ensure that walking the file history sticks on the same topology as the changeset's history. For this purpose, we extend the logic in 'basefilectx.parents' so that it always defines the proper changeset to associate the parent file revision with. This "proper" changeset has to be an ancestor of the changeset associated with the child file revision. This logic is performed in the '_adjustlinkrev' function. This function is given the starting changeset and all the information regarding the parent file revision. If the linkrev for the file revision is an ancestor of the starting changeset, the linkrev is valid and will be used. If it is not, we detected a topological jump caused by linkrev shadowing, we are going to walk the ancestors of the starting changeset until we find one setting the file to the revision we are trying to create. The performance impact appears acceptable: - We are walking the changelog once for each filelog traversal (as there should be no overlap between searches), - changelog traversal itself is fairly cheap, compared to what is likely going to be perform on the result on the filelog traversal, - We only touch the manifest for ancestors touching the file, And such changesets are likely to be the one introducing the file. (except in pathological cases involving merge), - We use manifest diff instead of full manifest unpacking to check manifest content, so it does not involve applying multiple diffs in most case. - linkrev shadowing is not the common case. Tests for fixed issues in log, annotate and rename detection have been added. But this changeset does not solve all problems. It fixes -ancestry- computation, but if the linkrev-shadowed changesets is the starting one, we'll still get things wrong. We'll have to fix the bootstrapping of such operations in a later changeset. Also, the usage of `hg log FILE` without --follow still has issues with linkrev pointing to hidden changesets, because it relies on the `filelog` revset which implement its own traversal logic that is still to be fixed. Thanks goes to: - Matt Mackall: for nudging me in the right direction - Julien Cristau and RĂ©mi Cardona: for keep telling me linkrev bug were an evolution show stopper for 3 years. - Durham Goode: for finding a new linkrev issue every few weeks - Mads Kiilerich: for that last rename bug who raise this topic over my anoyance limit.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 23 Dec 2014 15:30:38 -0800
parents a5168eb9b2bc
children aa4a1672583e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
1 $ . "$TESTDIR/histedit-helpers.sh"
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
2
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
3 $ cat >> $HGRCPATH <<EOF
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
4 > [extensions]
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
5 > histedit=
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
6 > EOF
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
7
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
8 $ initrepo ()
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
9 > {
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
10 > hg init r
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
11 > cd r
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
12 > for x in a b c d e f ; do
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
13 > echo $x > $x
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
14 > hg add $x
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
15 > hg ci -m $x
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
16 > done
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
17 > }
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
18
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
19 $ initrepo
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
20
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
21 log before edit
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
22 $ hg log --graph
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
23 @ changeset: 5:652413bf663e
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
24 | tag: tip
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
25 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
26 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
27 | summary: f
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
28 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
29 o changeset: 4:e860deea161a
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
30 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
31 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
32 | summary: e
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
33 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
34 o changeset: 3:055a42cdd887
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
35 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
36 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
37 | summary: d
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
38 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
39 o changeset: 2:177f92b77385
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
40 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
41 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
42 | summary: c
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
43 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
44 o changeset: 1:d2ae7f538514
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
45 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
46 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
47 | summary: b
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
48 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
49 o changeset: 0:cb9a9f314b8b
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
50 user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
51 date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
52 summary: a
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
53
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
54
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
55 edit the history
19019
53060cc1b601 histedit-test: generalise --commands "-" usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18942
diff changeset
56 $ hg histedit 177f92b77385 --commands - 2>&1 << EOF| fixbundle
53060cc1b601 histedit-test: generalise --commands "-" usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18942
diff changeset
57 > pick 177f92b77385 c
53060cc1b601 histedit-test: generalise --commands "-" usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18942
diff changeset
58 > pick 055a42cdd887 d
53060cc1b601 histedit-test: generalise --commands "-" usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18942
diff changeset
59 > edit e860deea161a e
53060cc1b601 histedit-test: generalise --commands "-" usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18942
diff changeset
60 > pick 652413bf663e f
53060cc1b601 histedit-test: generalise --commands "-" usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18942
diff changeset
61 > EOF
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
62 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
18934
93f3a06b2035 histedit: switch from util.Abort to util.InterventionRequired where appropriate (bc)
Augie Fackler <raf@durin42.com>
parents: 18913
diff changeset
63 Make changes as needed, you may commit or record as needed now.
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
64 When you are finished, run hg histedit --continue to resume.
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
65
17749
40601f2b7608 histedit: simplify computation of `newchildren` during --continue
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17087
diff changeset
66 Go at a random point and try to continue
40601f2b7608 histedit: simplify computation of `newchildren` during --continue
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17087
diff changeset
67
40601f2b7608 histedit: simplify computation of `newchildren` during --continue
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17087
diff changeset
68 $ hg id -n
40601f2b7608 histedit: simplify computation of `newchildren` during --continue
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17087
diff changeset
69 3+
40601f2b7608 histedit: simplify computation of `newchildren` during --continue
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17087
diff changeset
70 $ hg up 0
19479
11664641fbad histedit: add checkunfinished support (issue3955)
Matt Mackall <mpm@selenic.com>
parents: 19215
diff changeset
71 abort: histedit in progress
11664641fbad histedit: add checkunfinished support (issue3955)
Matt Mackall <mpm@selenic.com>
parents: 19215
diff changeset
72 (use 'hg histedit --continue' or 'hg histedit --abort')
17749
40601f2b7608 histedit: simplify computation of `newchildren` during --continue
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17087
diff changeset
73 [255]
40601f2b7608 histedit: simplify computation of `newchildren` during --continue
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 17087
diff changeset
74
19496
607191a45f8c checkunfinished: accommodate histedit quirk
Matt Mackall <mpm@selenic.com>
parents: 19479
diff changeset
75 commit, then edit the revision
607191a45f8c checkunfinished: accommodate histedit quirk
Matt Mackall <mpm@selenic.com>
parents: 19479
diff changeset
76 $ hg ci -m 'wat'
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
77 created new head
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
78 $ echo a > e
17087
a79776f427b4 tests: make histedit pass on Windows MSYS
Mads Kiilerich <mads@kiilerich.com>
parents: 17086
diff changeset
79 $ HGEDITOR='echo foobaz > ' hg histedit --continue 2>&1 | fixbundle
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
80 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
81 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
82
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
83 $ hg log --graph
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
84 @ changeset: 6:b5f70786f9b0
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
85 | tag: tip
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
86 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
87 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
88 | summary: f
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
89 |
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
90 o changeset: 5:a5e1ba2f7afb
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
91 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
92 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
93 | summary: foobaz
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
94 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
95 o changeset: 4:1a60820cd1f6
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
96 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
97 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
98 | summary: wat
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
99 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
100 o changeset: 3:055a42cdd887
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
101 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
102 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
103 | summary: d
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
104 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
105 o changeset: 2:177f92b77385
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
106 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
107 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
108 | summary: c
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
109 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
110 o changeset: 1:d2ae7f538514
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
111 | user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
112 | date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
113 | summary: b
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
114 |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
115 o changeset: 0:cb9a9f314b8b
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
116 user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
117 date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
118 summary: a
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
119
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
120
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
121 $ hg cat e
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
122 a
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
123
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
124 check histedit_source
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
125
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
126 $ hg log --debug --rev 5
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
127 changeset: 5:a5e1ba2f7afb899ef1581cea528fd885d2fca70d
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
128 phase: draft
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
129 parent: 4:1a60820cd1f6004a362aa622ebc47d59bc48eb34
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
130 parent: -1:0000000000000000000000000000000000000000
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
131 manifest: 5:5ad3be8791f39117565557781f5464363b918a45
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
132 user: test
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
133 date: Thu Jan 01 00:00:00 1970 +0000
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
134 files: e
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
135 extra: branch=default
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
136 extra: histedit_source=e860deea161a2f77de56603b340ebbb4536308ae
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
137 description:
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
138 foobaz
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
139
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
140
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
141
19019
53060cc1b601 histedit-test: generalise --commands "-" usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18942
diff changeset
142 $ hg histedit tip --commands - 2>&1 <<EOF| fixbundle
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
143 > edit b5f70786f9b0 f
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
144 > EOF
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
145 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
18934
93f3a06b2035 histedit: switch from util.Abort to util.InterventionRequired where appropriate (bc)
Augie Fackler <raf@durin42.com>
parents: 18913
diff changeset
146 Make changes as needed, you may commit or record as needed now.
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
147 When you are finished, run hg histedit --continue to resume.
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
148 $ hg status
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
149 A f
19213
f324a9b8d4bf summary: add tests for some extensions we plan to modify
Bryan O'Sullivan <bryano@fb.com>
parents: 19019
diff changeset
150
f324a9b8d4bf summary: add tests for some extensions we plan to modify
Bryan O'Sullivan <bryano@fb.com>
parents: 19019
diff changeset
151 $ hg summary
f324a9b8d4bf summary: add tests for some extensions we plan to modify
Bryan O'Sullivan <bryano@fb.com>
parents: 19019
diff changeset
152 parent: 5:a5e1ba2f7afb
f324a9b8d4bf summary: add tests for some extensions we plan to modify
Bryan O'Sullivan <bryano@fb.com>
parents: 19019
diff changeset
153 foobaz
f324a9b8d4bf summary: add tests for some extensions we plan to modify
Bryan O'Sullivan <bryano@fb.com>
parents: 19019
diff changeset
154 branch: default
f324a9b8d4bf summary: add tests for some extensions we plan to modify
Bryan O'Sullivan <bryano@fb.com>
parents: 19019
diff changeset
155 commit: 1 added (new branch head)
f324a9b8d4bf summary: add tests for some extensions we plan to modify
Bryan O'Sullivan <bryano@fb.com>
parents: 19019
diff changeset
156 update: 1 new changesets (update)
19215
f184fe1e2ac5 summary: add a histedit hook
Bryan O'Sullivan <bryano@fb.com>
parents: 19213
diff changeset
157 hist: 1 remaining (histedit --continue)
19213
f324a9b8d4bf summary: add tests for some extensions we plan to modify
Bryan O'Sullivan <bryano@fb.com>
parents: 19019
diff changeset
158
21409
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
159 (test also that editor is invoked if histedit is continued for
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
160 "edit" action)
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
161
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
162 $ HGEDITOR='cat' hg histedit --continue
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
163 f
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
164
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
165
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
166 HG: Enter commit message. Lines beginning with 'HG:' are removed.
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
167 HG: Leave message empty to abort commit.
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
168 HG: --
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
169 HG: user: test
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
170 HG: branch 'default'
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
171 HG: added f
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
172 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
173 saved backup bundle to $TESTTMP/r/.hg/strip-backup/b5f70786f9b0-backup.hg (glob)
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
174
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
175 $ hg status
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
176
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
177 log after edit
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
178 $ hg log --limit 1
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
179 changeset: 6:a107ee126658
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
180 tag: tip
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
181 user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
182 date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
183 summary: f
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
184
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
185
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
186 say we'll change the message, but don't.
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
187 $ cat > ../edit.sh <<EOF
17086
5f2cacb715dc tests: make histedit tests more resilient to filesystem variation
Mads Kiilerich <mads@kiilerich.com>
parents: 17085
diff changeset
188 > cat "\$1" | sed s/pick/mess/ > tmp
5f2cacb715dc tests: make histedit tests more resilient to filesystem variation
Mads Kiilerich <mads@kiilerich.com>
parents: 17085
diff changeset
189 > mv tmp "\$1"
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
190 > EOF
17086
5f2cacb715dc tests: make histedit tests more resilient to filesystem variation
Mads Kiilerich <mads@kiilerich.com>
parents: 17085
diff changeset
191 $ HGEDITOR="sh ../edit.sh" hg histedit tip 2>&1 | fixbundle
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
192 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
193 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
194 $ hg status
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
195 $ hg log --limit 1
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
196 changeset: 6:1fd3b2fe7754
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
197 tag: tip
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
198 user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
199 date: Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
200 summary: f
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
201
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
202
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
203 modify the message
21028
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
204
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
205 check saving last-message.txt, at first
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
206
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
207 $ cat > $TESTTMP/commitfailure.py <<EOF
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
208 > from mercurial import util
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
209 > def reposetup(ui, repo):
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
210 > class commitfailure(repo.__class__):
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
211 > def commit(self, *args, **kwargs):
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
212 > raise util.Abort('emulating unexpected abort')
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
213 > repo.__class__ = commitfailure
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
214 > EOF
21233
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
215 $ cat >> .hg/hgrc <<EOF
21028
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
216 > [extensions]
21233
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
217 > # this failure occurs before editor invocation
21028
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
218 > commitfailure = $TESTTMP/commitfailure.py
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
219 > EOF
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
220
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
221 $ cat > $TESTTMP/editor.sh <<EOF
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
222 > echo "==== before editing"
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
223 > cat \$1
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
224 > echo "===="
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
225 > echo "check saving last-message.txt" >> \$1
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
226 > EOF
21233
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
227
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
228 (test that editor is not invoked before transaction starting)
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
229
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
230 $ rm -f .hg/last-message.txt
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
231 $ HGEDITOR="sh $TESTTMP/editor.sh" hg histedit tip --commands - 2>&1 << EOF | fixbundle
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
232 > mess 1fd3b2fe7754 f
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
233 > EOF
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
234 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
235 abort: emulating unexpected abort
21930
a5168eb9b2bc tests: cat error messages are different on Solaris
Danek Duvall <danek.duvall@oracle.com>
parents: 21409
diff changeset
236 $ test -f .hg/last-message.txt
21233
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
237 [1]
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
238
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
239 $ cat >> .hg/hgrc <<EOF
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
240 > [extensions]
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
241 > commitfailure = !
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
242 > EOF
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
243 $ hg histedit --abort -q
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
244
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
245 (test that editor is invoked and commit message is saved into
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
246 "last-message.txt")
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
247
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
248 $ cat >> .hg/hgrc <<EOF
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
249 > [hooks]
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
250 > # this failure occurs after editor invocation
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
251 > pretxncommit.unexpectedabort = false
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
252 > EOF
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
253
21407
47bfe5d433ac histedit: use the editor gotten by "getcommiteditor()" for "message"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21233
diff changeset
254 $ hg status --rev '1fd3b2fe7754^1' --rev 1fd3b2fe7754
47bfe5d433ac histedit: use the editor gotten by "getcommiteditor()" for "message"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21233
diff changeset
255 A f
47bfe5d433ac histedit: use the editor gotten by "getcommiteditor()" for "message"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21233
diff changeset
256
21028
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
257 $ rm -f .hg/last-message.txt
21407
47bfe5d433ac histedit: use the editor gotten by "getcommiteditor()" for "message"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21233
diff changeset
258 $ HGEDITOR="sh $TESTTMP/editor.sh" hg histedit tip --commands - 2>&1 << EOF
21028
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
259 > mess 1fd3b2fe7754 f
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
260 > EOF
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
261 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
21407
47bfe5d433ac histedit: use the editor gotten by "getcommiteditor()" for "message"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21233
diff changeset
262 adding f
21028
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
263 ==== before editing
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
264 f
21407
47bfe5d433ac histedit: use the editor gotten by "getcommiteditor()" for "message"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21233
diff changeset
265
47bfe5d433ac histedit: use the editor gotten by "getcommiteditor()" for "message"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21233
diff changeset
266
47bfe5d433ac histedit: use the editor gotten by "getcommiteditor()" for "message"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21233
diff changeset
267 HG: Enter commit message. Lines beginning with 'HG:' are removed.
47bfe5d433ac histedit: use the editor gotten by "getcommiteditor()" for "message"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21233
diff changeset
268 HG: Leave message empty to abort commit.
47bfe5d433ac histedit: use the editor gotten by "getcommiteditor()" for "message"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21233
diff changeset
269 HG: --
47bfe5d433ac histedit: use the editor gotten by "getcommiteditor()" for "message"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21233
diff changeset
270 HG: user: test
47bfe5d433ac histedit: use the editor gotten by "getcommiteditor()" for "message"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21233
diff changeset
271 HG: branch 'default'
47bfe5d433ac histedit: use the editor gotten by "getcommiteditor()" for "message"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21233
diff changeset
272 HG: added f
21028
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
273 ====
21233
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
274 transaction abort!
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
275 rollback completed
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
276 note: commit message saved in .hg/last-message.txt
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
277 abort: pretxncommit.unexpectedabort hook exited with status 1
21407
47bfe5d433ac histedit: use the editor gotten by "getcommiteditor()" for "message"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21233
diff changeset
278 [255]
21028
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
279 $ cat .hg/last-message.txt
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
280 f
21407
47bfe5d433ac histedit: use the editor gotten by "getcommiteditor()" for "message"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21233
diff changeset
281
47bfe5d433ac histedit: use the editor gotten by "getcommiteditor()" for "message"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21233
diff changeset
282
21028
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
283 check saving last-message.txt
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
284
21409
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
285 (test also that editor is invoked if histedit is continued for "message"
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
286 action)
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
287
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
288 $ HGEDITOR=cat hg histedit --continue
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
289 f
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
290
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
291
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
292 HG: Enter commit message. Lines beginning with 'HG:' are removed.
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
293 HG: Leave message empty to abort commit.
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
294 HG: --
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
295 HG: user: test
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
296 HG: branch 'default'
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
297 HG: added f
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
298 transaction abort!
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
299 rollback completed
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
300 note: commit message saved in .hg/last-message.txt
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
301 abort: pretxncommit.unexpectedabort hook exited with status 1
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
302 [255]
37a3ac247c0d histedit: use "getcommiteditor()" instead of explicit editor choice for "--continue"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21407
diff changeset
303
21233
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
304 $ cat >> .hg/hgrc <<EOF
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
305 > [hooks]
213fd1a99cd9 histedit: use "editor" argument of "commit()" instead of explicit "ui.edit()"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21028
diff changeset
306 > pretxncommit.unexpectedabort =
21028
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
307 > EOF
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
308 $ hg histedit --abort -q
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
309
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
310 then, check "modify the message" itself
a0f437e2f5a9 histedit: save manually edited commit message into ".hg/last-message.txt"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
311
19019
53060cc1b601 histedit-test: generalise --commands "-" usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18942
diff changeset
312 $ hg histedit tip --commands - 2>&1 << EOF | fixbundle
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17749
diff changeset
313 > mess 1fd3b2fe7754 f
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
314 > EOF
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
315 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
316 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
317 $ hg status
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
318 $ hg log --limit 1
19019
53060cc1b601 histedit-test: generalise --commands "-" usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18942
diff changeset
319 changeset: 6:62feedb1200e
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
320 tag: tip
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
321 user: test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
322 date: Thu Jan 01 00:00:00 1970 +0000
19019
53060cc1b601 histedit-test: generalise --commands "-" usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18942
diff changeset
323 summary: f
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
324
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
325
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
326 rollback should not work after a histedit
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
327 $ hg rollback
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
328 no rollback information available
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
329 [1]
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
330
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17067
diff changeset
331 $ cd ..
18913
79580b3140cd histedit: support editing of the first commit (issue3767)
Bryan O'Sullivan <bryano@fb.com>
parents: 18609
diff changeset
332 $ hg clone -qr0 r r0
79580b3140cd histedit: support editing of the first commit (issue3767)
Bryan O'Sullivan <bryano@fb.com>
parents: 18609
diff changeset
333 $ cd r0
79580b3140cd histedit: support editing of the first commit (issue3767)
Bryan O'Sullivan <bryano@fb.com>
parents: 18609
diff changeset
334 $ hg phase -fdr0
19019
53060cc1b601 histedit-test: generalise --commands "-" usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18942
diff changeset
335 $ hg histedit --commands - 0 2>&1 << EOF
53060cc1b601 histedit-test: generalise --commands "-" usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18942
diff changeset
336 > edit cb9a9f314b8b a > $EDITED
53060cc1b601 histedit-test: generalise --commands "-" usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18942
diff changeset
337 > EOF
18913
79580b3140cd histedit: support editing of the first commit (issue3767)
Bryan O'Sullivan <bryano@fb.com>
parents: 18609
diff changeset
338 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
79580b3140cd histedit: support editing of the first commit (issue3767)
Bryan O'Sullivan <bryano@fb.com>
parents: 18609
diff changeset
339 adding a
18942
6891e361bec6 histedit: update tests for new intervention framework
Matt Mackall <mpm@selenic.com>
parents: 18934
diff changeset
340 Make changes as needed, you may commit or record as needed now.
18913
79580b3140cd histedit: support editing of the first commit (issue3767)
Bryan O'Sullivan <bryano@fb.com>
parents: 18609
diff changeset
341 When you are finished, run hg histedit --continue to resume.
18942
6891e361bec6 histedit: update tests for new intervention framework
Matt Mackall <mpm@selenic.com>
parents: 18934
diff changeset
342 [1]
18913
79580b3140cd histedit: support editing of the first commit (issue3767)
Bryan O'Sullivan <bryano@fb.com>
parents: 18609
diff changeset
343 $ HGEDITOR=true hg histedit --continue
79580b3140cd histedit: support editing of the first commit (issue3767)
Bryan O'Sullivan <bryano@fb.com>
parents: 18609
diff changeset
344 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
79580b3140cd histedit: support editing of the first commit (issue3767)
Bryan O'Sullivan <bryano@fb.com>
parents: 18609
diff changeset
345 saved backup bundle to $TESTTMP/r0/.hg/strip-backup/cb9a9f314b8b-backup.hg (glob)