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
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to