mercurial/commands.py
changeset 310 273f6a01d18b
parent 309 61414da06fe5
child 312 09375250eb31
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -388,6 +388,9 @@ def patch(ui, repo, patch1, *patches, **
             if l[:4] == "--- ": break
             text += l
 
+        # make sure text isn't empty
+        if not text: text = "imported patch %s\n" % patch
+
         f = os.popen("lsdiff --strip %d %s" % (strip, pf))
         files = filter(None, map(lambda x: x.rstrip(), f.read().splitlines()))
         f.close()