[PATCH] win32text: give deprecation warning

steve at borho.org steve at borho.org
Mon Oct 25 11:29:48 CDT 2010


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1288024172 18000
# Branch stable
# Node ID 73ccf37df7565a036d3807312492bacd2f9a9801
# Parent  d8205dacf9a3360093c7670b6436de3ed6a23db1
win32text: give deprecation warning

Users need to migrate to the EOL extension for various reasons.

Instructions for disabling the warning will be added to the
extension's wiki page.

diff -r d8205dacf9a3 -r 73ccf37df756 hgext/win32text.py
--- a/hgext/win32text.py
+++ b/hgext/win32text.py
@@ -158,9 +158,17 @@
 def forbidcr(ui, repo, hooktype, node, **kwargs):
     return forbidnewline(ui, repo, hooktype, node, '\r', **kwargs)
 
+deprwarn = True
 def reposetup(ui, repo):
     if not repo.local():
         return
+    global deprwarn
+    if deprwarn:
+        if ui.configbool('win32text', 'warn', True):
+            ui.warn(_("win32text is deprecated, see "
+                      "http://mercurial.selenic.com/wiki/Win32TextExtension\n"))
+        deprwarn = False
+
     for name, fn in _filters.iteritems():
         repo.adddatafilter(name, fn)
 


More information about the Mercurial-devel mailing list