[PATCH] dispatch: abort when specifying repository on norepo commands

Laurens Holst laurens.nospam at grauw.nl
Wed Dec 21 15:40:14 CST 2011


Op 21-12-2011 22:22, Matt Mackall schreef:
> On Tue, 2011-12-20 at 20:59 +0100, Laurens Holst wrote:
>> # HG changeset patch
>> # User Laurens Holst<laurens.hg at grauw.nl>
>> # Date 1324409721 -3600
>> # Node ID c153131ce1fc1de11b8725785a51345b8dfa1930
>> # Parent  21eb048edc19a9b78ae262d222c0de1f3ad6c4d2
>> dispatch: abort when specifying repository on norepo commands
> Not sure about this.
>
>> For (norepo) commands where this option does not apply the option is
>> currently
>> ignored, which results in an unintended state that the user has to clean
>> up. For
>> example “hg init -R test” will not create a repo in directory “test” but
>> in “.”.
> Definitionally, I don't see why it should. This is why --cwd exists and
> is distinct from -R. Consider:
>
> $ hg -R hg st .
> abort: . not under root
>
> $ hg --cwd hg st .
> ? changes.txt

Oh not arguing that it should work, -R is rightfully ignored :). I just 
meant to illustrate the human intent when someone writes “hg init -R 
test”, what they really wanted to write is “hg init test” (Of course I 
did this myself :).). Because -R makes no sense at all here it is very 
likely a mistake, and I think Mercurial shouldn’t just carry along and 
do its thing in the current directory.

~Laurens

-- 
~~ Ushiko-san! Kimi wa doushite, Ushiko-san nan da!! ~~
Laurens Holst, developer, Utrecht, the Netherlands
Website: www.grauw.nl. Working @ www.roughcookie.com


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4332 bytes
Desc: S/MIME cryptografische ondertekening
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20111221/40d2bed9/attachment.bin>


More information about the Mercurial-devel mailing list