[darcs-devel] [issue1790] `darcs send -o patch --context=ctx` need a dummy repository name

Loup Vaillant bugs at darcs.net
Tue Mar 23 12:53:04 UTC 2010


New submission from Loup Vaillant <l at loup-vaillant.fr>:

(version 2.2.0, Ubuntu 9.04)

This bites when my repository doesn't have a ./_darcs/pref/defaultrepo
file. It is so on new repositories and copies of it (with cp -r).

Example of a shell session:

    $ rm -f _darcs/prefs/defaultrepo
    $ darcs send -a -o patch --context=ctx
    
    darcs failed:  Missing argument:  [REPOSITORY]
    Usage: darcs send [OPTION]... [REPOSITORY]
    Send by email a bundle of one or more patches.
    
    See darcs help send for details.
    $ darcs send -a -o patch --context=ctx /dev/null/no-such-repository
    Wrote patch to /home/loup/patch
    $ echo /dev/null/no-such-repository >_darcs/prefs/defaultrepo
    $ darcs send -a -o patch --context=ctx
    Wrote patch to /home/loup/patch
    $

When the --context option is used, I expect `darcs send` to succeed even
when no reference repository is specified (as argument or as default).

Speculation:

It looks like Darcs checks 2 things separately:

  1. The presence of a reference repository name (as default or as argument)
  2. The actual existence of such a reference repository

Of these two things, Darcs checks (1) no matter what, and checks (2)
only when needed. I think (1) just happens too early (before we know of
the context file), and therefore is too prudent. I suspect this error
were possible because (1) and (2) are separated in the source code.
Maybe there is a way to put them back together?

----------
messages: 10450
nosy: darcs-devel, dmitry.kurochkin, loup-vaillant
status: unknown
title: `darcs send -o patch --context=ctx` need a dummy repository name

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue1790>
__________________________________


More information about the darcs-devel mailing list