util: rename the util.localpath that uses url to urllocalpath (issue2875) stable 1.9
authorMads Kiilerich <mads@kiilerich.com>
Fri, 01 Jul 2011 17:37:09 +0200
branchstable
changeset 14825 de9eb6b1da4f
parent 14824 7698c275aa56
child 14826 c2daf27b4e62
util: rename the util.localpath that uses url to urllocalpath (issue2875) util is never imported by any other name than util, so this is mostly just a simple search and replace from util.localpath to util.urllocalpath (assuming other uses of util.localpath already has been renamed).
mercurial/hg.py
mercurial/localrepo.py
mercurial/util.py
--- a/mercurial/hg.py	Fri Jul 01 18:13:48 2011 +0200
+++ b/mercurial/hg.py	Fri Jul 01 17:37:09 2011 +0200
@@ -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)
--- a/mercurial/localrepo.py	Fri Jul 01 18:13:48 2011 +0200
+++ b/mercurial/localrepo.py	Fri Jul 01 17:37:09 2011 +0200
@@ -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
--- a/mercurial/util.py	Fri Jul 01 18:13:48 2011 +0200
+++ b/mercurial/util.py	Fri Jul 01 17:37:09 2011 +0200
@@ -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):