crecord: add dictionary to default return value of filterpatch
When committing interactively without changes, the user would get a ValueError
exception. This patch adds a dictionary to the return value of filterpatch
when there are no files to change.
--- a/mercurial/crecord.py Wed Dec 02 16:12:15 2015 -0800
+++ b/mercurial/crecord.py Wed Dec 09 17:01:27 2015 -0800
@@ -451,7 +451,7 @@
# if there are no changed files
if len(headers) == 0:
- return []
+ return [], {}
uiheaders = [uiheader(h) for h in headers]
# let user choose headers/hunks/lines, and mark their applied flags
# accordingly
--- a/tests/test-commit-interactive-curses.t Wed Dec 02 16:12:15 2015 -0800
+++ b/tests/test-commit-interactive-curses.t Wed Dec 09 17:01:27 2015 -0800
@@ -41,6 +41,10 @@
date: Thu Jan 01 00:00:00 1970 +0000
summary: a
+Check that commit -i works with no changes
+ $ hg commit -i
+ no changes to record
+
Committing only one file
$ echo "a" >> a