VcsRevision usage question.

dukju ahn dukjuahn at gmail.com
Wed Jun 6 11:55:23 UTC 2007


2007/6/5, Matthew Woehlke <mw_triad at users.sourceforge.net>:
> dukju ahn wrote:
> > I'm not discussing the interface. I'm asking the usages.
>
> Ok. These are good questions, btw, thanks for asking!
>
> > When revision is RevisionType::GlobalNumber, then does the
> > QString revisionValue() returns the number using QString::fromInt()??
>
> Sounds right, so you might have e.g. "651432" (that's a QString). Or...
> I wonder if we should standardize that between FileNumber and
> GlobalNumber, there is a specific prefix, e.g. GlobalNumber might always
> start with 'r' (or '@'?) and FileNumber might always start with '#'?

Because we already know the type of revision by revisionType(),
we don't need to use special format to distinguish between filenumber
and globalnumber. Just int number will be enough

> > When revision is RevisionType::Date, then what is the format
> > of QString revisionValue() ?
>
> IIRC it should be a QDate-parsable string. We should probably specify a
> standard format (which may be 'use a system-configured format', but the
> point is we should be consistent across VCS's).

Then we should use

QString QDateTime::toString ( Qt::DateFormat format = Qt::TextDate ) const.

because with returned string, new QDateTime can be easily constructed with

QDateTime QDateTime::fromString ( const QString & string,
                                                        Qt::DateFormat
format = Qt::TextDate )

Also we should use QDateTime, rather than just QDate. There was discussion
about datetime.

> > Lastly, when revision is RevisionType::Special, what is the format of
> > QString revisionValue()? Is it just int? or string such as "Head"?
>
> It would be e.g. "HEAD", possibly all upper case like that. Again we
> should standardize this.

Oh no. If RevisionType is Special, QString revisionValue() should return
the RevisionSpecialType enum value, which would be int.
I was silly to ask such an easy question. It was very late night yesterday :)




More information about the KDevelop-devel mailing list