diff --git a/mercurial/hg.py b/mercurial/hg.py
index 7698c275aa5620f731e6d76d67cadc414150b3f0_bWVyY3VyaWFsL2hnLnB5..de9eb6b1da4fc522b1cab16d86ca166204c24f25_bWVyY3VyaWFsL2hnLnB5 100644
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -17,7 +17,7 @@
 import errno, os, shutil
 
 def _local(path):
-    path = util.expandpath(util.localpath(path))
+    path = util.expandpath(util.urllocalpath(path))
     return (os.path.isfile(path) and bundlerepo or localrepo)
 
 def addbranchrevs(lrepo, repo, branches, revs):
@@ -227,8 +227,8 @@
     else:
         dest = ui.expandpath(dest)
 
-    dest = util.localpath(dest)
-    source = util.localpath(source)
+    dest = util.urllocalpath(dest)
+    source = util.urllocalpath(source)
 
     if os.path.exists(dest):
         if not os.path.isdir(dest):
@@ -250,7 +250,7 @@
     try:
         abspath = origsource
         if islocal(origsource):
-            abspath = os.path.abspath(util.localpath(origsource))
+            abspath = os.path.abspath(util.urllocalpath(origsource))
 
         if islocal(dest):
             dircleanup = DirCleanup(dest)
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
index 7698c275aa5620f731e6d76d67cadc414150b3f0_bWVyY3VyaWFsL2xvY2FscmVwby5weQ==..de9eb6b1da4fc522b1cab16d86ca166204c24f25_bWVyY3VyaWFsL2xvY2FscmVwby5weQ== 100644
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1985,7 +1985,7 @@
     return os.path.join(base, name.replace('journal', 'undo', 1))
 
 def instance(ui, path, create):
-    return localrepository(ui, util.localpath(path), create)
+    return localrepository(ui, util.urllocalpath(path), create)
 
 def islocal(path):
     return True
diff --git a/mercurial/util.py b/mercurial/util.py
index 7698c275aa5620f731e6d76d67cadc414150b3f0_bWVyY3VyaWFsL3V0aWwucHk=..de9eb6b1da4fc522b1cab16d86ca166204c24f25_bWVyY3VyaWFsL3V0aWwucHk= 100644
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -1589,7 +1589,7 @@
 def hasdriveletter(path):
     return path[1:2] == ':' and path[0:1].isalpha()
 
-def localpath(path):
+def urllocalpath(path):
     return url(path, parsequery=False, parsefragment=False).localpath()
 
 def hidepassword(u):