From: Antoine Pelisse <apelisse@gmail.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: "Jörn Hees" <dev@joernhees.de>, git <git@vger.kernel.org>,
"Junio C Hamano" <gitster@pobox.com>
Subject: Re: [PATCH] remote-hg: Fix cloning and sharing bug
Date: Sun, 4 Aug 2013 15:59:56 +0200 [thread overview]
Message-ID: <CALWbr2zYD-ELajVkybQfbqXTJSu67K=Y1v3SdtTgCPZHaO46BA@mail.gmail.com> (raw)
In-Reply-To: <CAMP44s2DhS=B3fTD-FCrkUK=h4hWuBN6n6mqEws2qh=YiBegJw@mail.gmail.com>
> --- a/contrib/remote-helpers/git-remote-hg.py
> +++ b/contrib/remote-helpers/git-remote-hg.py
> @@ -391,11 +391,22 @@ def get_repo(url, alias):
> os.makedirs(dirname)
> else:
> shared_path = os.path.join(gitdir, 'hg')
> - if not os.path.exists(shared_path):
> - try:
> - hg.clone(myui, {}, url, shared_path, update=False, pull=True)
> - except:
> - die('Repository error')
> +
> + # check and upgrade old organization
> + hg_path = os.path.join(shared_path, '.hg')
> + if os.path.exists(shared_path) and not os.path.exists(hg_path):
> + repos = os.listdir(shared_path)
> + for x in repos:
> + local_hg = os.path.join(shared_path, x, 'clone', '.hg')
> + if not os.path.exists(local_hg):
> + continue
> + shutil.copytree(local_hg, hg_path)
> +
> + # setup shared repo (if not there)
> + try:
> + hg.peer(myui, {}, shared_path, create=True)
> + except error.RepoError:
> + pass
>
> if not os.path.exists(dirname):
> os.makedirs(dirname)
>
> It should also work in all the cases, but there would not be an extra
> unnecessary clone while upgrading, and it doesn't sneak in any other
> changes.
That's fine with me. Indeed, we can think about "cloning local repos"
in a separate thread if needed. I clearly don't have a strong opinion
about that.
Would you mind squashing your changes into a patch ?
Cheers,
next prev parent reply other threads:[~2013-08-04 14:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-25 0:42 [PATCH v3] remotes-hg: bugfix for fetching non local remotes Joern Hees
2013-07-25 19:12 ` Felipe Contreras
2013-07-25 19:53 ` Antoine Pelisse
2013-07-25 20:40 ` Felipe Contreras
2013-07-25 21:10 ` Antoine Pelisse
2013-07-26 1:30 ` Junio C Hamano
2013-07-26 12:17 ` Jörn Hees
2013-08-04 10:38 ` [PATCH] remote-hg: Fix cloning and sharing bug Antoine Pelisse
2013-08-04 12:17 ` Jörn Hees
2013-08-04 13:31 ` Felipe Contreras
2013-08-04 13:51 ` Jörn Hees
2013-08-04 14:00 ` Felipe Contreras
2013-08-04 13:59 ` Antoine Pelisse [this message]
2013-08-04 14:24 ` Felipe Contreras
2013-08-04 13:22 ` Felipe Contreras
2013-07-26 12:16 ` [PATCH v3] remotes-hg: bugfix for fetching non local remotes Jörn Hees
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CALWbr2zYD-ELajVkybQfbqXTJSu67K=Y1v3SdtTgCPZHaO46BA@mail.gmail.com' \
--to=apelisse@gmail.com \
--cc=dev@joernhees.de \
--cc=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).