Patch for preliminary Mercurial integration in kdevplatform

Andreas Pakulat apaku at gmx.de
Tue Mar 17 10:48:32 UTC 2009


On 17.03.09 00:45:16, Fabian Wiesel wrote:
> On Mon, 16 Mar 2009 11:04:49 +0100
> Andreas Pakulat <apaku at gmx.de> wrote:
> 
> > On 15.03.09 23:55:12, Fabian Wiesel wrote:
> 
> > [...] So maybe we should actually remove VcsLocation from the
> > IBasicVC, splitting diff and the other methods that use it into two
> > interfaces: IBasicVC and ICentralizedVC. 
> > 
> > So IBasicVC::diff() would take 2 KUrl's, IBasicVC::merge() would take
> > 1 KUrl (as local location) and two revisions as start/end point for
> > the merge-diff.
> 
> On second thought, don't think it is a good idea. For two reasons:
> >From an abstract point of view, a DVCS is the same as a CVCS. 
> It only extends it by some distributed aspects. So, I'd say splitting
> the interfaces is the wrong direction.
> 
> I fear, in the current form diff() and merge() can neither by CVCSs nor
> by DVCSs be correctly implemented.
> 
> As it stands, it promises a diff between two VcsLocations.
> So, what about file A at revision X and file B at revision Y?
> Or even worse a diff between two different unrelated repositories?
> Of course, technically this is possible, but it is quite pain to
> implement, and probably not what you really want to provide.
> 
> This brings me back to the repository-as-an-object matter:
> A particular checkout/repository is an instance, which contains
> versioned files and directories, which have a diff()-function.
> Both takes two VcsRevisions as argument and gives you the diff() of
> those versions. I guess that is the functionality you wanted to
> provide: A simple diff between two different versions of the same file,
> either in repository or on disk.

The diff() function as it currently exists actually performs multiple
different things (which IMHO makes it a good candidate for splitting):

- diff between two revisions of the same file/dir on a local instance of a
  repository
- diff between two different files in a repository, usually files in two
  different branches (hmm, does vcslocation include branch information, if
  not it should)
- diff between two revisions of the same file/dir on a remote repository

At least thats what it provides with svn. As at least git doesn't support
the 2 repository-diff methods it IMHO doesn't make sense to have it in
IBasicVC. Note IBasicVC is supposed to be the "lowest common denominator"
for all supports VCS.

> Once more, I am  not suggesting changing the code in that
> far reaching way. It's just a matter I have in the back of mind. 

I actually like the idea, because right now we simply have a procedural
interface to the VCS designed mostly after the actual commandline tools.
And I personally don't like that too much - at least not with that many
functions.

Andreas

-- 
Your depth of comprehension may tend to make you lax in worldly ways.




More information about the KDevelop-devel mailing list