[VCS] VcsRevision
Andreas Pakulat
apaku at gmx.de
Mon May 21 15:08:05 UTC 2007
On 21.05.07 09:26:24, Matthew Woehlke wrote:
> Andreas Pakulat wrote:
> > currently VcsRevision can have at least 5 types: date, filenumber,
> > globalnumber, special or range.
> >
> > In the thread that started about merging iatomic there was mentioning
> > about having repo path (and possibly also local file paths) inside
> > VcsRevision.
> >
> > One question is wether a VcsRevision can be constructed by a user of our
> > API's. If so there would be the need to set such paths, if not the path
> > can be something that is completely internal to the revision - or at
> > least only accessible to the plugins.
> >
> > So, how are VcsRevisions constructed? Is always an interface method
> > used? Can somebody see a use-case that needs constructing VcsRevision
> > directly?
>
> Wow, you actually did an excellent job covering what I was expecting to
> say in response already :-), so I'll just throw out my own thoughts if
> anyone wants to disagree.
>
> I assume one can create a date or special
Hmm, yeah.
> Maybe a GlobalNumber.
That is probably not a problem either.
> I was assuming that one can't create a FileNumber but would always get
> it from the plugin, but I guess that does seem inconvenient.
Use case please?
> Hmm,
> setRevisionValue probably should return a bool. I think the problem with
> building a number (either kind) is you have to know if "number" means
> 655326 as in svn/perforce or "3.5.6.107" as in (IIRC?) CVS.
Hmm, maybe we should disallow creating revisions from anything but a
date or special. Seriously, I don't see the use-case in the public
interface (no doubt you'll create them inside the gui sometimes).
> Creating a range is IMO not relevant, we already have setSourceRevision
> and setTargetRevision, so the answer is 'yes' as long as you have
> VcsRevisions to feed those. (Hmm, what happens though if you try to set
> one of those to a range? Should it return false, silently use an invalid
> revision instead, something else...?)
If you try to create a range of ranges you should get an invalid
VcsRevisions and a false return value on the setSource and setTarget
functions.
> Actually, what is the use-case for a range, is it just merge()?
No, its for diff() or log() (and maybe others I don't recall atm).
> (Also, doesn't the target of a merge have to be a local path? And then
> what does dstRevision mean? Did we have this conversation before and I
> am forgetting? :-))
merge() takes two plain revisions, src and target, it won't work with
either of the one being a range. Maybe we should rather have overloads
for diff/log/<whatever can use a range of revisions> with 2 revision
arguments instead of a range inside VcsRevision. That way we don't have
to specially document when a range-revision can be used and when not.
Andreas
--
Someone is speaking well of you.
More information about the KDevelop-devel
mailing list