Skip to content

Commit 011c01e

Browse files
committed
Build: Mercurial (hg) compatibility with old versions
We are using Ubuntu 20.04 LTS to perform the clone step (`readthedocs/build:ubuntu-20.04`) which comes with Mercurial v5.3.1 and install by default the `sparse-revlog` requirement. However, if the build is using `readthedocs/build:latest`, which comes with Mercurial v4.5.3 and does not contain that requirement it fails: ``` hg identify --id abort: repository requires features unknown to this Mercurial: sparserevlog! (see https://mercurial-scm.org/wiki/MissingRequirement for more information) ``` This commit disables that requirements to make the clone compatible with the older version of Mercurial. Closes #8995
1 parent 3aad444 commit 011c01e

File tree

1 file changed

+8
-1
lines changed
  • readthedocs/vcs_support/backends

1 file changed

+8
-1
lines changed

readthedocs/vcs_support/backends/hg.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,14 @@ def pull(self):
3333
def clone(self):
3434
self.make_clean_working_dir()
3535
try:
36-
output = self.run("hg", "clone", self.repo_url, ".")
36+
# Disable sparse-revlog extension when cloning because it's not
37+
# included in older versions of Mercurial and producess an error
38+
# when using an old version. See
39+
# https://github.com/readthedocs/readthedocs.org/pull/9042/
40+
41+
output = self.run(
42+
"hg", "clone", "--config", "format.sparse-revlog=no", self.repo_url, "."
43+
)
3744
return output
3845
except RepositoryError:
3946
raise RepositoryError(RepositoryError.CLONE_ERROR)

0 commit comments

Comments
 (0)