GNU bug report logs - #7171
vc-mtn to use "mtn automate"

Previous Next

Package: emacs;

Reported by: Masatake YAMATO <yamato <at> redhat.com>

Date: Thu, 7 Oct 2010 10:51:02 UTC

Severity: normal

Tags: moreinfo

Merged with 6513

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 7171 in the body.
You can then email your comments to 7171 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7171; Package emacs. (Thu, 07 Oct 2010 10:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Masatake YAMATO <yamato <at> redhat.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 07 Oct 2010 10:51:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Masatake YAMATO <yamato <at> redhat.com>
To: bug-gnu-emacs <at> gnu.org
Subject: error	at vc-mtn-mode-line-string of vc-mtn.el
Date: Thu, 07 Oct 2010 19:53:11 +0900 (JST)
When I tried to open a file under monotone version control system,
emacs reports an error because vc-mtn-workfile-branch in
vc-mtn-mode-line-string retruns nil.



Backtrace
------------------------------------------------------------------------
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("\\`[^:/#]*[:/#]" nil)
  (if (string-match (car rule) branch) (setq branch (replace-match (cdr rule) t nil branch)))
  (while --cl-dolist-temp-- (setq rule (car --cl-dolist-temp--)) (if (string-match (car rule) branch) (setq branch (replace-match (cdr rule) t nil branch))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--)))
  (let ((--cl-dolist-temp-- vc-mtn-mode-line-rewrite) rule) (while --cl-dolist-temp-- (setq rule (car --cl-dolist-temp--)) (if (string-match (car rule) branch) (setq branch (replace-match (cdr rule) t nil branch))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--))) nil)
  (catch (quote --cl-block-nil--) (let ((--cl-dolist-temp-- vc-mtn-mode-line-rewrite) rule) (while --cl-dolist-temp-- (setq rule (car --cl-dolist-temp--)) (if (string-match (car rule) branch) (setq branch (replace-match (cdr rule) t nil branch))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--))) nil))
  (cl-block-wrapper (catch (quote --cl-block-nil--) (let ((--cl-dolist-temp-- vc-mtn-mode-line-rewrite) rule) (while --cl-dolist-temp-- (setq rule (car --cl-dolist-temp--)) (if (string-match (car rule) branch) (setq branch (replace-match (cdr rule) t nil branch))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--))) nil)))
  (block nil (let ((--cl-dolist-temp-- vc-mtn-mode-line-rewrite) rule) (while --cl-dolist-temp-- (setq rule (car --cl-dolist-temp--)) (if (string-match (car rule) branch) (setq branch (replace-match (cdr rule) t nil branch))) (setq --cl-dolist-temp-- (cdr --cl-dolist-temp--))) nil))
  (dolist (rule vc-mtn-mode-line-rewrite) (if (string-match (car rule) branch) (setq branch (replace-match (cdr rule) t nil branch))))
  (let ((branch (vc-mtn-workfile-branch file))) (dolist (rule vc-mtn-mode-line-rewrite) (if (string-match (car rule) branch) (setq branch (replace-match (cdr rule) t nil branch)))) (format "Mtn%c%s" (case (vc-state file) ((up-to-date needs-update) 45) (added 64) (t 58)) branch))
  vc-mtn-mode-line-string("/tmp/net.venge.monotone/AUTHORS")
  apply(vc-mtn-mode-line-string "/tmp/net.venge.monotone/AUTHORS")
  vc-call-backend(Mtn mode-line-string "/tmp/net.venge.monotone/AUTHORS")
  vc-mode-line("/tmp/net.venge.monotone/AUTHORS" Mtn)
  vc-find-file-hook()
  run-hooks(find-file-hook)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer AUTHORS> "/tmp/net.venge.monotone/AUTHORS" nil nil "/tmp/net.venge.monotone/AUTHORS" (1205380 64768))
  find-file-noselect("/tmp/net.venge.monotone/AUTHORS" nil nil t)
  find-file("/tmp/net.venge.monotone/AUTHORS" t)
  call-interactively(find-file nil nil)
------------------------------------------------------------------------



