diff mercurial/hg.py @ 7045:e51c0f41f271

Escape '%' when writing to hgrc (issue1199) Fixes clone with paths containing '%'. Patch provided by mjc.
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Sat, 20 Sep 2008 15:00:58 +0200 (2008-09-20)
parents 0750f11152fe
children 25961e53a07f f82938c87b92
line wrap: on
line diff
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -239,7 +239,8 @@
         if dest_repo.local():
             fp = dest_repo.opener("hgrc", "w", text=True)
             fp.write("[paths]\n")
-            fp.write("default = %s\n" % abspath)
+            # percent needs to be escaped for ConfigParser
+            fp.write("default = %s\n" % abspath.replace('%', '%%'))
             fp.close()
 
             if update: