changeset 21958:9663a7855798 stable

convert: fix argument mismatch at formatting the abort message This patch fixes argument mismatch at formatting the abort message, introduced by a204fd9b5ba9: the last '%s' doesn't have corresponded argument. This patch uses "unexpected size" in the abort message, to distinguish the reason of failure from "unexpected type" failure checked in the prior code path below: if info[1] != type: raise util.Abort(_('cannot read %r object at %s') % (type, rev))
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Fri, 01 Aug 2014 02:14:24 +0900
parents 2122b82b6987
children dccbf52ffe9f
files hgext/convert/git.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/git.py	Thu Jul 31 10:31:56 2014 +0100
+++ b/hgext/convert/git.py	Fri Aug 01 02:14:24 2014 +0900
@@ -127,7 +127,8 @@
         size = int(info[2])
         data = self.catfilepipe[1].read(size)
         if len(data) < size:
-            raise util.Abort(_('cannot read %r object at %s: %s') % (type, rev))
+            raise util.Abort(_('cannot read %r object at %s: unexpected size')
+                             % (type, rev))
         # read the trailing newline
         self.catfilepipe[1].read(1)
         return data