Software version
------------------------------------------------------------------------
GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1) of 2010-10-07 on dhcp-193-209.nrt.redhat.com

mtn --version
monotone 0.48 (base revision: 844268c137aaa783aa800a9c16ae61edda80ecea)
------------------------------------------------------------------------

How to reproduce
------------------------------------------------------------------------
1. Prepare  source code under monotone vcs

   cd /tmp
   mtn clone monotone://code.monotone.ca/monotone net.venge.monotone
   ...

2. open a source code with \C-x\C-f

   \C-x\C-f
   Find file: /tmp/net.venge.monotone/AUTHORS

   You will got
   if: Wrong type argument: stringp, nil at *Message*
------------------------------------------------------------------------


My analysis
------------------------------------------------------------------------
An regular expression,  "Current branch: \\(.*\\)\nChanges against parent \\(.*\\)"
in  `vc-mtn-workfile-branch' doesn't match to the output of mtn status:

   $ cd /tmp/net.venge.monotone
   $ mtn status at /tmp/net.venge.monotone
   ----------------------------------------------------------------------
   Revision: 40f634fe2e8124dfa567a2ca805824dcfaf6f2c2
   Parent:   e50b098f9f507bd83207365c7893058fbd01635a
   Author:   ???
   Date:     10/07/2010 07:48:45 PM
   Branch:   net.venge.monotone

   Changes against parent e50b098f9f507bd83207365c7893058fbd01635a

   no changes

No "Current branch: ..." line is found.

I propose following patch but I'm not sure this patch is correct or
not because I'm too new to monotone.

2010-10-07  Masatake YAMATO  <yamato <at> redhat.com>

	* vc/vc-mtn.el (vc-mtn-working-revision): Use an empty
	string as the result of 'vc-mtn-working-revision'
	if it returns nil.


=== modified file 'lisp/vc/vc-mtn.el'
*** lisp/vc/vc-mtn.el	2010-08-29 16:17:13 +0000
--- lisp/vc/vc-mtn.el	2010-10-07 10:35:52 +0000
***************
*** 156,162 ****
  
  (defun vc-mtn-mode-line-string (file)
    "Return string for placement in modeline by `vc-mode-line' for FILE."
!   (let ((branch (vc-mtn-workfile-branch file)))
      (dolist (rule vc-mtn-mode-line-rewrite)
        (if (string-match (car rule) branch)
  	  (setq branch (replace-match (cdr rule) t nil branch))))
--- 156,162 ----
  
  (defun vc-mtn-mode-line-string (file)
    "Return string for placement in modeline by `vc-mode-line' for FILE."
!   (let ((branch (or (vc-mtn-workfile-branch file) "")))
      (dolist (rule vc-mtn-mode-line-rewrite)
        (if (string-match (car rule) branch)
  	  (setq branch (replace-match (cdr rule) t nil branch))))



Masatake YAMATO




Merged 6513 7171. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 01 Dec 2012 02:31:02 GMT) Full text and rfc822 format available.

Changed bug title to 'vc-mtn to use "mtn automate"' from 'error at vc-mtn-mode-line-string of vc-mtn.el' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 20 Feb 2013 04:59:01 GMT) Full text and rfc822 format available.

Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 06 May 2022 19:36:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#7171; Package emacs. (Sat, 04 Jun 2022 12:17:02 GMT) Full text and rfc822 format available.

Message #14 received at 7171 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 6513 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 7171 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#7171: vc-mtn to use "mtn automate"
Date: Sat, 04 Jun 2022 14:16:45 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

>> I don't object, but I think you may have missed
>>
>> https://debbugs.gnu.org/bug=6513#36
>>
>> which was a "quiet" comment explaining that the breakage was fixed
>> 2010-11-08. This bug stayed open as basically an improvement request to
>> use "mtn automate".
>
> Yup.  debbugs-gnu still doesn't display "quiet" comments, I think.

Anyway, I've now made vc-mtn obsolete in Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 7171 <at> debbugs.gnu.org and Masatake YAMATO <yamato <at> redhat.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 04 Jun 2022 12:17:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 03 Jul 2022 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 349 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.