python-hglib and vimdiff

Frankie Fisher frankie.fisher at dai.co.uk
Thu Oct 15 13:02:12 UTC 2020


Hi,

We're running into some issues with hglib and I wonder if anyone has seen a similar issue before. When we trigger some merges within hglib, the library freezes (on user input) if vimdiff is the merge tool that hg selects, but operate as normal if gvimdiff or meld is selected.

This issue occurs with python hg-lib 2.6.1 (latest), 2.6, 2.4, 1.9 & 1.6.
It also occurs with mercurial 5.3.1/python 3.8.5, and mercurial 2.6.2/python3.6.8.

I've written below a minimal test case that demonstrates this issue. The hg lib merge command gets stuck waiting for data from the command server, and if you ctrl-c out of it you see the following call stack:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/frankster/venv/lib/python3.8/site-packages/hglib/client.py", line 1170, in merge
    self.rawcommand(args, prompt=prompt)
  File "/home/frankster/venv/lib/python3.8/site-packages/hglib/client.py", line 258, in rawcommand
    ret = self.runcommand(args, inchannels, outchannels)
  File "/home/frankster/venv/lib/python3.8/site-packages/hglib/client.py", line 192, in runcommand
    channel, data = self._readchannel()
  File "/home/frankster/venv/lib/python3.8/site-packages/hglib/client.py", line 148, in _readchannel
    data = self.server.stdout.read(hgclient.outputfmtsize)
KeyboardInterrupt


This is a minimal test case that creates a small merge and then triggers a merge via hglib and vimdiff:
----------------
#!/usr/bin/env bash
hg init test
cd test
echo "initial file" > file.txt
hg add file.txt
hg commit -m "initial commit" # create revision 0
echo "some changes" >> file.txt
hg commit -m "changed file" # create revision 1, parent revision 0
hg update -r 0
echo "some different changes" >> file.txt
hg commit -m "changed file differently in a new head" # create revision 2, parent revision 0

#now we use hglib to merge revisions 2 and 1 using vimdiff
python -c "import hglib; from hglib.util import *; client = hglib.open(); client.merge(rev=[b'1'], tool=b'vimdiff'); client.close()"
----------------------

Has anyone seen this before?


Frankie Fisher
Senior Software Engineer

DAI, a Dematic company
Milan Court
Bird Hall Lane
Stockport
SK3 0WZ
Phone: +44 161 374 6064
frankie.fisher at dai.co.uk

Connect with DAI            matflo.com<https://www.matflo.com/>            LinkedIn<https://www.linkedin.com/company/dai-digital-applications-international> | Facebook<https://www.facebook.com/DematicEurope/> | Twitter<https://twitter.com/DematicEurope>

PLEASE CONSIDER THE ENVIRONMENT BEFORE YOU PRINT THIS E-MAIL!
CONFIDENTIALITY NOTICE: This email message and any attachments to it, is intended only for the individual or entity to which it is addressed and may contain confidential material. If you are not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient, please do not disclose, copy, forward, or retain. If you have received this in error, please contact the sender by reply email and destroy all copies of the original.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial/attachments/20201015/e220b279/attachment.html>


More information about the Mercurial mailing list