changeset 15925:f9fc46698352

wireproto: refuse to lookup secret csets
author Matt Mackall <mpm@selenic.com>
date Wed, 18 Jan 2012 20:00:48 -0600
parents 3f132207e92f
children f94513971767
files mercurial/wireproto.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/wireproto.py	Wed Jan 18 19:16:01 2012 -0600
+++ b/mercurial/wireproto.py	Wed Jan 18 20:00:48 2012 -0600
@@ -471,7 +471,11 @@
 
 def lookup(repo, proto, key):
     try:
-        r = hex(repo.lookup(encoding.tolocal(key)))
+        k = encoding.tolocal(key)
+        c = repo[k]
+        if c.phase() == phases.secret:
+            raise error.RepoLookupError(_("unknown revision '%s'") % k)
+        r = c.hex()
         success = 1
     except Exception, inst:
         r = str(inst)