convert: fix argument mismatch at formatting the abort message stable
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Fri, 01 Aug 2014 02:14:24 +0900
branchstable
changeset 21958 9663a7855798
parent 21957 2122b82b6987
child 21959 dccbf52ffe9f
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))
hgext/convert/git.py
--- 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