[PATCH 0 of 1 hglib] hglib: Fix working directory issues

Jeff Laughlin jmlaughlin at integrated-informatics.com
Mon Nov 28 10:16:55 CST 2011


I found and issue with doing hg archive commands whereby the include patterns would
NEVER match. It turned out that for whatever reason Hg tests patterns agains the current
working directory, even if that isn't the repo directory. This is probably a non-issue for the
command line hg client since you pretty much have to start it from the repo dir. In our case
because we are starting it with subprocess.popen the hg proc inherits the CWD from the
Python process, which makes Hg confused.

This patch simply appends cwd=path to the popen call to set the cwd of the hg process
to the repo path.

I added a regression test for this behavior.


More information about the Mercurial-devel mailing list