From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Julio Merino Newsgroups: gmane.emacs.bugs Subject: bug#6513: vc-mtn broken with monotone 0.48 (can't even open files) Date: Sun, 27 Jun 2010 00:45:29 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1277596767 6605 80.91.229.12 (26 Jun 2010 23:59:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 26 Jun 2010 23:59:27 +0000 (UTC) Cc: 6513@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 27 01:59:25 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OSfHM-0001mK-Pa for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Jun 2010 01:59:21 +0200 Original-Received: from localhost ([127.0.0.1]:46418 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OSfHM-0003vw-9z for geb-bug-gnu-emacs@m.gmane.org; Sat, 26 Jun 2010 19:59:20 -0400 Original-Received: from [140.186.70.92] (port=55467 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OSfHH-0003vp-8h for bug-gnu-emacs@gnu.org; Sat, 26 Jun 2010 19:59:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OSfHF-0005PV-QW for bug-gnu-emacs@gnu.org; Sat, 26 Jun 2010 19:59:15 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60404) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OSfHF-0005PP-NB for bug-gnu-emacs@gnu.org; Sat, 26 Jun 2010 19:59:13 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OSf4T-0006eW-VU; Sat, 26 Jun 2010 19:46:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Julio Merino Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 26 Jun 2010 23:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6513 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6513-submit@debbugs.gnu.org id=B6513.127759595725566 (code B ref 6513); Sat, 26 Jun 2010 23:46:01 +0000 Original-Received: (at 6513) by debbugs.gnu.org; 26 Jun 2010 23:45:57 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OSf4N-0006eJ-TG for submit@debbugs.gnu.org; Sat, 26 Jun 2010 19:45:56 -0400 Original-Received: from mail-iw0-f172.google.com ([209.85.214.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OSf4L-0006eE-Lj for 6513@debbugs.gnu.org; Sat, 26 Jun 2010 19:45:54 -0400 Original-Received: by iwn40 with SMTP id 40so611961iwn.3 for <6513@debbugs.gnu.org>; Sat, 26 Jun 2010 16:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=g9t9MRKa/7ODfPtf2gEe7q9nAxCXcSJ7bxc4LCvIe0c=; b=AlJyZu34UrVSeNE4IJF2Sl18T/VV6uuitA3Mjp32cPZ8arUDqUrug1JVnTFonZ5oSf 5m0IM5z+BIe+bFTY3HuKMMYWdWo6HMngnMqNpZgLxCR9KzS8SkO4x5kAeZYx8TKTnu7d dVXvwWfbGIjtR1x8ZfIQvdl7sqXCMZ1qbn+jE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=ZrE9nMQShDlZR7otI/M5Xz575VOpNh178jqHqGGeiUTlvGLNOkKa/TDztCnQmBPJLh YdYyuFMKVaGnIgg6Q8veT9U3SRI1GfnqaBrSQO4TSc7PqSwaCC7LBBtcnSBQdvXZ2X1D gRhlXEbCHkGcuU8pHBibGzh/Z8AvUWxZvI/bg= Original-Received: by 10.231.148.130 with SMTP id p2mr2741370ibv.11.1277595949203; Sat, 26 Jun 2010 16:45:49 -0700 (PDT) Original-Received: by 10.231.206.202 with HTTP; Sat, 26 Jun 2010 16:45:29 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 26 Jun 2010 19:46:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:38036 Archived-At: On Sat, Jun 26, 2010 at 11:27 PM, Stefan Monnier wrote: >> Wrong type argument: stringp, nil > > Try "Options =3D> Enter Debugger on Error" and reproduce the bug, to get > a backtrace. Here comes one: Debugger entered--Lisp error: (wrong-type-argument stringp nil) string-match("\\`[^:/#]*[:/#]" nil) vc-mtn-mode-line-string("/home/jmmv/os/atf/2/atf-c++.hpp") apply(vc-mtn-mode-line-string "/home/jmmv/os/atf/2/atf-c++.hpp") vc-call-backend(Mtn mode-line-string "/home/jmmv/os/atf/2/atf-c++.hpp") vc-mode-line("/home/jmmv/os/atf/2/atf-c++.hpp" Mtn) vc-find-file-hook() run-hooks(find-file-hook) after-find-file(nil t) find-file-noselect-1(# "~/os/atf/2/atf-c++.hpp" nil nil "~/os/atf/2/atf-c++.hpp" (22103647 0)) find-file-noselect("~/os/atf/2/atf-c++.hpp" nil nil t) find-file("~/os/atf/2/atf-c++.hpp" t) call-interactively(find-file nil nil) >> The fix is to stop using random mtn commands in vc-mtn and change the >> code to *only* use subcommands of 'mtn automate'. =A0'automate' is The >> interface to interact with monotone from other applications, because >> it exposes a stable interface with well-defined intput/output >> semantics. > > Thank you, that is very useful to know. > I wrote vc-mtn.el a long time ago but don't actually use Monotone much > these days and don't have much time to devote to it, so if you could > help us fix it, that would be really appreciated. I'd like to help in fixing it, and I actually tried to do it myself... but my elisp skills are quite rudimentary and I don't have that much time to learn it right now :-P That said, fixing the code shouldn't be that hard; just a matter of renaming some commands and changing the regular expressions used to deal with the results. The major offending command that is causing breakage seems to be "mtn status" and, in particular, regexes like: (re-search-forward "Branch: \\(.*\\)\n.*\nChanges against parent \\(.*\\)" nil t) (while (re-search-forward "^ \\(?:\\(patched \\)\\|\\(added \\)\\)\\(.*\\)$" nil t) I suggest changing the code to use "monotone automate get_current_revision", which yields an output like: ----- $ mtn automate get_current_revision format_version "1" new_manifest [6466cf3b1c785b949d02ef85daea66bd42a0d140] old_revision [6aa25b8d86bd92a304ec21edd1374f56077ea658] add_file "foo" content [da39a3ee5e6b4b0d3255bfef95601890afd80709] patch "atf-check/atf-check.cpp" from [a200c3b32c0e7676797d20a188d4c20963b4d10e] to [ae4801edb72c0486c7652c030fc3f8196b21840e] patch "test-programs/result_test.sh" from [398f9f2beba40eb66d93d1b424e4ea703d16f6f0] to [584a05bec8a359759b2f82d39862f43c9d4d794a] ----- Note the version number at the top of the output, which can be used to detect if the output is compatible with what the code expects. Also note the add_file, patch and old_revision lines, which should match old previous regexp patterns. I can probably invest some time tomorrow trying to find what is the best way to implement every mtn command through the automate interface. But it'd be nice if we fixed first the show stoppers. But, anyway, please take a look at: http://monotone.ca/docs/Automation.html#Automation It describes all automate commands, their output and their compatibility. It seems to be pretty well documented :-) --=20 Julio Merino