[KDev4] vcs integration - KUrl of a file is not enough to know the file's project!
Andreas Pakulat
apaku at gmx.de
Thu Mar 29 16:10:00 UTC 2007
On 29.03.07 10:54:53, Kuba Ober wrote:
> > > > > 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.
>
> 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;
}
bool Project::isProjectFile( KUrl file )
{
IFileManager* manager = projectplugin->extension<IFileManager>();
return manager->isProjectFile( file );
}
And then you have your aegis-filemanager which knows about all that
aegis-stuff. Aegis support will probably have to be split into the
filemanager-part and the vcs-part, however I don't see a problem (except
that not all of the above API might be in place yet)
> E.g. I have to changes that I'm working on:
> ~/fooproject.2.1.C010
> and
> ~/fooproject.2.1.C011
>
> If I need to open file called "relative/blah.c", it may be in
> /devel/fooproject/branch.2/baseline/relative/blah.c, for both changes
> (projects).
>
> It's fairly common to work on several changes on the same project at the same
> time.
But the Url won't be relative/blah.c, but it would be
/devel/fooproject/branch.2/..../blah.c. We don't deal with relative
Url's anymore - at least not API-wise.
Andreas
--
You are so boring that when I see you my feet go to sleep.
More information about the KDevelop-devel
mailing list