[VCSIface] Difference between VcsEvent and VcsItemEvent

Andreas Pakulat apaku at gmx.de
Mon May 7 20:18:58 UTC 2007


On 07.05.07 09:54:01, Matthew Woehlke wrote:
> Andreas Pakulat wrote:
> > I don't quite understand the purpose of these two classes and especially
> > why they are separated. Would someone please enlighten me? (and write
> > more verbose apidox)
> 
> Done (the apidox).

Thanks.

> "[VcsItemEvent] contains information that is common to a VcsEvent (which 
> represents a single item) and a VcsChange (which may have information 
> about several items)."
> 
> Does that help? Basically you get a VcsEvent from log() and a VcsChange 
> >from change().

Why?

> log() doesn't tell you anything about other files 
> affected at the same time, for that you use change().

Why?

> VcsItemEvent holds 
> the per-item properties in VcsChange (i.e. the revision number, date, 
> user and message are the same for all items affected by a change :-)).
> 
> Hmm. Certain VCS's (perforce) have a log() that doesn't tell you about 
> peripheral changes. Is it preferable to have two classes, or would you 
> prefer having only VcsChange with the stipulation that log() may give 
> you an incomplete instance (i.e. only the item you asked about?).

IMHO we should look at having 2 classes in sum, one for the change and
one for the separate items in the change. Then we also don't need
change() anymore as for getting 1 revision all you need to do is
log(path,revision,1).

> Or is it preferable to keep the separation because it shifts the load
> of sorting out the path of a single file to the plugin (in the case of
> log(), on VCS's - i.e. svn - that make this necessary) rather than the
> user?

I don't have the classes at hand atm, so I won't comment on this atm -
not understanding what you say...

> I think I chose not to make VcsEvent a subclass of VcsItemEvent to make 
> it easier for plugins to subclass in order to provide additional 
> information.

Thats possible even if it is a subclass. Or rather these should be
interfaces if we really keep both.

Andreas

-- 
You will give someone a piece of your mind, which you can ill afford.




More information about the KDevelop-devel mailing list