[KDev4] vcs integration - KUrl of a file is not enough to know the file's project!

Andreas Pakulat apaku at gmx.de
Fri Mar 30 22:01:09 UTC 2007


On 30.03.07 17:01:32, Kuba Ober wrote:
> > > > > 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.
> > >
> > > That's a no-go with aegis :(
> >
> > I don't think so. Lets see:
> >
> > IProject* ProjectController::projectForFile(KUrl file)
> > {
> >   foreach(IProject* p, projectlist)
> >   {
> >     if( p->isProjectFile( file ) )
> >       return p;
> >   }
> >   return 0;
> > }
> 
> The problem is that in this case p->isProjectFile can be true for several 
> projects in Aegis. The reason is that all baseline files are shared, and they 
> don't exist in project's change directory. They typically sit on an nfs or 
> samba mount.

Why is that a problem? If the file exists and is part of your project
than its absolutely correct for isProjectFile to return true and thus a
project item is returned for that file.

If OTOH you want something like project == changeset, then your
projectmanager needs to return false when given a url that is not part
of the changeset, but I thought you wanted it the other way around.

Now when the aegis-vcs-part gets the projectfile it can check wether its
part of the changeset or if its part of another change set and act
accordingly (i.e. don't allow update/commit/remove/whatever fits for
aegis).

Andreas

-- 
Bank error in your favor.  Collect $200.




More information about the KDevelop-devel mailing list