D4706: localrepo: validate directories before creating any
indygreg (Gregory Szorc)
phabricator at mercurial-scm.org
Wed Sep 26 13:23:19 EDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGb504ff813c4f: localrepo: validate directories before creating any (authored by indygreg, committed by ).
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D4706?vs=11314&id=11378
REVISION DETAIL
https://phab.mercurial-scm.org/D4706
AFFECTED FILES
mercurial/localrepo.py
CHANGE DETAILS
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -2798,13 +2798,14 @@
requirements = newreporequirements(ui, createopts=createopts)
wdirvfs = vfsmod.vfs(path, expandpath=True, realpath=True)
- if not wdirvfs.exists():
- wdirvfs.makedirs()
hgvfs = vfsmod.vfs(wdirvfs.join(b'.hg'))
if hgvfs.exists():
raise error.RepoError(_('repository %s already exists') % path)
+ if not wdirvfs.exists():
+ wdirvfs.makedirs()
+
hgvfs.makedir(notindexed=True)
if b'store' in requirements:
To: indygreg, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list