Patch for preliminary Mercurial integration in kdevplatform

Evgeniy Ivanov pfx.kde at gmail.com
Mon Mar 16 10:44:33 UTC 2009


On Mon March 16 2009 11:01:07 Fabian Wiesel wrote:
> On Sun, 15 Mar 2009 13:51:55 +0300
>
> Evgeniy Ivanov <pfx.kde at gmail.com> wrote:
> > On Sun March 15 2009 03:11:33 Andreas Pakulat wrote:
> >
> > Why don't we use some new word (for VCS terminology): "Reset
> > workspace" for example. Also there are some problems with "add".
>
> I agree with Andreas, that "Revert uncommitted changes" is probably
> better. I fear you have qualify practically every command. Except AFAIK
> for "add" and "delete". What do you think are the problems with "add"?

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). 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). From another hand when user commits 
he can choose files to be added, so dvcs_add is not required. 
 
> > Current solution is not so bad. We can have only common and minor
> > actions in VCS menu: update, commit, add, remove, reset working copy,
> > log. [...]
>
> 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.

> > Also there is a small known bug
> > in git (it is if you think about "add" not in a git sense): now we
> > check the dir and not the files (if file check is requested then
> > parent dir is checked).
>
> AFAIK, git add, svn add, and hg add do all the same: Adding new files to
> be commited. The manual of git is just a bit more verbose and calls it
> adding to the "index". The other programs just don't name the object,
> which stores the meta-data before commit. Same with rm.

In git case (and AFAIK) hg/bzr it's not just meta-data (like files in .svn): 
it's really file contents (and also repository can have file-objects detached 
from tree objects, named danglings).

> The first step I took to speed it up was implementing the
> isValidDirectory() check without calling the external programm. I think
> the same could be done for git.
> What I am now thinking about is caching the dirstate / index.  A worker
> thread can pull in the dirstate information and keep the cache
> consistent by monitoring the .hg directory for changes. Probably the
> same could be done for git (.git-directory). I try to keep it generic
> enough, so it can be reused.

AFAIK VcsCommonPlugin does some caching.
In DVCS case we really can keep repo's root to use it in isValidDirectory(). 
Then "Add" should be enabled (AFAIK it is) independent on file is already 
controlled. 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).


-- 
Best regards, Evgeniy.
Key Fingerprint: F316B5A1F6D2054FCD18B74A95400ABB1FE567A3

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20090316/20f40ad6/attachment.sig>


More information about the KDevelop-devel mailing list