[PATCH] util: make ensuredirs safer against races

Kevin Bullock kbullock+mercurial at ringworld.org
Wed Feb 13 13:32:06 CST 2013


On Feb 13, 2013, at 1:04 PM, Bryan O'Sullivan wrote:

> # HG changeset patch
> # User Bryan O'Sullivan <bryano at fb.com>
> # Date 1360782158 28800
> # Node ID e6216ef880db51568b067ab4fc88c2bdf50beca2
> # Parent  1506eb487dddbc377398096ce797fa5ccd712f10
> util: make ensuredirs safer against races
> 
> [...]
> diff --git a/mercurial/util.py b/mercurial/util.py
> --- a/mercurial/util.py
> +++ b/mercurial/util.py
> @@ -16,7 +16,7 @@ hide platform-specific details from the 
> from i18n import _
> import error, osutil, encoding, collections
> import errno, re, shutil, sys, tempfile, traceback
> -import os, time, datetime, calendar, textwrap, signal
> +import os, stat, time, datetime, calendar, textwrap, signal

Is stat actually needed? I don't see it used below.

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock



More information about the Mercurial-devel mailing list