[KDev4] vcs integration

Andreas Pakulat apaku at gmx.de
Tue Mar 27 10:15:13 UTC 2007


On 27.03.07 09:16:14, Robert Gruber wrote:
> Mon, 26 Mar 2007 18:22:59 +0200
> > On 26.03.07 15:34:46, Robert Gruber wrote:
> > > while having a look at the vcs exension interface the following
> > questions came 
> > > to my mind.
> > > 
> > > As we can have multiple projects opened at a time, it may happen that
> > files 
> > > >from different projects will be passed to a VCS-plugin. 
> > > *) How can I find out which file belongs to which project?
> > > *) And what if the project use different VCS plugins?
> > > 
> > > I'll have to call the cvs client from a location inside of the local
> > working 
> > > copy and pass all files relative to that directory.
> > 
> > IIRC all IProjectFileManager's have way to find the relative path for a
> > given URL.
> 
> Maybe you can give me a little hint ;)
> All I found was this: 
> KUrl IProject::relativeUrl(const KUrl& absoluteUrl)

Thats what I meant.

> But this still leaves the problem, that I don't have an IProject object. So at the moment I don't think that passing only KUrl will be enough (at least not for CVS).

Actually you don't need that, ask the projectcontroller for the project
of a specific url. I think we don't have that API yet, but we will have
it soon.

> > > Maybe we shouldn't pass a list of KUrls but rather a list of objects
> > from the 
> > > ProjectFileItem class to the vcs plugins?!?!
> > 
> > I didn't yet look at the API but you are absolutely correct. In fact I
> > think we should discuss wether we want both, i.e. KUrl +
> > ProjectBaseItem*. I'm not sure we need KUrl, so I'd like to see people's
> > opinions on that part, are there any use cases anybody can think of?
> 
> One thing just came to my mind. 
> Let's assume, that somebody has files in his projectdirectory that are not known by the project-manager but still should go into CVS. Maybe a README, additional scripts or something like that. 
> Such files don't show up in the project-manager and there also is no ProjectItem object for them, correct? How can we pass them to the CVS plugin then?

Well, easily: Just ask the projectcontroller for the project that
contains this file.

> > This is also the only way to connect filemanger and vcs-plugin, i.e.
> > IFileManager::fileAdded(ProjectBaseItem*) signal should be connected to
> > VCS::addFile(ProjectBaseItem*) slot (this means pretty much all API
> > needs to be a slot).
> 
> I don't think this should be "hard wired". I think it should work just like in KDevelop3, where the user could descide if the new files should also be added the the vcs. Maybe a checkbox in in the "Add file to project" dialog or a Yes/No questionbox afterwards, something like that...

Ok, add is a bad choice, but how about delete and especially
move/rename. Those need to be connected from projectmanager to version
control.

Andreas

-- 
Keep emotionally active.  Cater to your favorite neurosis.




More information about the KDevelop-devel mailing list