GNU bug report logs - #18940
24.4; vc-hg does not disable pager, leading to hangs (at least with tramp)

Previous Next

Package: emacs;

Reported by: Daniel Pittman <dpittman <at> fb.com>

Date: Mon, 3 Nov 2014 21:51:01 UTC

Severity: normal

Found in version 24.4

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Daniel Pittman <dpittman <at> fb.com>
Cc: 18940 <at> debbugs.gnu.org
Subject: bug#18940: 24.4; vc-hg does not disable pager, leading to hangs (at least with tramp)
Date: Sun, 09 Nov 2014 11:24:21 +0100
Daniel Pittman <dpittman <at> fb.com> writes:

> C-x C-f /sshx:dpittman <at> remotehost.local:/path/to/file/in/hg/repo.txt
>
> …and Emacs hangs.
>
> I had problems with the Hg backend hanging via tramp; checking showed that it
> was hung waiting on `less`, which was sitting there telling me that the
> terminal wasn't fully featured and could it please, kindly, have some human
> input to let it know that it was OK to continue.

<http://mercurial.selenic.com/wiki/PagerExtension> discusses the
problem, and proposes even a solution for "Tramp in Emacs" :-)

> Anyway, options that probably make sense to set to make this smoother:
>
> 1. `HGPLAIN` exists in the environment.
>
> This disables things that might change output, and is recommended for
> non-interactive calls to try and discourage random breakage.

I'm a little bit reluctant to add this per default to
`tramp-remote-process-environment'. There shouldn't be such default
application specific settings.

But the following patch might be sufficient (could you, please, test?):

--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/emacs/lisp/vc/vc-hg.el.~118313~	2014-11-09 11:19:05.851785605 +0100
--- /home/albinus/src/emacs/lisp/vc/vc-hg.el	2014-11-09 11:13:53.255025363 +0100
***************
*** 210,220 ****
  			     ;; can parse the output.
  			     (append (list "TERM=dumb" "LANGUAGE=C")
  				     process-environment)))
! 			(process-file
! 			 vc-hg-program nil t nil
! 			 "--config" "alias.status=status"
! 			 "--config" "defaults.status="
! 			 "status" "-A" (file-relative-name file)))
                      ;; Some problem happened.  E.g. We can't find an `hg'
                      ;; executable.
                      (error nil)))))))
--- 210,227 ----
  			     ;; can parse the output.
  			     (append (list "TERM=dumb" "LANGUAGE=C")
  				     process-environment)))
! 			(if (file-remote-p file)
! 			    (process-file
! 			     "env" nil t nil
! 			     "HGPLAIN=1" vc-hg-program
! 			     "--config" "alias.status=status"
! 			     "--config" "defaults.status="
! 			     "status" "-A" (file-relative-name file))
! 			  (process-file
! 			   vc-hg-program nil t nil
! 			   "--config" "alias.status=status"
! 			   "--config" "defaults.status="
! 			   "status" "-A" (file-relative-name file))))
                      ;; Some problem happened.  E.g. We can't find an `hg'
                      ;; executable.
                      (error nil)))))))
--8<---------------cut here---------------end--------------->8---

> 3. --color never
>
> ...because if you have a tty, and less/hg think it is an interactive enough
> call to invoke the pager and complain to a human, you might well get color
> displayed as well.
>
> 4. --pager never
>
> ...because you just don't want to page the output for non-interactive use.

It looks, like you need to enable the respective extensions in your .hgrc.
Therefore, they cannot be added in vg-hg.el by default, I fear.

Best regards, Michael.




This bug report was last modified 10 years and 273 days ago.

Previous Next


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