Mercurial > hg
comparison mercurial/hg.py @ 7044: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 |
parents | 0750f11152fe |
children | f82938c87b92 25961e53a07f |
comparison
equal
deleted
inserted
replaced
7043:b714aac1f7b3 | 7044:e51c0f41f271 |
---|---|
237 dir_cleanup.close() | 237 dir_cleanup.close() |
238 | 238 |
239 if dest_repo.local(): | 239 if dest_repo.local(): |
240 fp = dest_repo.opener("hgrc", "w", text=True) | 240 fp = dest_repo.opener("hgrc", "w", text=True) |
241 fp.write("[paths]\n") | 241 fp.write("[paths]\n") |
242 fp.write("default = %s\n" % abspath) | 242 # percent needs to be escaped for ConfigParser |
243 fp.write("default = %s\n" % abspath.replace('%', '%%')) | |
243 fp.close() | 244 fp.close() |
244 | 245 |
245 if update: | 246 if update: |
246 dest_repo.ui.status(_("updating working directory\n")) | 247 dest_repo.ui.status(_("updating working directory\n")) |
247 if not checkout: | 248 if not checkout: |