Patch for preliminary Mercurial integration in kdevplatform

Evgeniy Ivanov pfx.kde at gmail.com
Fri Mar 13 22:01:38 UTC 2009


On Sat March 14 2009 00:14:50 Andreas Pakulat wrote:
> On 09.03.09 09:07:22, Fabian Wiesel wrote:
> > First, DVCSjob is changed from parsing the output for lines and later
> > rejoining them to a single string to simply accumulating a QByteArray.
>
> While thats fine in general it puts a lot of burden onto the plugin
> writer as he has to convert the bytearray into a string. If you look at
> ProcessLineMaker in utils you'll see that thats not quite as easy as one
> might think. Individual comments below.

But in some cases, using QByteArray can improve perfomance. QGit uses mostly 
uses QByteArray, but with somethings you mention bellow to avoid problems (and 
QGit developer wrote it really improves perfomance). I still plan to port some 
QGit's code, which can be shared between these plugins, but circumstances 
don't let me... 

> >  QString DVCSjob::output() const
> >  {
> > -    return d->outputLines.join("\n");
> > +    return QString(rawOutput());
>
> Thats for example wrong. If rawOutput contains non-ascii text this will
> break horribly. You need at least QString::fromLocal8Bit(), but even
> that might break because the output might contain an unfinished line
> thats stops in the middle of a character sequence (think for example 2/3
> byte utf8). So you should only return the output until and including the
> last included "\n" and convert that with fromLocal8Bit().
>
> Other than that the code seems ok (I didn't do a really deep review as I
> don't know too much about the dvcs stuff). Are you willing to maintain
> this if it goes into kdevplatform? Do you already have an svn account?
>

Look's ok to me too. Except the thing, that big part duplicates hg plugin from 
utils (but some extra functions are implemented, so it should support 
revhistory view).
If it goes to kdevplatform we have to remove another hg plugin (from 
playground). I don't have much time during the study year, but can maintain it 
too, since it is based on git plugin and I have experience with hg plugin too. 

-- 
Best regards, Evgeniy.
Key Fingerprint: F316B5A1F6D2054FCD18B74A95400ABB1FE567A3

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20090314/5bdba11f/attachment.sig>


More information about the KDevelop-devel mailing list