D4550: localrepo: use urllocalpath() for path to create repo too

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Sep 12 19:24:01 UTC 2018


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  It looks like this was lost in https://phab.mercurial-scm.org/rHG7ce9dea3a14a9142dadb2083f34a22834f5e9b70 (localrepo: move repo
  creation logic out of localrepository.__init__ (API), 2018-09-11). I
  don't know when it makes a difference (maybe on Windows, since
  urllocalpath() mentions something about drive letters).

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4550

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
@@ -2377,10 +2377,11 @@
     return os.path.join(base, name.replace('journal', 'undo', 1))
 
 def instance(ui, path, create, intents=None, createopts=None):
+    localpath = util.urllocalpath(path)
     if create:
-        createrepository(ui, path, createopts=createopts)
+        createrepository(ui, localpath, createopts=createopts)
 
-    return localrepository(ui, util.urllocalpath(path), intents=intents)
+    return localrepository(ui, localpath, intents=intents)
 
 def islocal(path):
     return True



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list