From: Dmitry Gutov <dgutov@yandex.ru>
To: "Göktuğ Kayaalp" <self@gkayaalp.com>
Cc: 24082@debbugs.gnu.org
Subject: bug#24082: [PATCH] Use ‘cvs update’ instead ‘cvs status’ for CVS *vc-dir* buffers
Date: Sat, 8 Oct 2016 04:01:22 +0300 [thread overview]
Message-ID: <4af6dea0-e5e9-6bc7-c10f-a792f16874a5@yandex.ru> (raw)
In-Reply-To: <87y420arg5.fsf@xi.bootis>
On 07.10.2016 22:29, Göktuğ Kayaalp wrote:
> On 2016-10-07 02:25:24 AM +0300, Dmitry Gutov <dgutov@yandex.ru> wrote:
>> Hi! Sorry for the long wait.
>
> No problem, though actually I'm the one who caused the long delay b/c I
> was too late to send in copyright papers, sorry :)
We could have done the review earlier. But anyway...
> On a computer with CVS installed, these commands should create a working
> directory with which the bug can be reproduced:
Thank you, that works.
> The output for the ‘cvs status’ command does not provide adequate
> information to reliably and simply construct the full path to each
> file. The output from the abovementioned command in the checkout the
> commands I listed created is like follows:
>
> ,----
> | cvs status: Examining .
> | ===================================================================
> | File: testfil Status: Locally Modified
> |
> | Working revision: 1.1.1.1 Fri Oct 7 18:46:53 2016
> | Repository revision: 1.1.1.1 /tmp/cvsroot/test/testfil,v
> | Sticky Tag: (none)
> | Sticky Date: (none)
> | Sticky Options: (none)
> |
> | cvs status: Examining subdir
> | ===================================================================
> | File: subfil Status: Locally Modified
> |
> | Working revision: 1.1.1.1 Fri Oct 7 18:46:53 2016
> | Repository revision: 1.1.1.1 /tmp/cvsroot/test/subdir/subfil,v
> | Sticky Tag: (none)
> | Sticky Date: (none)
> | Sticky Options: (none)
> `----
>
> The code was trying to rememeber the ‘cvs status: Examining <directory>’
> line in order to reconstruct the path, a method that's fragile and
> which requires a lot of regexp magic.
Maybe the problem here is that the output we have to deal with does not
contain "Examining subdir" because the current implementation of
vc-cvs-dir-status-files passes each individual files name to 'cvs -f
status'.
And 'cvs -f status testfil subdir/subfil' does not output that line. I
think the most reasonable approach for that solution would be to parse
the "Repository revision" lines.
Apparently, vc-cvs-dir-status-files was always broken for this usage,
and the problem has surfaced now when we've reimplemented dir-status on
top of dir-status-files.
‘cvs update’, instead has a very
> filter-friendly and determinable output syntax also imitated by other
> version control software (output for the same checkout):
That looks reasonable. However, it looks like a significant change, so
I'm not sure it's appropriate for Emacs 25.2. We'd like to get *a* fix
into 25.2, however.
> I actually sort-a-kind-a fixed the ‘cvs status’ version initially, but
> it's waay slower than using update. I don't have that fix anymore, but
> as I said, using ‘cvs update’ is more robust, simpler, and faster. In
> order to fix the ‘cvs status’ method, I read the relevant files from the
> CVS/ subdir of the checkout, reconstruct the absolute module path using
> info from files therewithin, than subtract that from the third column of
> the ‘ Repository version:...’ lines for each file to find its relative
> path to the checkout's root directory, ending up with a complex and
> fragile hack, that's also slow and incomplete.
Couldn't you subtract those values from default-directory instead?
> Well, I'm unaware of both the history of the command and why the related
> Elisp was commented out, though I do not think that the output format
> changed in a long time, or that anything else really changed in CVS
> recently :) I recommend asking someone more knowledgeable than me
OK, let's ask Dan.
In the meantime, here's a simple fix we can consider. This would still
adhere to the dir-status-files protocol, but it's probably slower than
ideal:
diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el
index a2499a2..e949f30 100644
--- a/lisp/vc/vc-cvs.el
+++ b/lisp/vc/vc-cvs.el
@@ -1073,7 +1073,7 @@ vc-cvs-dir-status-files
(if (and (not files) local (not (eq local 'only-file)))
(vc-cvs-dir-status-heuristic dir update-function)
(if (not files) (setq files (vc-expand-dirs (list dir) 'CVS)))
- (vc-cvs-command (current-buffer) 'async files "-f" "status")
+ (vc-cvs-command (current-buffer) 'async dir "-f" "status")
;; Alternative implementation: use the "update" command instead of
;; the "status" command.
;; (vc-cvs-command (current-buffer) 'async
next prev parent reply other threads:[~2016-10-08 1:01 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-26 20:02 bug#24082: 25.1; vc-dir for CVS repositories list all files as if from toplevel directory Göktuğ Kayaalp
2016-07-30 0:35 ` bug#24082: vc-dir changes working directory (git backend) Steve Revilak
2016-10-06 23:32 ` Dmitry Gutov
2016-08-28 20:17 ` bug#24082: [PATCH] Use ‘cvs update’ instead ‘cvs status’ for CVS *vc-dir* buffers Göktuğ Kayaalp
2016-10-06 23:25 ` Dmitry Gutov
2016-10-07 19:29 ` Göktuğ Kayaalp
2016-10-08 1:01 ` Dmitry Gutov [this message]
2016-10-08 1:04 ` Dmitry Gutov
2016-10-12 0:59 ` Dan Nicolaescu
2016-10-13 18:10 ` Göktuğ Kayaalp
2016-10-22 1:34 ` Dan Nicolaescu
2016-10-05 18:31 ` bug#24082: Update Göktuğ Kayaalp
2016-10-05 18:33 ` Eli Zaretskii
2016-10-07 14:45 ` bug#24082: 25.1; vc-dir for CVS repositories list all files as if from toplevel directory Jérémie Courrèges-Anglas
2016-10-08 0:38 ` Dmitry Gutov
2016-10-08 15:13 ` Jérémie Courrèges-Anglas
2016-10-08 20:06 ` Dmitry Gutov
2016-10-09 12:18 ` Göktuğ Kayaalp
2016-10-10 23:55 ` Dmitry Gutov
2016-10-11 2:09 ` Göktuğ Kayaalp
2016-10-11 7:51 ` Andreas Schwab
2016-10-11 8:51 ` Dmitry Gutov
2016-10-11 15:48 ` Göktuğ Kayaalp
2016-10-10 16:41 ` Jérémie Courrèges-Anglas
2016-10-13 18:47 ` Göktuğ Kayaalp
2016-10-14 20:33 ` Jérémie Courrèges-Anglas
2016-10-15 12:36 ` Dmitry Gutov
2016-10-15 13:20 ` Göktuğ Kayaalp
2016-10-15 14:06 ` Jérémie Courrèges-Anglas
2016-10-15 17:26 ` Göktuğ Kayaalp
2016-10-15 21:36 ` Dmitry Gutov
2016-10-16 0:03 ` Göktuğ Kayaalp
2016-10-16 12:38 ` Jérémie Courrèges-Anglas
2016-10-16 14:07 ` Dmitry Gutov
2016-10-16 14:23 ` Eli Zaretskii
2016-10-16 15:58 ` Dmitry Gutov
2016-10-16 17:58 ` Eli Zaretskii
2016-10-18 0:04 ` Dmitry Gutov
2016-10-18 17:35 ` Göktuğ Kayaalp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4af6dea0-e5e9-6bc7-c10f-a792f16874a5@yandex.ru \
--to=dgutov@yandex.ru \
--cc=24082@debbugs.gnu.org \
--cc=self@gkayaalp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).