[PATCH] patchbomb: fix From_ in the message's envelope

Cedric Duval cedricduval at free.fr
Mon Jul 6 08:35:09 CDT 2009


Hi Greg,

Greg Ward wrote:
> > The problem is that AFAIK apart from the C/POSIX locale, no locale is
> > guaranteed to exist on a system. Such a test would only be effective
> > for a system with the given locale.
>
> Oh.  Right.  Yeah.  Of course.
>
> How about a comment in the code reminding anyone who touches that line
> to run a manual test along the lines of
>
>   LANG=xx hg email

I have been thinking of another way. If the locale [1] tool is available,
it will be used to query the locales present on the system, and pick
a non-C/POSIX locale out of them if any to perform the test, or skip it.

Something like that:
  locale -a | sed '/^C$/d;/^POSIX$/d' | sed -n '1p'

I will write the test tonight.

 1. http://www.opengroup.org/onlinepubs/7990989775/xcu/locale.html


# HG changeset patch
# User Cédric Duval <cedricduval at free.fr>
# Date 1246859760 -7200
# Node ID b797e6108def48ecfa241af7cd50451b33271f9a
# Parent  8761863c3118bfd1627c5e66b7ea29f131188ea4
hghave: check for locale querying tool

diff --git a/tests/hghave b/tests/hghave
--- a/tests/hghave
+++ b/tests/hghave
@@ -113,6 +113,9 @@
     except ImportError:
         return False
 
+def has_locale():
+    return matchoutput('locale', r'^LANG=')
+
 def has_lsprof():
     try:
         import _lsprof
@@ -190,6 +193,7 @@
     "hotshot": (has_hotshot, "python hotshot module"),
     "icasefs": (has_icasefs, "case insensitive file system"),
     "inotify": (has_inotify, "inotify extension support"),
+    "locale": (has_locale, "locales querying tool"),
     "lsprof": (has_lsprof, "python lsprof module"),
     "mtn": (has_mtn, "monotone client (> 0.31)"),
     "outer-repo": (has_outer_repo, "outer repo"),


More information about the Mercurial-devel mailing list