Mercurial > public > mercurial-scm > hg
diff hgext/mq.py @ 14464:00256f689f9c
mq: print "'foo' 'bar'", not "['foo', 'bar']" when showing guards
The internal list representation of guards was leaking into the
output. The guards were always printed using repr(guard) and that
style was kept.
When "hg qguard -l" prints several guards for a patch, it does so by
joining the names with " " and that style was used for the error
messages too.
author | Martin Geisler <mg@aragost.com> |
---|---|
date | Tue, 31 May 2011 08:47:16 +0200 |
parents | 7d367e8f892d |
children | 755aabb3eada |
line wrap: on
line diff
--- a/hgext/mq.py Fri May 27 12:42:36 2011 +0200 +++ b/hgext/mq.py Tue May 31 08:47:16 2011 +0200 @@ -455,13 +455,13 @@ guards = self.active() exactneg = [g for g in patchguards if g[0] == '-' and g[1:] in guards] if exactneg: - return False, exactneg[0] + return False, repr(exactneg[0]) pos = [g for g in patchguards if g[0] == '+'] exactpos = [g for g in pos if g[1:] in guards] if pos: if exactpos: - return True, exactpos[0] - return False, pos + return True, repr(exactpos[0]) + return False, ' '.join(map(repr, pos)) return True, '' def explain_pushable(self, idx, all_patches=False): @@ -479,11 +479,11 @@ write(_('allowing %s - no matching negative guards\n') % self.series[idx]) else: - write(_('allowing %s - guarded by %r\n') % + write(_('allowing %s - guarded by %s\n') % (self.series[idx], why)) if not pushable: if why: - write(_('skipping %s - guarded by %r\n') % + write(_('skipping %s - guarded by %s\n') % (self.series[idx], why)) else: write(_('skipping %s - no matching guards\n') % @@ -1114,7 +1114,7 @@ _("cannot push to a previous patch: %s") % patch) else: if reason: - reason = _('guarded by %r') % reason + reason = _('guarded by %s') % reason else: reason = _('no matching guards') self.ui.warn(_("cannot push '%s' - %s\n") % (patch, reason))