[darcs-devel] [issue2529] Darcs doesn't always return an error code when unable to find a patch
Gian Piero Carrubba
bugs at darcs.net
Sat Mar 25 17:00:02 UTC 2017
New submission from Gian Piero Carrubba <gpiero at rm-rf.it>:
When darcs expect an option to match a number of patches, it doesn't
return any error if cannot find any matching patches. This is in
contrast for when the option is expected to match a single patch.
Some examples should clarify better than I could.
$ darcs initialize R
$ cd R
$ darcs log --patches xxx ; echo rc=$?
rc=0
'--patches' is expected to match many patches and does not return an
error when the list of results is empty. On the other hand,
'--from-patch' is expected to match a single patch (as the start of the
range) and it DOES return an error if it does not succeed:
$ darcs log --from-patch xxx ; echo rc=$?
darcs-screened: Couldn't find patch matching "patch-name xxx"
CallStack (from HasCallStack):
error, called at src/Darcs/Patch/Match.hs:654:43 in
darcs-2.13.0-8gUFVFHnEqLKewBqd2XTAf:Darcs.Patch.Match
rc=1
The same applies to all commands. For example:
$ darcs rebase suspend --tags xxx ; echo rc=$?
No patches selected!
Rebase finished!
rc=0
$ darcs clone --tag xxx . ../S ; echo rc=$?
WARNING: creating a nested repository.
Copying patches, to get lazy repository hit ctrl-C...
Going to specified version...
darcs-screened: Couldn't find a tag matching "tag-name xxx"
CallStack (from HasCallStack):
error, called at src/Darcs/Patch/Match.hs:665:43 in
darcs-2.13.0-8gUFVFHnEqLKewBqd2XTAf:Darcs.Patch.Match
rc=1
(please also note that the last case is a bit misleading, as the clone
succeeds, but it behaves as if the '--tag' option wasn't passed).
Thanks,
Gian Piero.
$ darcs --version
2.13.0 (unknown)
$ darcs --exact-version
darcs compiled on Mar 24 2017, at 22:28:36
Context:
[show repo: fixed formatting (boringfile Pref overflowed alignment)
Ben Franksen <benjamin.franksen at helmholtz-berlin.de>**20170323124112
Ignore-this: 4f800e377ce5b6aecd3a15b8c546ff74
]
----------
messages: 19396
nosy: gpiero
status: unknown
title: Darcs doesn't always return an error code when unable to find a patch
__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue2529>
__________________________________
More information about the darcs-devel
mailing list