mercurial/wireproto.py
changeset 37353 ac666c5c2e0c
parent 37320 39f7d4ee8bcd
child 37393 afcfdf53e4b5
equal deleted inserted replaced
37352:92171562c7f3 37353:ac666c5c2e0c
  1012 
  1012 
  1013 @wireprotocommand('lookup', 'key', permission='pull')
  1013 @wireprotocommand('lookup', 'key', permission='pull')
  1014 def lookup(repo, proto, key):
  1014 def lookup(repo, proto, key):
  1015     try:
  1015     try:
  1016         k = encoding.tolocal(key)
  1016         k = encoding.tolocal(key)
  1017         c = repo[k]
  1017         n = repo.lookup(k)
  1018         r = c.hex()
  1018         r = hex(n)
  1019         success = 1
  1019         success = 1
  1020     except Exception as inst:
  1020     except Exception as inst:
  1021         r = stringutil.forcebytestr(inst)
  1021         r = stringutil.forcebytestr(inst)
  1022         success = 0
  1022         success = 0
  1023     return wireprototypes.bytesresponse('%d %s\n' % (success, r))
  1023     return wireprototypes.bytesresponse('%d %s\n' % (success, r))