Odd problem with Mercurial branch cache in Ubuntu 18.04 LTS

This is a fairly standard installation on Ubuntu 18.04 LTS: its Mercurial package is at version 4.5.3, which is the relevant point here (see below).

For completeness here is full set of versions reported by Phabricator:

phabricator
    4cd333b33fb1495c2b5a0b2ea4123110d1533249 (Tue, Dec 10) 
arcanist
    cc850163f30c4697e925df0d6212469679600a2c (Tue, Nov 19) 
phutil
    39ed96cd818aae761ec92613a9ba0800824d0ab0 (Sep 30 2019) 
php
    7.2.24-0ubuntu0.18.04.1 
diff
    3.6 at /usr/bin/diff 
git
    2.17.1 at /usr/bin/git 
hg
    4.5.3 at /usr/bin/hg 
pygmentize
    2.2.0 at /usr/bin/pygmentize 
svn
    1.9.7 at /usr/bin/svn 

The problem happens for a new Mercurial repository when importing changesets for the first time. The bad result is a “ghost entry” saying “couldn’t wri”, see

That is a low-level Mercurial error saying “couldn’t write revision branch cache names” (as shown when hovering over the item). It seems to do no harm, but is a bit ugly.

The problem is caused by particular versions of Mercurial. A workaround is to uninstall the Ubuntu 18.04 “mercurial” package and install e.g. Mercurial 5.2.1 source release as usual via “make all && make install”.

Steps to reproduce:

  1. Create Mercurial Repository
  2. Activate Repository
  3. push some changes to the repository (e.g. via ssh)
  4. alternative: edit URLs to observe an existing repository and update that

Tests with various Mercurial versions

The bad version in Ubuntu 18.04 is Mercurial 4.5.3. Here are further results of testing other versions built from sources:

  • 5.2.1 GOOD
  • 5.1.1 GOOD
  • 5.0.1 BAD
  • 4.5.3 BAD
  • 4.4 BAD
  • 4.2 BAD
  • 4.1 BAD
  • 4.0 BAD
  • 3.9.2 GOOD
  • 3.9 GOOD
  • 3.8 GOOD
  • 2.8.2 GOOD

Mercurial 2.8.2 is used on https://admin.phacility.com – so there is presently no problem there.