Search code examples
mercurialcygwin

Using Mercurial with Cygwin?


We've been trying to use Mercurial with Cygwin (on Windows) but run into an error as Cygwin uses forward slashes and Mercurial seems to require backslashes. Is there a workaround?

Example of issue:

hg status 
M src\myfile.java

hg ci src\myfile.java   <-- Error: abort: srcmyfile.java: The system cannot find the file specified

??


Solution

  • I don't have such a problem because I use two Mercurials:

    • mercurial bundled with TortoiseHG for use in windows cmd shell (usually I don't use it directly but it's used by TortoiseHG GUI tools).
    • cygwin's mercurial which I can use in cygwin.

    You can safely use both of them because both versions store version history in the same .hg folder. Mercurial stores info about paths in .hg folder is some OS-independent way.

    To be safe use the same version for both Mercurials.