unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* AW: behavior of vc-recompute-state in combination withvc-cvs-stay-local is t
@ 2004-11-30 11:21 klaus.berndl
  2004-11-30 11:39 ` Andre Spiegel
  2004-11-30 13:25 ` Stefan
  0 siblings, 2 replies; 3+ messages in thread
From: klaus.berndl @ 2004-11-30 11:21 UTC (permalink / raw)
  Cc: monnier, emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 1946 bytes --]

On Mon, 2004-11-29 at 17:31 +0100, klaus.berndl@sdm.de wrote:

>> 4. Running (vc-recompute-state "/a/file/under/remote-repository-CVS/file.txt")
>>    ==> returns always nil, because the state-binding in the vc-cvs-state is
>>        always nil for that file.

>The code was simply based on the assumption that vc-recompute-state
>would only be called for files that are already visited.  In this case,
>vc-state can never be nil because we compute it at visiting time
>already.

ah, i had already a suspicion like that....
But what i still do not understand, why vc-recompute-state behaves
different related if the repository is local or remote 8at least this
is the only difference i can imagine between the two testcases - see
my first postin, steps 4 and 3?

>I've changed this now and moved vc-recompute-state into vc-hooks.el.  It
>should always return a valid state now.

ah, this sounds wonderful! IMHO this would be a very good enhencement
for tools like ECB which want to display a VC-state also for file
not already visited... Thanks, Andre!

May i ask another problem/question related to `vc-state'? Please see
the following very simple and fast testable scenario:

1. load a file (lets say the filename is XXX.txt) into Emacs, which is
   under control of CVS
2. do some editing changes and save it - do not kill the buffer
3. M-: (vc-state "XXX.txt") RET ==> return 'edited for me
4. No checkin this file but not from within Emacs, so e.g. via bash command line
5. M-: (vc-state "XXX.txt") RET ==> returns again 'edited
   (but currently 'up-to-date would be correct)
6. Call M-x revert-buffer
7. Again M-: (vc-state "XXX.txt") RET ==> Now vc-state returns the correct
   'up-to-date state

So, which mysterious things are done by revert-buffer so *after* it vc-state returns
correct 'up-to-date state but wrong 'edited state if called *before* the 
revert-buffer???

Thanks again,
Klaus

[-- Attachment #1.2: Type: text/html, Size: 2711 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: AW: behavior of vc-recompute-state in combination withvc-cvs-stay-local is t
  2004-11-30 11:21 AW: behavior of vc-recompute-state in combination withvc-cvs-stay-local is t klaus.berndl
@ 2004-11-30 11:39 ` Andre Spiegel
  2004-11-30 13:25 ` Stefan
  1 sibling, 0 replies; 3+ messages in thread
From: Andre Spiegel @ 2004-11-30 11:39 UTC (permalink / raw)
  Cc: Stefan Monnier, emacs-devel

On Tue, 2004-11-30 at 12:21 +0100, klaus.berndl@sdm.de wrote:

> But what i still do not understand, why vc-recompute-state behaves
> different related if the repository is local or remote 8at least this
> is the only difference i can imagine between the two testcases - see
> my first postin, steps 4 and 3?

For a local repository, VC does indeed call "cvs status" in
vc-recompute-state, even if vc-cvs-stay-local is t.  This setting only
affects remote repositories.

> So, which mysterious things are done by revert-buffer so *after* it
> vc-state returns correct 'up-to-date state but wrong 'edited state if
> called *before* the revert-buffer???

Function vc-state uses a cached value of the vc-state property (via
vc-file-getprop).  This value gets recomputed in the course of
revert-buffer, which is a sensible thing to do, I would think?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: AW: behavior of vc-recompute-state in combination withvc-cvs-stay-local is t
  2004-11-30 11:21 AW: behavior of vc-recompute-state in combination withvc-cvs-stay-local is t klaus.berndl
  2004-11-30 11:39 ` Andre Spiegel
@ 2004-11-30 13:25 ` Stefan
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan @ 2004-11-30 13:25 UTC (permalink / raw)
  Cc: spiegel, emacs-devel


One more note about vc-recompute-state:

VC tries to handle CVS, RCS, SCCS, Arch, Subversion, and MetaCVS even if you
don't have the corresponding software installed.  The idea is that you might
visit a file under CVS control even if you don't have CVS.  So VC tried to
only use the underlying programs when the user requests and action.

vc-recompute-state is normally associated with an action (it's currently
only called from vc-next-action), so it is free to call the
underlying software.

If your program uses vc-recompute-state blindly, it might cause errors
because of files that are under the control of a revision control software
which Emacs knows but which is not installed in the system.

E.g. if the user does not have CVS installed but visits a file extracted
from a tarball that includes a CVS administrative subdir.


        Stefan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-11-30 13:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-30 11:21 AW: behavior of vc-recompute-state in combination withvc-cvs-stay-local is t klaus.berndl
2004-11-30 11:39 ` Andre Spiegel
2004-11-30 13:25 ` Stefan

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).