This is an archive of the discontinued Mercurial Phabricator instance.

localrepo: ensure we properly %-format int in exception throw
ClosedPublic

Authored by durin42 on Oct 14 2018, 11:07 AM.

Details

Summary

I'm not thrilled with this, but it'll do.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

durin42 created this revision.Oct 14 2018, 11:07 AM
yuja added a subscriber: yuja.Oct 15 2018, 11:18 AM
    raise error.FilteredRepoLookupError(_("filtered revision '%s'")
                                        % pycompat.bytestr(changeid))
except (IndexError, LookupError):

+ if isinstance(changeid, int):
+ raise error.RepoLookupError(
+ _("unknown revision '%d'") % changeid)

raise error.RepoLookupError(_("unknown revision '%s'") % changeid)

Use pycompat.bytestr(changeid)? It's worked around as such just a few lines
above.

durin42 retitled this revision from localrepo: ensure we properly %-format ints vs strings in exception throw to localrepo: ensure we properly %-format int in exception throw.Oct 16 2018, 1:12 PM
durin42 updated this revision to Diff 12173.
This revision was automatically updated to reflect the committed changes.