# HG changeset patch # User Patrick Mezard # Date 2007-12-25 21:21:51 # Node ID a0eb8a418442958b340f87dbae7e026555f88750 # Parent ca4f10c76ea730ffdf2b1b629f8f09a0a390b741 patch: be more tolerant to diffstat failures (issue 865) Sometimes, revisions cannot be represented by a regular diff, only a git diff would capture binary files or permission changes. diffstat cannot handle git patches and will output "0 files changed" when fed with an empty diff. We cannot consider the latter to be an error, unless we rewrite diffstat to handle these correctly. diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -1351,7 +1351,6 @@ def diffstat(patchlines): last = stat.pop() stat.insert(0, last) stat = ''.join(stat) - if stat.startswith('0 files'): raise ValueError return stat except: raise finally: