Pager clashes with commit editor (1.7.3)

Brodie Rao brodie at bitheap.org
Wed Jan 12 17:38:54 CST 2011


On Jan 12, 2011, at 4:39 PM, rreth wrote:

>
> Greetings,
> I maintain the Mercurial installation for a small group of developers.
> I try to keep us up to date with the newer releases, so I recently
> upgraded HG from 1.6.4 to 1.7.3.
>
> Some users who prefer vi or vim as their ui.editor reported trouble
> with 1.7.3 while attempting to commit.  The editor would display
> broken and offset lines.  vim is more informative; it also prints
> a message stating that "output is not to a terminal".
>
> Not knowing what the problem really was, I did system call traces of
> "hg commit" with vim using both HG versions and comparing.  To shorten
> the story, 1.7.3 appears to be invoking the pager extension early and
> redirecting stdout to the pager (more).  Later when the vim editor  
> starts
> it reads the terminal attributes and finds it is not a terminal (a  
> pipe?).
> And of course the terminal directives don't work, so output is  
> garbled.
>
> 1.6.4 does not invoke the pager for commit, so vim is happy.  I can  
> make
> the problem go away in 1.7.3 by setting HGPLAIN or  
> pager.ignore=commit.
>
> (The above may not be completely accurate.  It's difficult to tell  
> which
> program is doing the system calls, and it doesn't help that I don't  
> really
> know Python or the Mercurial internals.)
>
> Probably the reason this problem is not more common is the setting  
> of my
> .hgrc pager config.  I have pager.attend=<empty> so that most  
> everything
> gets paged, which would include commit.  And of course I gave that  
> config
> to the users to set up their .hgrc.
>
> Although we can work around it with pager.ignore, this new behavior
> seems to me to be a bug, since it suddenly appeared when nothing else
> but the HG version changed.  Perhaps the pager needs to hard-code into
> the ignore list any commands which invoke ui.editor.
> Submitted for your consideration.

After some bisecting, I was able to narrow it down to this changeset  
changing pager's behavior:

changeset:   11945:5094e6b2f640
user:        Alecs King <alecsk at gmail.com>
date:        Wed Aug 11 20:28:39 2010 +0800
summary:     ui: differentiate empty configlist from None

Before that change, the extension couldn't differentiate between the  
option not being set and the option being set to an empty value.  
Setting --config pager.attend= would cause it to use the default  
command list instead of paging everything.

In the strictest sense, I think the new behavior is correct. However,  
it'd probably be a good idea to be able to mark commands as  
interactive so extensions like pager don't mess with them. On the  
other hand, there are some commands that make sense to page that can  
conditionally bring up authentication prompts, like incoming/outgoing.

For now, I'd recommend unsetting "pager.attend=" or specifying your  
own list.

> (OS is Solaris 10 SPARC, Mercurial built from source, local  
> installation)
>
> -- 
> View this message in context: http://mercurial.808500.n3.nabble.com/Pager-clashes-with-commit-editor-1-7-3-tp2239363p2239363.html
> Sent from the General mailing list archive at Nabble.com.
> _______________________________________________
> Mercurial mailing list
> Mercurial at selenic.com
> http://selenic.com/mailman/listinfo/mercurial



More information about the Mercurial mailing list