VCS Interfaces, round 3
Andreas Pakulat
apaku at gmx.de
Fri May 4 15:27:13 UTC 2007
On 04.05.07 10:13:18, dukju ahn wrote:
> 2007/5/4, Andreas Pakulat <apaku at gmx.de>:
> > On 04.05.07 09:05:21, dukju ahn wrote:
> > > > /**
> > > > * Small container class that has a mapping of
> > > > * repository-location -> local location including a recursion flag
> > > > *
> > > > * Just a convenient API around QMap<KUrl, QPair<KUrl, RecursionMode>>
> > > > *
> > > > */
> > > > class VcsMapping
> > > > {
> > > > public:
> > > > enum MappingFlag
> > > > {
> > > > Recursive = 1,
> > > > NonRecursive = 2
> > > > };
> > > > Q_DECLARE_FLAGS( MappingFlags, MappingFlag )
> > > >
> > > > void addMapping( const KUrl& repositoryLocation,
> > > > const KUrl& localLocation,
> > > > MappingFlags recursion );
> > > > void removeMapping( const KUrl& repositoryLocation);
> > > > KUrl::List repositoryLocations();
> > > > KUrl localLocation( const KUrl& repositoryLocation );
> > > > MappingFlags mappingFlags( const KUrl& repositoryLocation ) const;
> > > > };
> > >
> > > The mapping provides remote location-> local location, but where
> > > is local->remote conversion. I think local->remote conversion is needed.
> >
> > Thats the same thing, just the plugin reads it "in reverse", IMHO.
>
> Why don't we be more explicit. According your answer, each plugin should
> determine whether the given Kurl& is remote or local. This is very annoying.
No, its still the same mapping. You don't switch it inside the mapping.
The plugin just uses it differently.
> Also the name of "KUrl localLocation( const KUrl& repositoryLocation );"
> and the comment of class VcsMapping
> suggest that only local location will be retreived. The interfaces should
> be explicit right?
Not sure what you mean. VCSMapping is simply a mapping between remote
and local locations. For convenience I guess we could add the opposite
direction, i.e. localLocations() + repositoryLocation(KUrl), so on an
import you don't have to build intermediate KUrl::List for the local
locations that you want to import. And mappingFlags would take either a
repositoryLocation or a localLocation..
Also note: The repository location will change to a QString, as it
doesn't make sense to force VCS systems to use a url to describe the
repository location.
Andreas
--
You have a reputation for being thoroughly reliable and trustworthy.
A pity that it's totally undeserved.
More information about the KDevelop-devel
mailing list