[PATCH] man 5 hgrc implied you need to use external tools to do CRLF translation

Jesse Glick Jesse.Glick at Sun.COM
Wed Dec 19 17:29:47 CST 2007


# HG changeset patch
# User Jesse Glick <jesse.glick at sun.com>
# Date 1198106434 18000
# Node ID d1c926ad7ac38837d241c1b3a15b20761effd1d7
# Parent  9d6ad26fab10e06768858ed1a74eff80207cb0f5
man 5 hgrc implied you need to use external tools to do CRLF translation.
This is no longer true; win32text provides a much better in-process alternative.

diff -r 9d6ad26fab10 -r d1c926ad7ac3 contrib/win32/mercurial.ini
--- a/contrib/win32/mercurial.ini	Tue Dec 18 15:40:46 2007 -0600
+++ b/contrib/win32/mercurial.ini	Wed Dec 19 18:20:34 2007 -0500
@@ -27,7 +27,7 @@ hgext.win32text =
 ; Alternatively, you can explicitly specify each file extension that
 ; you want encoded (any you omit will be left untouched), like this:
 
-; *.txt = dumbencode:
+; **.txt = dumbencode:
 
 
 [decode]
diff -r 9d6ad26fab10 -r d1c926ad7ac3 doc/hgrc.5.txt
--- a/doc/hgrc.5.txt	Tue Dec 18 15:40:46 2007 -0600
+++ b/doc/hgrc.5.txt	Wed Dec 19 18:20:34 2007 -0500
@@ -124,21 +124,26 @@ decode/encode::
 
   NOTE: the tempfile mechanism is recommended for Windows systems,
   where the standard shell I/O redirection operators often have
-  strange effects.  In particular, if you are doing line ending
-  conversion on Windows using the popular dos2unix and unix2dos
-  programs, you *must* use the tempfile mechanism, as using pipes will
-  corrupt the contents of your files.
+  strange effects and may corrupt the contents of your files.
 
-  Tempfile example:
+  The most common usage is for LF <-> CRLF translation on Windows.
+  For this, use the "smart" convertors which check for binary files:
 
+    [extensions]
+    hgext.win32text =
     [encode]
-    # convert files to unix line ending conventions on checkin
-    **.txt = tempfile: dos2unix -n INFILE OUTFILE
+    ** = cleverencode:
+    [decode]
+    ** = cleverdecode:
 
+  or if you only want to translate certain files:
+
+    [extensions]
+    hgext.win32text =
+    [encode]
+    **.txt = dumbencode:
     [decode]
-    # convert files to windows line ending conventions when writing
-    # them to the working dir
-    **.txt = tempfile: unix2dos -n INFILE OUTFILE
+    **.txt = dumbdecode:
 
 defaults::
   Use the [defaults] section to define command defaults, i.e. the


More information about the Mercurial-devel mailing list