comparison hgext/win32text.py @ 1300:e58b1c9a0dec

Rename mercurial.ext to hgext.
author Bryan O'Sullivan <bos@serpentine.com>
date Wed, 21 Sep 2005 15:17:24 -0700
parents mercurial/ext/win32text.py@496074e0a38b
children 30762680fcd2
comparison
equal deleted inserted replaced
1299:3822f1910c35 1300:e58b1c9a0dec
1 import mercurial.util
2
3 def dumbdecode(s, cmd):
4 return s.replace('\n', '\r\n')
5
6 def dumbencode(s, cmd):
7 return s.replace('\r\n', '\n')
8
9 def clevertest(s, cmd):
10 if '\0' in s: return False
11 return True
12
13 def cleverdecode(s, cmd):
14 if clevertest(s, cmd):
15 return dumbdecode(s, cmd)
16 return s
17
18 def cleverencode(s, cmd):
19 if clevertest(s, cmd):
20 return dumbencode(s, cmd)
21 return s
22
23 mercurial.util.filtertable.update({
24 'dumbdecode:': dumbdecode,
25 'dumbencode:': dumbencode,
26 'cleverdecode:': cleverdecode,
27 'cleverencode:': cleverencode,
28 })