On Wed, 29 Dec 2010, Joey Hess wrote:
faheem wrote:
Using current unstable etckeeper on lenny.
Suppose my /root/.hgrc lists a extension which is not available. In my
case it was
hg-prompt.prompt =
Then hg complains when it runs, of course. However, this doesn't
actually affect anything. However, etckeeper seems to see this as a
problem, and pops up a screen saying the commit failed to happen, when
in fact there is no problem. I assume it is looking at some exit
status to determine whether there is a problem? I think this is a bug.
You may disagree, in which case, feel free to close it. Thanks for
your work on etckeeper, and Happy Christmas and New Year!
etckeeper assumes that when $VCS commit returns a nonzero exit status,
the commit has failed. Of course that is not necessarily true, maybe
$VCS has been misconfigured such that it successfully commits and then
indicates failure. But etckeeper can't possibly tell. I don't see a bug
here.
Ok. I did some testing.
As was pointed out by Lasse V. Karlsen <la...@vkarlsen.no>, the error mercurial
gives for a missing extn is not reflected in its exit code, which is still 0,
as you can easily verify. I tested using Python
subprocess.call("some mercurial stuff")
I also verified again that the etckeeper error appears with the missing extn,
and goes away if it is removed. I didn't directly check that the error status
was 0 in this case (not sure how to), but I've no idea why it would not be.
For the record, the etckeeper error message is
"Commit failed An attempt to commit /etc changes to hg failed. You may
manually resolve the issues with the uncommitted changes before continuing."
I removed, reinstalled, and removed w3m. The first two times with the missing
extn, which produced the etckeeper error message. In all cases, the commit
succeeded.
Assuming hg's error codes when called by etckeeper are the same as when called
normally from the shell, I can only conclude that etckeeper is using some
criterion other than a non-zero hg exit code to decide that the commit failed.
Irc snippet from Matt Mackall, quoted with permission, in case it is helpful.
13:34 < mpm> Unavailable extensions don't affect Mercurial's exit code.
13:49 * mpm browses the etckeeper source.
13:55 < mpm> The only place I can spot any error handling is here:
http://git.kitenet.net/?p=etckeeper.git;a=blob;f=pre-install.d/50uncommitted-changes;h=d03d0e81cb3545e57c878fa050333eb98e440b7d;hb=HEAD
13:56 < mpm> The commit itself is here:
http://git.kitenet.net/?p=etckeeper.git;a=blob;f=commit.d/50vcs-commit;h=6e509e6285df0755025b21dc5c601644cc971bee;hb=HEAD
13:57 < mpm> Line 53, since anchors don't seem to work.
13:58 < mpm> I have no idea where the message "Commit failed" is coming from.
13:58 < mpm> It's not from hg.
13:59 < faheem> mpm: can i quote this?
13:59 < mpm> http://paste.pocoo.org/show/311570/
13:59 < mpm> Sure.
13:59 < faheem> mpm: ok. thanks
13:59 < mpm> hg --config extensions.bogus= help debugdate ; echo $?
13:59 < mpm> Quick test of extensions and exit codes.
Regards, Faheem
--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org