Bug 1183982 - Ensure state directory exists before touching state file; a=me

The creation of the directory used to be handled by the running of the
wizard. Now, since we touch the state file first, we need to create the
directory manually. Derp.
This commit is contained in:
Gregory Szorc 2015-07-15 00:42:03 -07:00
parent 720cc70372
commit c4a2bcd2b4

View File

@ -49,8 +49,12 @@ class VersionControlCommands(object):
# We put this before main command logic because the command can
# persistently fail and we want people to get credit for the
# intention, not whether the command is bug free.
state_path = os.path.join(self._context.state_dir,
'mercurial/setup.lastcheck')
state_dir = os.path.join(self._context.state_dir, 'mercurial')
if not os.path.isdir(state_dir):
os.makedirs(state_dir)
state_path = os.path.join(state_dir, 'setup.lastcheck')
with open(state_path, 'a'):
os.utime(state_path, None)