Mercurial > public > mercurial-scm > hg
comparison mercurial/wireproto.py @ 12085:6f833fc3ccab
Consistently import foo as foomod when foo to avoid shadowing
This is in the style of 5f091fc1bab7.
author | Martin Geisler <mg@aragost.com> |
---|---|
date | Mon, 30 Aug 2010 14:38:24 +0200 |
parents | 516b000fbb7e |
children | d7fff529d85d |
comparison
equal
deleted
inserted
replaced
12084:ff7c1118a83a | 12085:6f833fc3ccab |
---|---|
8 import urllib, tempfile, os, sys | 8 import urllib, tempfile, os, sys |
9 from i18n import _ | 9 from i18n import _ |
10 from node import bin, hex | 10 from node import bin, hex |
11 import changegroup as changegroupmod | 11 import changegroup as changegroupmod |
12 import repo, error, encoding, util, store | 12 import repo, error, encoding, util, store |
13 import pushkey as pushkey_ | 13 import pushkey as pushkeymod |
14 | 14 |
15 # list of nodes encoding / decoding | 15 # list of nodes encoding / decoding |
16 | 16 |
17 def decodelist(l, sep=' '): | 17 def decodelist(l, sep=' '): |
18 return map(bin, l.split(sep)) | 18 return map(bin, l.split(sep)) |
200 capabilities: space separated list of tokens | 200 capabilities: space separated list of tokens |
201 ''' | 201 ''' |
202 return "capabilities: %s\n" % (capabilities(repo, proto)) | 202 return "capabilities: %s\n" % (capabilities(repo, proto)) |
203 | 203 |
204 def listkeys(repo, proto, namespace): | 204 def listkeys(repo, proto, namespace): |
205 d = pushkey_.list(repo, namespace).items() | 205 d = pushkeymod.list(repo, namespace).items() |
206 t = '\n'.join(['%s\t%s' % (k.encode('string-escape'), | 206 t = '\n'.join(['%s\t%s' % (k.encode('string-escape'), |
207 v.encode('string-escape')) for k, v in d]) | 207 v.encode('string-escape')) for k, v in d]) |
208 return t | 208 return t |
209 | 209 |
210 def lookup(repo, proto, key): | 210 def lookup(repo, proto, key): |
215 r = str(inst) | 215 r = str(inst) |
216 success = 0 | 216 success = 0 |
217 return "%s %s\n" % (success, r) | 217 return "%s %s\n" % (success, r) |
218 | 218 |
219 def pushkey(repo, proto, namespace, key, old, new): | 219 def pushkey(repo, proto, namespace, key, old, new): |
220 r = pushkey_.push(repo, namespace, key, old, new) | 220 r = pushkeymod.push(repo, namespace, key, old, new) |
221 return '%s\n' % int(r) | 221 return '%s\n' % int(r) |
222 | 222 |
223 def _allowstream(ui): | 223 def _allowstream(ui): |
224 return ui.configbool('server', 'uncompressed', True, untrusted=True) | 224 return ui.configbool('server', 'uncompressed', True, untrusted=True) |
225 | 225 |