[PATCH RFC] clone: copy hgrc paths if source and dest are local
Adrian Buehlmann
adrian at cadifra.com
Sun Jun 13 08:32:37 CDT 2010
On 13.06.2010 15:28, Adrian Buehlmann wrote:
> # HG changeset patch
> # User Adrian Buehlmann <adrian at cadifra.com>
> # Date 1276435473 -7200
> # Node ID 237a4167922c61f1ac6ad68e6fcf62a3f15c446f
> # Parent 285bcf40e04bf8ec0980d3238a4d71e886054ed9
> clone: copy hgrc paths if source and dest are local
>
> diff --git a/mercurial/hg.py b/mercurial/hg.py
> --- a/mercurial/hg.py
> +++ b/mercurial/hg.py
> @@ -344,6 +344,10 @@ def clone(ui, source, dest=None, pull=Fa
> fp = dest_repo.opener("hgrc", "w", text=True)
> fp.write("[paths]\n")
> fp.write("default = %s\n" % abspath)
> + if src_repo.local():
> + for n, p in src_repo.ui.configitems('paths'):
> + if n != 'default':
> + fp.write("%s = %s\n" % (n, p))
> fp.close()
>
> dest_repo.ui.setconfig('paths', 'default', abspath)
Would this make sense?
If yes, I'll run/update the tests.
More information about the Mercurial-devel
mailing list