Am 22.10.2010 um 15:28 schrieb Stephan Witt: > Am 22.10.2010 um 02:11 schrieb Pavel Sanda: > >> Stephan Witt wrote: > While doing some "stress test" with checkIn() I found the error message when > merge is needed > "Something's wrong with cvs commit" not acceptable. Then I tried to change > that and failed to > solve it because of the stderr output of the VC command is lost silently. So > I came to the > idea to implement getStatus() and use the result accordingly. > > The result would be one out of > * uptodate > * locally modified > * needs checkout > * needs merge > * no cvs file > > The checkInWithMessage() implementation would be then > { return getStatus() == LocallyModified; } > And the checkIn() would do a switch on the getStatus() and > raise more descriptive error messages according the status.
Unfortunately this doesn't solve all possible cases. If the checkout is not the head version you cannot commit any changes. But the "cvs status" output isn't aware of that - it's locally modified only. In this case the error message of the commit is needed to tell the user what happened. Hmm, isn't it possible to get both stdout and stderr from doVCcommandCall() into some result? > > But I can change the style to be more verbose if you like. > E. g. > > if (vcs->checkInWithMessage()) { > log = vcs->checkIn(to_utf8(empty)); > // Reserve empty string for cancel button > if (log.empty()) > log = to_utf8(empty); > } else if (Alert::askForText(response, _("LyX VC: Log Message"))) { > if (response.empty()) > response = empty; > log = vcs->checkIn(to_utf8(response)); > // Reserve empty string for cancel button > if (log.empty()) > log = to_utf8(empty); > } else { > LYXERR(Debug::LYXVC, "LyXVC: user cancelled"); > } Sorry, I meant "if (!vcs->checkInWithMessage()) {" ... Stephan