[VCSIface] Difference between VcsEvent and VcsItemEvent

Matthew Woehlke mw_triad at users.sourceforge.net
Mon May 7 14:54:01 UTC 2007


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).

"[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(). log() doesn't tell you anything about other files 
affected at the same time, for that you use change(). 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?). 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? (Alternatively we can use VcsChange and specify that log() /shall/ 
return only the item asked about, even if it can provide more.)

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.

-- 
Matthew
child: Do not try to read the .sig. That is impossible. Instead you must 
realize the truth.
init: What truth?
child: There is no .sig.





More information about the KDevelop-devel mailing list