mercurial/wireproto.py
changeset 31451 53865692a354
parent 31146 16d8bec0177d
child 32260 d0d9a4fca59b
--- a/mercurial/wireproto.py	Mon Mar 13 09:24:53 2017 -0700
+++ b/mercurial/wireproto.py	Wed Mar 15 23:06:50 2017 +0900
@@ -900,7 +900,7 @@
 def pushkey(repo, proto, namespace, key, old, new):
     # compatibility with pre-1.8 clients which were accidentally
     # sending raw binary nodes rather than utf-8-encoded hex
-    if len(new) == 20 and new.encode('string-escape') != new:
+    if len(new) == 20 and util.escapestr(new) != new:
         # looks like it could be a binary node
         try:
             new.decode('utf-8')