Commits

Katsunori FUJIWARA  committed 25c9f0b

eliminate "mercurial.util.normcase" fromuniguard target, and adjust patch description

  • Participants
  • Parent commits 2482f06

Comments (0)

Files changed (1)

File win32mbcs-on-all-platform.patch

 # HG changeset patch
 # Parent f36f11f2bfce0c5fb1581e0074eba2ef88f359e7
-win32mbcs: available win32mbcs on all platform to run tests 
-
-After applying this patch on the revision which you want to test, you
-can run test enabling win32mbcs always by:
-
-    make TESTFLAGS="--extra-config-opt extensions.win32mbcs=" tests
-
-This patch changes points below to enable win32mbcs on all platform:
-
-  - add "ascii" and "utf-8" to "problematic_encodings" list to enable
-    win32mbcs for any encodings
-
-  - avoid "os.path.supports_unicode_filenames" and "sys.platform"
-    checking
-
-  - skip wrapping function if target module is not loaded yet: on some
-    posix environments, "mercurial.osutil" is not yet loaded when
-    extsetup() of win32mbcs is executed.
-
-In addition to them, this patch adds "uniguard()" wrapping to examine
-whether target function is invoked unexpectedly with unicode object or
-not.
-
-In wrapping target functions of win32mbcs, "mercurial.util.fspath()"
-is the only function which may invokes other internal mercurial APIs.
-And such callees of "mercurial.util.fspath()" are limited to
-"mercurial.encoding.lower", "mercurial.encoding.upper" and
-"mercurial.util.normcase", now (@2012/09/30).
-
-This patch guards them not to be invoked with unicode object
+win32mbcs: available win32mbcs on all platform to run tests
+
+After applying this patch on the revision which you want to test, you
+can run test enabling win32mbcs always by:
+
+    make TESTFLAGS="--extra-config-opt extensions.win32mbcs=" tests
+
+This patch changes points below to enable win32mbcs on all platform:
+
+  - add "ascii" and "utf-8" to "problematic_encodings" list to enable
+    win32mbcs for any encodings
+
+  - avoid "os.path.supports_unicode_filenames" and "sys.platform"
+    checking
+
+  - skip wrapping function if target module is not loaded yet: on some
+    posix environments, "mercurial.osutil" is not yet loaded when
+    extsetup() of win32mbcs is executed.
+
+In addition to them, this patch adds "uniguard()" wrapping to examine
+whether target function is invoked unexpectedly with unicode object or
+not.
+
+In wrapping target functions of win32mbcs, "mercurial.util.fspath()"
+is the only function which may invokes other internal mercurial APIs.
+And such (indirect) callees of "mercurial.util.fspath()" are limited
+to "mercurial.encoding.lower", "mercurial.encoding.upper" now
+(@2012/09/30).
+
+This patch guards them not to be invoked with unicode object
 arguments.
 
 diff -r f36f11f2bfce hgext/win32mbcs.py
 --- a/hgext/win32mbcs.py	Thu Sep 27 15:50:14 2012 -0500
-+++ b/hgext/win32mbcs.py	Sun Sep 30 02:13:46 2012 +0900
++++ b/hgext/win32mbcs.py	Sun Sep 30 03:24:30 2012 +0900
 @@ -45,6 +45,24 @@
  It is useful for the users who want to commit with UTF-8 log message.
  '''
      module = sys.modules[module]
      func = getattr(module, name)
      def f(*args, **kwds):
-@@ -138,16 +158,18 @@
+@@ -138,16 +158,17 @@
  
  # codec and alias names of sjis and big5 to be faked.
  problematic_encodings = '''big5 big5-tw csbig5 big5hkscs big5-hkscs
 +    # guard before win32mbcs wrapping
 +    uniguard("mercurial.encoding.lower")
 +    uniguard("mercurial.encoding.upper")
-+    uniguard("mercurial.util.normcase")
 +
      # TODO: decide use of config section for this extension
 -    if ((not os.path.supports_unicode_filenames) and
      # determine encoding for filename
      global _encoding
      _encoding = ui.config('win32mbcs', 'encoding', encoding.encoding)
-@@ -163,5 +185,4 @@
+@@ -163,5 +184,4 @@
          # command line options is not yet applied when
          # extensions.loadall() is called.
          if '--debug' in sys.argv: