Re: done feature in remote-helpers (was Re: [PATCH 2/2] Add a remote helper to interact with mediawiki (fetch & push))
- From
Sverre Rabbelier <srabbelier@gmail.com>
- Date
- Aug 31, 2011, 12:58 UTC
- Message-ID
- <CAGdFq_hFPBeogpX0Qp8Knfssw8QzV+GwCAyH+zZhM2iEJfFYMw@mail.gmail.com>
- In-Reply-To
- <vpqk49tviza.fsf@bauges.imag.fr>
Heya,
On Wed, Aug 31, 2011 at 14:55, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
Show 20 quoted lines
> Err, no, it isn't. From git-remote-testgit.py:
>
> def do_import(repo, args):
> [...]
> while True:
> line = sys.stdin.readline()
> [...]
> # strip of leading 'import '
> ref = line[7:].strip()
> refs.append(ref)
>
> repo = update_local_repo(repo)
> repo.exporter.export_repo(repo.gitdir, refs)
>
> print "done"
>
> What it does is that it reads multiple "import" commands, and process
> them all at once, with a single "print done" at the end. Actually,
> testgit would die("Expected import line.") if Git sent another command
> after "import".Ah, see, this is why in my original version the syntax was:
import refs/heads/master refs/heads/next \n
Instead of the current:
import refs/heads/master import refs/heads/next \n
You can have multiple imports in the current system, you just need to remember to add the trailing newline.
import refs/heads/master \n import refs/heads/next \n
In the above case you'll have to have two done commands.
-- Cheers, Sverre Rabbelier