Patchwork [3,of,7] httppeer: make a message translatable

login
register
mail settings
Submitter Katsunori FUJIWARA
Date May 25, 2016, 5:01 p.m.
Message ID <83f1b23d01f837f5783a.1464195702@feefifofum>
Download mbox | patch
Permalink /patch/15203/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - May 25, 2016, 5:01 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1464195454 -32400
#      Thu May 26 01:57:34 2016 +0900
# Node ID 83f1b23d01f837f5783af1d804d2ba0ec2523bc3
# Parent  b6c75aa89aa7c51fd324d3201e9e945baafa1250
httppeer: make a message translatable

This message has been overlooked by check-code, because it starts with
non-alphabet character ('(').

Making this message translatable seems reasonable, because exception
message below in same function is already translatable

  - 'cannot create new http repository'

This is also a part of preparation for making "missing _() in ui
message" detection of check-code more exact.

Patch

diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py
--- a/mercurial/httppeer.py
+++ b/mercurial/httppeer.py
@@ -302,7 +302,7 @@  def instance(ui, path, create):
     except error.RepoError as httpexception:
         try:
             r = statichttprepo.instance(ui, "static-" + path, create)
-            ui.note('(falling back to static-http)\n')
+            ui.note(_('(falling back to static-http)\n'))
             return r
         except error.RepoError:
             raise httpexception # use the original http RepoError instead