[KDev4] vcs integration - KUrl of a file is not enough to know the file's project!
Kuba Ober
kuba at mareimbrium.org
Wed Apr 4 18:50:45 UTC 2007
On Friday 30 March 2007, Andreas Pakulat wrote:
> 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,
Is there any other way? In my aegis projects, when I create a new change, the
kdevelop project files are automatically copied into the change so that I can
modify the project, and are removed upon integration if nothing was changed
(aegis remove -unchanged).
> 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.
I thought that you can have more than one project open at a given time. In
such a case, this won't work, i.e. if a file is open, you'll never know which
of many projects it is part of.
Say, I have a file that I opened from the file tree of project 1. Suppose I
want to save it - I can't, it's not copied into the change, so a window
should pop up saying "this file is not part of the change, do you want to
copy it into the change?" - if I answer yes, then the system will need to
know what project it was a part of.
> 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).
Project files outside of a change make little sense, as they'd be essentially
read-only and need to be treated as such. I.e. if you open a kdevelop project
anywhere outside of a change (any of the branch baselines or the project
baseline), you can't change anything. You need to create a change first.
Cheers, Kuba
More information about the KDevelop-devel
mailing list