VcsRevision usage question.
Matthew Woehlke
mw_triad at users.sourceforge.net
Wed Jun 6 14:27:08 UTC 2007
dukju ahn wrote:
> 2007/6/5, Matthew Woehlke <mw_triad at users.sourceforge.net>:
>> dukju ahn wrote:
>>> 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
Hmm, right, because you can't construct a revision any more. Anyway, as
Andreas said, it isn't /necessarily/ "just an int", but returning
"12345" (as a QString) seems OK. OTOH, see below...
>>> 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 :)
Huh? Why would you do that?
I think we need to ask what the point of revisionValue is; my assumption
would be that it is to return a human-readable string (Andreas: an
argument /against/ returning QVariant here), in which case Head must be
translated as "HEAD" (or "Head", "head", etc, but certainly not "1"!).
--
Matthew
...yzarc gniog ylwols era uoY
More information about the KDevelop-devel
mailing list