Am 04.11.2010 um 00:32 schrieb Pavel Sanda: > Stephan Witt wrote: >>>>> CVS improvement if info inset output is possible (after review) for >>>>> 2.0-beta? >>>> >>>> if its possible to make it simple and stupid using the current philosophy >>>> then yes. >>>> if you need to redesign things around, please let it sleep, its too late. >>> >>> No worry, basically I want to adapt the SVN idea. >>> Using the cvs log -r "VCS::version_" command I'd like to parse the log line >>> and >>> save the result into - obviously code duplication again - some state >>> variables >>> inside CVS class. >> >> Here another patch including: >> >> * CVS helper method to ease system calls with output redirection (really >> trivial ;-)) > > please save somewhere the previous patch we need to use the same calling > conventions > for all the stuff. hopefully lyx2lyx routines output can be fixed too with > slightly changed one.
Yes. And yes, I have it at hand. > >> - if (ret && reportError) >> + if (ret && reportError) { >> frontend::Alert::error(_("Revision control error."), >> bformat(_("Some problem occured while running the >> command:\n" >> - "'%1$s'."), >> - from_utf8(cmd))); >> + "'%1$s'.\n"), >> + from_utf8(cmd))); >> + } > > why this '}' ? A leftover from previous patch. I can live without it. :-) > >> int rc = update(File, tmpf); >> string log; >> string const res = scanLogFile(tmpf, log); >> - if (!res.empty()) >> + if (!res.empty()) { >> frontend::Alert::error(_("Revision control error."), >> bformat(_("Error when updating from repository.\n" >> "You have to manually resolve the conflicts >> NOW!\n'%1$s'.\n\n" >> "After pressing OK, LyX will try to reopen the >> resolved document."), >> from_local8bit(res))); > > chmm, we dont use from_local8bit on other places. > things go wrong with nonascii filenames? It's used in SVN::checkOut() too. And it's the result of scanLogFile parser and not a filename. I think, the general problem is the switch from std::string to docstring and vice versa. It is std::string what is used for interface of VCS classes. but the alerts use docstrings... > >> @@ -807,8 +863,26 @@ >> >> string CVS::revisionInfo(LyXVC::RevisionInfo const info) >> { >> - if (info == LyXVC::File) >> - return version_; >> + if (!version_.empty()) { >> + if (rev_author_cache_.empty()) { >> + if (!getRevisionInfo()) { >> + rev_author_cache_ = to_local8bit(_("unknown >> author")); >> + rev_date_cache_ = to_local8bit(_("unknown >> date")); >> + rev_time_cache_ = to_local8bit(_("unknown >> time")); > > this code breaks the current practise - either we return true value or empty > string in unknown case, which will be handled on the hierarchy above. > and i think i see latent translating bug in the handling code above. wanted to > check it but why the hell LC_MESSAGES=cs_CZ src/lyx doesn't work anymore for > trunk... I'll use an explicit getRevisionInfo() success state flag and return string() instead. Ok? Stephan