Patch for preliminary Mercurial integration in kdevplatform

Fabian Wiesel fabian.wiesel at fu-berlin.de
Mon Mar 16 20:52:26 UTC 2009


On Mon, 16 Mar 2009 13:44:33 +0300
Evgeniy Ivanov <pfx.kde at gmail.com> wrote:

> On Mon March 16 2009 11:01:07 Fabian Wiesel wrote:
>
> In IBasicVCS meaning of add is "add file to the repository". In DVCS
> it's meaning is "Add file contents to the index" (and also add to
> repository for files outside).

I think, that is a peculiarity of git (or should I say another?).
hg add works the same way as svn,cvs,bzr and darcs. Non-tracked files
are added to the files to be tracked.

If I understood Andreas correctly, git simply adds another meaning to
add:
Mark modified files to be commited with the next commit. This simply
duplicates the functionality of commit, as the git manual entry itself
states.

> There was some long discussion (Andreas, Alexander (Dymo) and I) and
> we decided to separate these things (I still think that in DVCS case
> "add" should be in menu for both actions). 

Maybe you can name me the deciding point, which lead to that decision.

I have the feeling, that several people think, that DVCS are
much more different from CVCS than they really are. In essence, they 
simply are local VCSs (-> init) with the possibility of pushing changes
to a passive receiver (push), or pulling them from another (pull).
Due to their distributed nature, they have to understand parallel
branches of changesets. This lead to the advent of in-tree branches.

> From another hand when user commits he can choose
> files to be added, so dvcs_add is not required. 

Exactly. This was probably a "UI" decision. On the command-line you
cannot as easily select the files you want actually commit or not. 


> > Except it doesn't work with mixed VCSs.
> 
> There is an easy solution: have all things not only in main menu, but
> also in all DVCS menus. Until we get VcsCommonPlugin situation was
> the same, so I used several VCS for project.

I don't quite understand, how this solves the problem of multiple VCSs.
Which "commit" will be called in the common menu?

> [...]
> AFAIK VcsCommonPlugin does some caching.

Well, I get called for each and every file I right click. And the worst
of it is, it has to be that way. VcsCommonPlugin cannot cache it in a
sensible way, as it doesn't know, when something has changed in the
repository. This is VCS specific.

> In DVCS case we really can keep repo's root to use it in
> isValidDirectory().

This works for git and mercurial, but I won't claim that it
will work for others, too. In fact, bzr seems to actually track
directories. So, you can have an untracked directory in a tracked one.

>  Then "Add" should be enabled (AFAIK it is)
> independent on file is already controlled. 

It is, and it is annoying. Adding is not a sensible operation on a
file, which already has been added.

> And "Remove" should always
> shoot and in case file is not controlled we can show failure dialog
> (in our case "git/hg" will finish with cute status).

While this is quite work efficient solution and I don't intend to
change that any time soon, I believe that this also contradicts every
Human Interface Guideline in existence :)

I hope, you just wanted to point out, that it doesn't break anything and
therefore shouldn't have a high priority. On that, I certainly can
agree.


Fabian




More information about the KDevelop-devel mailing list