Re: [PATCH] remote-hg: fix path when cloning with tilde expansion
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- Aug 9, 2013, 21:55 UTC
- Message-ID
- <CAMP44s13y39f-eCP1sBuMEedciU230C1O11+iMb1SHi45RnSNQ@mail.gmail.com>
- In-Reply-To
- <CALWbr2y5H_dfHAFW_qN+j8YtF4F9+VcG8G503hr4YN2Qv69CXA@mail.gmail.com>
On Fri, Aug 9, 2013 at 4:19 PM, Antoine Pelisse <apelisse@gmail.com> wrote:
Show 24 quoted lines
> Confusion everywhere :-) > > On Fri, Aug 9, 2013 at 10:53 PM, Junio C Hamano <gitster@pobox.com> wrote: >> Antoine Pelisse <apelisse@gmail.com> writes: >> >>> So when we run: >>> >>> git clone hg::~/my/repo >>> >>> Git will remove the "hg::" part, and Mercurial will expand tilde and >>> clone $HOME/my/repo. >> >> Now you confused me. If the implementation were for us to remove >> the hg:: prefix and let Mercurial do whatever it wants to do with >> the rest, you are right that we will not have to do any expansion >> like your patch. But you sent a patch to do so, so apparently it >> is not what happens. So where does it go wrong? >> >> Puzzled... > > OK, I think I see why you are puzzled. > > Cloning works fine because we "fix the path" *after* the clone is done > successfully, for the following reason:
So if we didn't store a different path, it would work. So instead of expanding '~' ourselves, it would be better to don't expand anything, and leave it as it is, but how to detect that in fix_path()?
-- Felipe Contreras