[PATCH 4 of 6] test-histedit-edit: improve coverage of histedit code

Augie Fackler raf at durin42.com
Thu Jun 28 08:59:45 CDT 2012


# HG changeset patch
# User Augie Fackler <raf at durin42.com>
# Date 1340840474 18000
# Node ID 72bfe648e5fa47ea5b12017c38b348d4540e89cc
# Parent  d7e7f85c32ac298a9e62ff4dab0ebaba0b82e96a
test-histedit-edit: improve coverage of histedit code

diff --git a/tests/test-histedit-edit b/tests/test-histedit-edit
--- a/tests/test-histedit-edit
+++ b/tests/test-histedit-edit
@@ -34,7 +34,8 @@
 echo % edit the history
 HGEDITOR="cat $EDITED > " hg histedit 177f92b77385 2>&1 | fixbundle
 
-echo % edit the revision
+echo % commit, then edit the revision
+hg ci -m 'wat'
 echo a > e
 HGEDITOR='echo "foobaz" > ' hg histedit --continue 2>&1 | fixbundle
 
@@ -44,7 +45,7 @@
 hg cat e
 
 cat > $EDITED <<EOF
-edit c38516e9ed62 f
+edit bf757c081cd0 f
 EOF
 HGEDITOR="cat $EDITED > " hg histedit tip 2>&1 | fixbundle
 hg status
@@ -67,7 +68,7 @@
 
 echo % modify the message
 cat > $EDITED <<EOF
-mess c38516e9ed62 f
+mess bf757c081cd0 f
 EOF
 HGEDITOR="cat $EDITED > " hg histedit tip 2>&1 | fixbundle
 hg status
diff --git a/tests/test-histedit-edit.out b/tests/test-histedit-edit.out
--- a/tests/test-histedit-edit.out
+++ b/tests/test-histedit-edit.out
@@ -34,20 +34,26 @@
 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
 abort: Make changes as needed, you may commit or record as needed now.
 When you are finished, run hg histedit --continue to resume.
-% edit the revision
+% commit, then edit the revision
+created new head
 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-@  changeset:   5:c38516e9ed62
+@  changeset:   6:bf757c081cd0
 |  tag:         tip
 |  user:        test
 |  date:        Thu Jan 01 00:00:00 1970 +0000
 |  summary:     f
 |
-o  changeset:   4:1da62d13177d
+o  changeset:   5:d6b15fed32d4
 |  user:        test
 |  date:        Thu Jan 01 00:00:00 1970 +0000
 |  summary:     foobaz
 |
+o  changeset:   4:1a60820cd1f6
+|  user:        test
+|  date:        Thu Jan 01 00:00:00 1970 +0000
+|  summary:     wat
+|
 o  changeset:   3:055a42cdd887
 |  user:        test
 |  date:        Thu Jan 01 00:00:00 1970 +0000
@@ -76,7 +82,7 @@
 A f
 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 % log after edit
-changeset:   5:c38516e9ed62
+changeset:   6:bf757c081cd0
 tag:         tip
 user:        test
 date:        Thu Jan 01 00:00:00 1970 +0000
@@ -85,7 +91,7 @@
 % say we'll change the message, but don't.
 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-changeset:   5:c38516e9ed62
+changeset:   6:bf757c081cd0
 tag:         tip
 user:        test
 date:        Thu Jan 01 00:00:00 1970 +0000
@@ -94,11 +100,11 @@
 % modify the message
 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-changeset:   5:4d6a10bcf3e3
+changeset:   6:0b16746f8e89
 tag:         tip
 user:        test
 date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     mess c38516e9ed62 f
+summary:     mess bf757c081cd0 f
 
 % rollback should not work after a histedit
 no rollback information available


More information about the Mercurial-devel mailing list