Pager clashes with commit editor (1.7.3)

rreth robert.rethemeyer at oracle.com
Tue Jan 11 23:39:08 CST 2011


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.

(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.


More information about the Mercurial mailing list