diff tests/test-amend-patch.t @ 3914:96945ea908df stable

branching: merge default into stable The stable branch of Mercurial core now contains Mercurial 4.7 so evolve branch policy requires this merge. The @ bookmark is in the right location, so people doing clone will get to the latest release.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 31 Jul 2018 12:52:06 +0200
parents 96bbea985b25
children 537fd9a86c06 900668a93629
line wrap: on
line diff
--- a/tests/test-amend-patch.t	Wed Jul 25 15:30:37 2018 -0700
+++ b/tests/test-amend-patch.t	Tue Jul 31 12:52:06 2018 +0200
@@ -1156,3 +1156,46 @@
 
 Nothing happens in that case we dont care about the node ID. Look the above 3-4
 tests to realize I was testing that too.
+
+Aborting by passing an empty patch file (issue5925)
+---------------------------------------------------
+
+  $ cat > editor.sh <<EOF
+  > #!/bin/sh
+  > cat > \$1 <<ENDOF
+  > ENDOF
+  > EOF
+
+  $ HGEDITOR="sh ./editor.sh" hg amend --patch
+  abort: empty patch file, amend aborted
+  [255]
+
+  $ hg exp
+  # HG changeset patch
+  # User RandomUser
+  # Date 123456 1200
+  #      Fri Jan 02 09:57:36 1970 -0020
+  # Branch stable
+  # Node ID f14ecd7121e63915ac93edbad7f60f605e62dd52
+  # Parent  fc57c20be380f2878f4db139dad66d6cfb42ec62
+  I am a message which is testing change of message
+  
+  diff --git a/a b/a
+  new file mode 100755
+  --- /dev/null
+  +++ b/a
+  @@ -0,0 +1,3 @@
+  +Gello
+  +Kello
+  +betto
+
+  $ hg parents
+  changeset:   18:f14ecd7121e6
+  branch:      stable
+  bookmark:    foo
+  tag:         tip
+  parent:      3:fc57c20be380
+  user:        RandomUser
+  date:        Fri Jan 02 09:57:36 1970 -0020
+  summary:     I am a message which is testing change of message
+