[PATCH] Purge crash on junction point

Matt Mackall mpm at selenic.com
Sun Feb 23 12:34:05 CST 2014

On Wed, 2014-02-19 at 22:43 +0000, Mathieu Cantin wrote:
> >Does this issue only exist with purge?
> Yes, I think. Our company has been using the fix for 1 or 2 weeks and
> I don't have others problems with junction points, but I always purge
> all repositories before pulling or updating (in the context of
> continuous integration).

My point is purge isn't doing anything that doesn't happen elsewhere in
Mercurial (deleting files and directories), so this bug is almost
certainly more generic and thus wants a less specific fix.

> >Is this really the only way os.listdir can get an OSError?
> Yes, the only one other solution would be to call the win32api in order to know if the directory is a junction.

There are actually lots of ways listdir can get an OSError that have
nothing to do with junctions.. and should probably continue to stop
Mercurial with an error. Your patch breaks all those cases because it
doesn't try to distinguish between types of error.

Mathematics is the supreme nostalgia of our time.

More information about the Mercurial-devel mailing list