tests/test-commit-interactive.t
branchstable
changeset 24845 8133494accf1
parent 24844 6c6aee6d395b
child 24861 15d7f435108a
--- a/tests/test-commit-interactive.t	Thu Apr 23 16:59:11 2015 -0700
+++ b/tests/test-commit-interactive.t	Thu Apr 23 14:27:26 2015 -0700
@@ -229,11 +229,25 @@
   $ hg add plain
   $ hg commit -i -d '7 0' -m plain plain<<EOF
   > y
+  > y
   > EOF
   diff --git a/plain b/plain
   new file mode 100644
   examine changes to 'plain'? [Ynesfdaq?] y
   
+  @@ -0,0 +1,10 @@
+  +1
+  +2
+  +3
+  +4
+  +5
+  +6
+  +7
+  +8
+  +9
+  +10
+  record this change to 'plain'? [Ynesfdaq?] y
+  
   $ hg tip -p
   changeset:   7:11fb457c1be4
   tag:         tip
@@ -315,6 +329,7 @@
   > y
   > y
   > y
+  > y
   > EOF
   diff --git a/plain b/plain
   1 hunks, 1 lines changed
@@ -333,6 +348,10 @@
   new file mode 100644
   examine changes to 'plain2'? [Ynesfdaq?] y
   
+  @@ -0,0 +1,1 @@
+  +1
+  record change 2/2 to 'plain2'? [Ynesfdaq?] y
+  
 Modify beginning, trim end, record both, add another file to test
 changes numbering
 
@@ -1406,4 +1425,41 @@
   date:        Thu Jan 01 00:00:23 1970 +0000
   summary:     moving_files
   
+Editing patch of newly added file
+
+  $ hg update -C .
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cat > editor.sh << '__EOF__'
+  > cat "$1"  | sed "s/first/very/g"  > tt
+  > mv tt  "$1"
+  > __EOF__
+  $ cat > newfile << '__EOF__'
+  > This is the first line
+  > This is the second line
+  > This is the third line
+  > __EOF__
+  $ hg add newfile
+  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -d '23 0' -medit-patch-new <<EOF
+  > y
+  > e
+  > EOF
+  diff --git a/newfile b/newfile
+  new file mode 100644
+  examine changes to 'newfile'? [Ynesfdaq?] y
+  
+  @@ -0,0 +1,3 @@
+  +This is the first line
+  +This is the second line
+  +This is the third line
+  record this change to 'newfile'? [Ynesfdaq?] e
+  
+  $ hg cat -r tip newfile
+  This is the very line
+  This is the second line
+  This is the third line
+
+  $ cat newfile
+  This is the first line
+  This is the second line
+  This is the third line
   $ cd ..