Mercurial > public > mercurial-scm > hg-stable
diff hgext/lfs/pointer.py @ 37986:32bc3815efae
stringutil: flip the default of pprint() to bprefix=False
If we use pprint() as a drop-in replacement for repr(), bprefix=False is more
appropriate. Let's make it the default to remove bprefix=False noise.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 10 May 2018 21:08:32 +0900 |
parents | fb6226c15e54 |
children | aa10675c5dd6 |
line wrap: on
line diff
--- a/hgext/lfs/pointer.py Thu May 10 21:00:58 2018 +0900 +++ b/hgext/lfs/pointer.py Thu May 10 21:08:32 2018 +0900 @@ -35,9 +35,8 @@ try: return cls(l.split(' ', 1) for l in text.splitlines()).validate() except ValueError: # l.split returns 1 item instead of 2 - raise InvalidPointer( - _('cannot parse git-lfs text: %s') % stringutil.pprint( - text, bprefix=False)) + raise InvalidPointer(_('cannot parse git-lfs text: %s') + % stringutil.pprint(text)) def serialize(self): sortkeyfunc = lambda x: (x[0] != 'version', x) @@ -66,14 +65,14 @@ for k, v in self.iteritems(): if k in self._requiredre: if not self._requiredre[k].match(v): - raise InvalidPointer(_('unexpected value: %s=%s') % ( - k, stringutil.pprint(v, bprefix=False))) + raise InvalidPointer(_('unexpected value: %s=%s') + % (k, stringutil.pprint(v))) requiredcount += 1 elif not self._keyre.match(k): raise InvalidPointer(_('unexpected key: %s') % k) if not self._valuere.match(v): - raise InvalidPointer(_('unexpected value: %s=%s') % ( - k, stringutil.pprint(v, bprefix=False))) + raise InvalidPointer(_('unexpected value: %s=%s') + % (k, stringutil.pprint(v))) if len(self._requiredre) != requiredcount: miss = sorted(set(self._requiredre.keys()).difference(self.keys())) raise InvalidPointer(_('missed keys: %s') % ', '.join(miss))