Jun's Blog

Output, activities, memo and etc.

Download cpytyon with Mercurial

I wanted to compile python from source code, reading a document[1].

However I was failed to do it last time. [2] hg clone was failed because of the issue. It may be because of my PC’s poor memory environment.

$ hg clone https://hg.python.org/cpython
destination directory: cpython
requesting all changes
adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
abort: stream ended unexpectedly (got 42439 bytes, expected 1852137568)

But today I found an article[3]. And finally I could download. Let me write the way here. cpython(python) has repositories for Mercurial (primary), Github(mirror). But in the git repository, the tags information is not kept. And that is not convenient to install specified version’s python.

Create empty hg environment.

$ hg init cpython

$ cd cpython

Download information one by one, like a fetch. Seeing hg log | less after each hg pull.

$ hg pull -r 50 https://hg.python.org/cpython
$ hg pull -r 500 https://hg.python.org/cpython
$ hg pull -r 5000 https://hg.python.org/cpython
$ hg pull -r 50000 https://hg.python.org/cpython
$ hg pull -r 100000 https://hg.python.org/cpython
$ hg pull https://hg.python.org/cpython

Download files.

$ hg update

Add paths information manually

$ vi .hg/hgrc
[paths]
default = https://hg.python.org/cpython

[ui]
$ hg paths
default = https://hg.python.org/cpython

And check information finally.

$ hg heads
$ hg branches
$ hg tags

Once this operation, it’s no problem to use hg pull.

$ hg pull
pulling from https://hg.python.org/cpython
searching for changes
no changes found

Reference