"abort: The system cannot find the file specified" in Mercurial

Issue

I have a large (~700MB) Mercurial repository. I can clone the repo fine without updating (and also it’s totally browsable on Bitbucket, where it’s hosted) but I can’t update the working directory to the latest changeset because I get the following error:

... lot of getting [path] lines here
getting path/to/some/file.ext
abort: The system cannot find the file specified
[command returned code 255 Wed Jun 24 00:51:37 2015]

The last file before the error actually exists in the repo (it’s visible in Bitbucket too).

I thought the issue was because of too long paths, but even cloning to a drive root yields the same. Paths could still be too long but "path/to/some/file.ext" is just 60 characters.

Running the command with traceback yields this:

Traceback (most recent call last):
  File "mercurial\dispatch.pyo", line 160, in _runcatch
  File "mercurial\dispatch.pyo", line 885, in _dispatch
  File "mercurial\dispatch.pyo", line 646, in runcommand
  File "mercurial\dispatch.pyo", line 976, in _runcommand
  File "mercurial\dispatch.pyo", line 947, in checkargs
  File "mercurial\dispatch.pyo", line 882, in <lambda>
  File "mercurial\util.pyo", line 716, in check
  File "mercurial\extensions.pyo", line 168, in closure
  File "mercurial\util.pyo", line 716, in check
  File "hgext\mq.pyo", line 3505, in mqcommand
  File "mercurial\util.pyo", line 716, in check
  File "mercurial\commands.pyo", line 6402, in update
  File "mercurial\hg.pyo", line 535, in clean
  File "mercurial\hg.pyo", line 520, in updaterepo
  File "mercurial\merge.pyo", line 1140, in update
  File "mercurial\merge.pyo", line 772, in applyupdates
  File "mercurial\subrepo.pyo", line 246, in submerge
  File "mercurial\context.pyo", line 252, in sub
  File "mercurial\subrepo.pyo", line 341, in subrepo
  File "mercurial\subrepo.pyo", line 1206, in __init__
  File "mercurial\subrepo.pyo", line 1216, in _ensuregit
  File "mercurial\subrepo.pyo", line 1294, in _gitnodir
  File "subprocess.pyo", line 710, in __init__
  File "subprocess.pyo", line 958, in _execute_child
WindowsError: [Error 2] The system cannot find the file specified

The repo has git subrepos (these are public repos on GitHub). And hg-git works for me otherwise, I’m able to pull from and push to git repos from hg.

Anybody with an idea how to solve this?

Solution

Solved the issue: Lazy Badger pointed into the right direction. The issue was that the path to the git executable wasn’t added to my PATH environment variable.

Adding C:\Program Files (x86)\Git\bin\ (or where you have git.exe on your system) to PATH with Rapid Environment Editor (I needed to use this tool as my PATH was over 1024 chars, so using setx wasn’t working) to the System variables solved it.

Answered By – Piedone

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published