--- a/mercurial/hg.py Tue Oct 30 18:48:44 2012 -0500
+++ b/mercurial/hg.py Wed Oct 17 21:30:08 2012 -0700
@@ -10,7 +10,7 @@
from lock import release
from node import hex, nullid
import localrepo, bundlerepo, httppeer, sshpeer, statichttprepo, bookmarks
-import lock, util, extensions, error, node, scmutil, phases
+import lock, util, extensions, error, node, scmutil, phases, url
import cmdutil, discovery
import merge as mergemod
import verify as verifymod
@@ -89,6 +89,13 @@
return False
return repo.local()
+def openpath(ui, path):
+ '''open path with open if local, url.open if remote'''
+ if islocal(path):
+ return open(util.urllocalpath(path))
+ else:
+ return url.open(ui, path)
+
def _peerorrepo(ui, path, create=False):
"""return a repository object for the specified path"""
obj = _peerlookup(path).instance(ui, path, create)