crecord: add dictionary to default return value of filterpatch
authorLaurent Charignon <lcharignon@fb.com>
Wed, 09 Dec 2015 17:01:27 -0800
changeset 27321 dcdf0a52ad36
parent 27319 b64b6fdc5c9b
child 27322 84e85f461b79
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.
mercurial/crecord.py
tests/test-commit-interactive-curses.t
--- 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