Is it a Virus?
✔ NO - Safe
Must be in C:\Program Files\Mercurial or C:\Program Files (x86)\Mercurial; check digital signature.
Warning
Occasional multiple processes
Mercurial GUI tools like TortoiseHg may spawn separate mercurial.exe processes per operation
Can I Disable?
YES
Close shells or GUI tools; mercurial.exe runs only when commands execute or GUI utilities invoke it
What is mercurial.exe?
mercurial.exe is the Windows executable that powers the Mercurial distributed version control system. It launches when you run hg commands or use GUI tools that wrap Mercurial, and it coordinates repository operations across local clones.
Mercurial uses a lightweight, distributed model with a simple data store. The mercurial.exe core handles command parsing, repository plumbing, and network operations, delegating heavy lifting to the Python-based engine.
Quick Fact: Mercurial emphasizes speed and simplicity; mercurial.exe orchestrates fast operations across repositories with a compact manifest-based data model.
Types of Mercurial Processes
- Command Process: Executes hg commands from CLI or GUI wrappers
- Server/HGWeb: Optional local server for hosting repositories
- Hook/Utility Process: Pre/post-commit or custom hooks triggered by operations
- GUI Helper: GUI front-ends like TortoiseHg invoke mercurial.exe behind the scenes
- Background Sync: Background repository operations via cron/ scheduled tasks
- Extension/Plugin Helper: Extensions interact with Mercurial via mercurial.exe
Is mercurial.exe Safe?
Yes, mercurial.exe is safe when it's the legitimate file from the Mercurial project downloaded from official sources (https://www.mercurial-scm.org/ or via official package managers).
Is mercurial.exe a Virus or Malware?
The real mercurial.exe is NOT a virus. Malware masquerading with similar names exists, so verify paths and signatures.
How to Tell if mercurial.exe is Legitimate or Malware
- File Location: Must be in
C:\Program Files\Mercurial\ or C:\Program Files (x86)\Mercurial\. Any mercurial.exe elsewhere is suspicious.
- Digital Signature: Right-click the file in Explorer > Properties > Digital Signatures. Should show a valid signature from The Mercurial Project or similar.
- Resource Usage: Normal mercurial.exe usage is modest; heavy, constant CPU or memory indicates automation or malware
- Behavior: Mercurial runs only when you issue hg commands or when GUI wrappers invoke it. Persistent background activity without user action is suspicious.
Red Flags: If mercurial.exe is located in Temp, AppData, or System32, or it runs without commands, or lacks a signature, scan with antivirus and verify repository integrity.
Why Is mercurial.exe Running on My PC?
Mercurial runs when you perform repository operations or when GUI tools trigger Mercurial. It may also run as part of a local hgweb server or build pipelines.
Reasons it's running:
- Active Mercurial Command: You are executing hg commands in a terminal or GUI wrapper; mercurial.exe runs to complete the operation
- GUI Wrapper Invocation: TortoiseHg, SourceTree, or other GUIs invoke mercurial.exe under the hood for operations
- Local HgWeb Server: If you run a local Mercurial web interface, mercurial.exe may be invoked by the server
- Background Hooks: Pre/post-commit hooks, repository hooks, or automation scripts call mercurial.exe
- CI/Build Pipelines: Continuous integration tasks fetch or push changes via Mercurial, launching mercurial.exe
Can I Disable or Remove mercurial.exe?
Yes, you can disable mercurial.exe. Only remove Mercurial if you no longer need version control for your projects.
How to Stop mercurial.exe
- Close Command Prompts/ GUI: Exit any terminal or GUI that is running hg commands
- Terminate Processes: Open Task Manager, locate mercurial.exe, and End Task
- Disable Startup (if applicable): Remove any startup task or service invoking Mercurial, if present
- Guard Against Background Tasks: Ensure no automation scripts trigger Mercurial in the background
- Uninstall Mercurial: Use Programs and Features to uninstall Mercurial; consider portable options if needed
How to Uninstall Mercurial
- ✔ Windows Settings → Apps → Apps & Features → Mercurial → Uninstall
- ✔ Control Panel → Programs → Uninstall a program → Mercurial → Uninstall
- ✔ Remove remaining folders: C:\Program Files\Mercurial and C:\Program Files (x86)\Mercurial
Common Problems: High CPU or Memory Usage
If mercurial.exe consumes excessive resources during repository operations:
Common Causes & Solutions
- Large repository with many changesets: Limit log operations, use shallow fetch, or work with smaller clones; prune history if appropriate
- Running hg status or log on huge repos: Filter with rev or subset, avoid broad queries; use -r to limit scope
- Complex diffs or patch series: Try smaller commits and incremental operations; use hg diff with limits
- Misconfigured extensions/hooks: Disable or fix problematic extensions; review .hgrc and hook scripts
- Background automation or CI tasks: Schedule Mercurial tasks during low activity, throttle parallel jobs
- Antivirus real-time scanning: Add Mercurial directories to exclusions to reduce scan overhead
Quick Fixes:
1. Observe activity with Task Manager or Process Explorer to identify the command being run
2. Limit repository view commands; avoid broad 'hg log' on very large repos
3. Disable unnecessary extensions and hooks
4. Update Mercurial to the latest version
5. Configure antivirus exclusions for Mercurial directories
Frequently Asked Questions
Is mercurial.exe a virus?
No, mercurial.exe from the official Mercurial project is not a virus. Verify the file path in C:\Program Files\Mercurial and digital signatures from the Mercurial Project.
Why is mercurial.exe using so much CPU?
High CPU usually occurs during heavy repository operations or when a GUI wrapper launches many subprocesses. Use hg status with scope limits and ensure extensions aren't misbehaving.
Can I delete mercurial.exe?
Yes, you can uninstall Mercurial via Windows Settings if you no longer need it. Your repositories remain separate; the mercurial.exe binary will be removed with the package.
Can I disable mercurial.exe?
Yes, quit all Mercurial commands and close GUI tools. If you don't want Mercurial to run at startup, remove any startup invocation or services.
Why does Mercurial spawn multiple processes?
Mercurial uses a modular design; hg commands may spawn helper processes or GUI wrappers. Each operation might launch separate processes as needed.
How do I reduce Mercurial's memory usage?
Limit log queries, work with smaller clones, disable or remove heavy extensions, and upgrade to a version with performance improvements.