Support Mercurial repositories as an alternative to Git

Open 💬 0 comments Opened Aug 25, 2026 by vdiego28

What variant of Codex are you using?

App, IDE Extension

What feature would you like to see?

I would like Codex to support Mercurial (hg) repositories in addition to Git repositories.

Currently, several Codex features assume that the workspace is backed by Git and specifically look for a .git repository. For example, the Undo functionality in Codex does not work when the project is a Mercurial repository, even though the project is fully version-controlled through hg.

Ideally, Codex should detect the version control system used by the workspace and use the corresponding VCS operations where appropriate.

For example:

.git repository → use Git
.hg repository → use Mercurial

At minimum, features such as Undo/revert, repository status detection, diffs, and change tracking should not require Git specifically when an equivalent operation is available through Mercurial.

Why would this be useful?

There are still projects and organizations that use Mercurial as their primary version control system.

Codex itself can already execute hg commands through the shell, so it can work with the source code in a Mercurial repository, but some of the higher-level Codex UI functionality becomes unavailable because the application assumes Git.

Suggested approach

It might be useful to introduce a small VCS abstraction internally rather than having Codex features depend directly on Git.

Conceptually, Codex could detect something like:

.git → Git backend
.hg → Mercurial backend

and expose common operations such as:

status
diff
revert
repository root
tracked files

through the appropriate backend.

For Mercurial, equivalents already exist for most of the operations Codex would need, for example:

hg status
hg diff
hg revert
hg root

This would also make it easier to support additional version control systems in the future without making individual Codex features depend directly on Git.

Additional information

_No response_

View original on GitHub ↗