comparison tests/test-histedit-edit.t @ 24111:11d72683f3de

histedit: don't allow to strip nodes which are necessary to continue histedit During histedit we don't want user to do any operation resulting in stripping nodes needed to continue history editing. This patch wraps the strip function to detect such situations.
author Mateusz Kwapich <mitrandir@fb.com>
date Fri, 30 Jan 2015 16:47:35 -0800
parents aa4a1672583e
children be7cb25186be
comparison
equal deleted inserted replaced
24107:32e8d94b9473 24111:11d72683f3de
1 $ . "$TESTDIR/histedit-helpers.sh" 1 $ . "$TESTDIR/histedit-helpers.sh"
2 2
3 $ cat >> $HGRCPATH <<EOF 3 $ cat >> $HGRCPATH <<EOF
4 > [extensions] 4 > [extensions]
5 > histedit= 5 > histedit=
6 > strip=
6 > EOF 7 > EOF
7 8
8 $ initrepo () 9 $ initrepo ()
9 > { 10 > {
10 > hg init r 11 > hg init r
68 $ hg id -n 69 $ hg id -n
69 3+ 70 3+
70 $ hg up 0 71 $ hg up 0
71 abort: histedit in progress 72 abort: histedit in progress
72 (use 'hg histedit --continue' or 'hg histedit --abort') 73 (use 'hg histedit --continue' or 'hg histedit --abort')
74 [255]
75
76 Try to delete necessary commit
77 $ hg strip -r 652413bf663e
78 abort: unable to strip 652413bf663ef2a641cab26574e46d5f5a64a55a. Nodes are used by history edit in progress.
73 [255] 79 [255]
74 80
75 commit, then edit the revision 81 commit, then edit the revision
76 $ hg ci -m 'wat' 82 $ hg ci -m 'wat'
77 created new head 83 created new head