git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antoine Pelisse <apelisse@gmail.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git <git@vger.kernel.org>, "Jörn Hees" <dev@joernhees.de>
Subject: Re: [PATCH 2/2] remote-hg: add shared repo upgrade
Date: Fri, 9 Aug 2013 22:19:56 +0200	[thread overview]
Message-ID: <CALWbr2yAitLSNGj2qwz4C8Ugm8wHnGTf4ndZSbPcFToczWaWEA@mail.gmail.com> (raw)
In-Reply-To: <1376078581-24766-3-git-send-email-felipe.contreras@gmail.com>

On Fri, Aug 9, 2013 at 10:03 PM, Felipe Contreras
<felipe.contreras@gmail.com> wrote:
> 6796d49 (remote-hg: use a shared repository store) introduced a bug by
> making the shared repository '.git/hg', which is already used before
> that patch, so clones that happened before that patch, fail after that
> patch, because there's no shared Mercurial repo.

Does that still hold ? You are creating the shared_path repository
just below, so it should work without the patch.
The real reason for this patch is to avoid having to re-clone from a
potential slow source, is it not ?

> +        # 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)
> +                break
> +

By the way, I liked my version better, that is:

if os.path.exists(local_hg):
    shutil.copytree(local_hg, hg_path)
    break

Simplifying the if not condition: continue else: break

>          # setup shared repo (if not there)
>          try:
>              hg.peer(myui, {}, shared_path, create=True)

  reply	other threads:[~2013-08-09 20:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-09 20:02 [PATCH 0/2] remote-hg: shared repo upgrade fix Felipe Contreras
2013-08-09 20:03 ` [PATCH 1/2] remote-hg: simplify shared repo setup Felipe Contreras
2013-08-09 20:03 ` [PATCH 2/2] remote-hg: add shared repo upgrade Felipe Contreras
2013-08-09 20:19   ` Antoine Pelisse [this message]
2013-08-09 20:24     ` Felipe Contreras
2013-08-09 21:47       ` Junio C Hamano

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALWbr2yAitLSNGj2qwz4C8Ugm8wHnGTf4ndZSbPcFToczWaWEA@mail.gmail.com \
    --to=apelisse@gmail.com \
    --cc=dev@joernhees.de \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
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 NNTP newsgroup(s).