Bug 75512 - CVS commits causes KDevelop to display the file as being edited from outside
Summary: CVS commits causes KDevelop to display the file as being edited from outside
Status: RESOLVED FIXED
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: cvs (show other bugs)
Version: 0.9.94
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-18 13:47 UTC by Simon Ejsing
Modified: 2010-12-16 19:28 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Ejsing 2004-02-18 13:47:49 UTC
Version:           3.0.0 (using KDE KDE 3.2.0)
Installed from:    Gentoo Packages
Compiler:          gcc (GCC) 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7) 
OS:          Linux

When I commit a file in KDevelop using the CVS menu (right-click -> CVS -> Commit) the file is commited as it should be, but afterwards the file I'm editing always shows up as edited from outside KDevelop (the disk icon on the tab is showing). Pressing F5 (reload) is the only way to make the icon go away, but it causes KDevelop to display a warning dialog about loosing data.

A CVS commit does not change the file contents, so this shouldn't be neccesary? I'm thinking it might be caused because KDevelop uses the last accessed time instead of the modified time of the file? This seems to be correct as the bug is reproducable by just copying a file opened within KDevelop to eg. /tmp/test.php

To reproduce:
- Open a file within KDevelop
- Open a terminale
- cd to directory of the opened file
- cp the file to /tmp
- Press reload (F5) within KDevelop
Comment 1 Amilcar do Carmo Lucas 2004-02-18 15:36:59 UTC
> A CVS commit does not change the file contents.
This IS false. A CVS commit changes the file contents.

>so this shouldn't be neccesary?
It is necessary.

The solution seams to do an automatic reload in such situations.
BUT you may loose data.
Comment 2 Simon Ejsing 2004-02-18 15:42:04 UTC
Why would a CVS commit change the file?

Anyway, a "cp" shouldn't, and it results in the same behaviour...
Comment 3 Jens Dagerbo 2004-02-18 15:43:42 UTC
Yes, the 'cp' behaviour is clearly wrong. I've fixed it here, just need to do some more testing. Will commit shortly.
Comment 4 Jens Dagerbo 2004-02-18 15:58:45 UTC
Simon, what filesystem are you using?

I can reproduce the 'cp' behaviour on reiserfs. Ian, who is on ext3, cannot.
Comment 5 Simon Ejsing 2004-02-18 16:02:25 UTC
reiserfs
Comment 6 Amilcar do Carmo Lucas 2004-02-18 16:06:31 UTC
Try to add a "$VERSION:  $" string somewhere in the file and you will see how a file changes with a CVS commit!
Comment 7 Simon Ejsing 2004-02-19 08:32:48 UTC
Okay, I'll take your word for it that CVS commit changes the file, however when I CVS commit, my changes should-be / are automaticly saved, so even if the file is modified by CVS commit it should be fairly safe to reload it, right?
Comment 8 Amilcar do Carmo Lucas 2004-02-19 10:45:20 UTC
Yes, like I said it sould be safe to reload after doing a commit, and it can even be done automaticaty if :

The commit operation saves the file using kdevelop,
then does the commit,
waits (blocks the IDE) until it gets the result of the commit
reloads the file.

The problems are: 
-Remote repositories can take a significant amoutnt of time to return.
-If you have modifications that you do not want to commit, then bad luck because the IDE saves the file without asking you.
Comment 9 Jens Dagerbo 2004-02-20 20:18:58 UTC
This turns out to be far more complicated to fix than I first thought. The problem is also getting worse for some cases, after some recent changes to katepart.
Comment 10 Sascha Cunz 2004-02-20 22:43:27 UTC
> The commit operation saves the file using kdevelop,
> then does the commit, waits (blocks the IDE) until it
> gets the result of the commit reloads the file.

Why should we? We have other places where we execute asynchornous operations that could mess up even more. i.e. who the hell keeps the user from changing (and saving!) files while make is running? IF we make cvs commit a synchronous operation, we most probably should make MUCH other stuff synchronous too!
Like:
  - starting KDevelop
    ( some things really screw up, if kdevelop is still loading )
  - initial C/C++ project parsing
    ( some things really screw up, if kdevelop is still parsing )
  - running configure
  - running build operation
  - running a "clean" operation
  - running a vcs update operation
  - probably more...

> The problems are: 
> -Remote repositories can take a significant amoutnt of time to return.
We have a wonderful signal/slot system - and i know we are notified when compilation is done, so i assume we can do that for any KProccess we're calling, right?

>-If you have modifications that you do not want to commit, then bad luck
> because the IDE saves the file without asking you.
Every IDE - i know of does - this. If i tell the IDE to commit, it commits. Nothing else would i expect :-) 

Just to add more than my ususal 2 cent... MSVC interactively asks me what to do with a file as soon as it has been changed externally. I remember kate/kdevelop doing that at some time too, but that's has vanished meanwhile.

Cheers Sascha
Comment 11 Simon Ejsing 2004-02-20 22:49:04 UTC
From a users point of view it's damn annoying to have to deal with reloading the file everytime you've done a CVS commit (especially because I didn't have to in previous versions of KDevelop), and that's for every file your commit affected, that's the reason I submitted this bug report.
Comment 12 Amilcar do Carmo Lucas 2004-02-23 09:06:51 UTC
Sascha, just for the record, I'm happy with the current situation. I was just trying to explain Simon the problems that changing the current way of working would bring.
:)
Comment 13 Andreas Pakulat 2007-11-30 18:28:32 UTC
as far as I can see this is fixed