History

compat: drop compat code from hg < 1.9 (!!)

Kevin Bullock committed 8 years ago

Commit 3dfd3fe1 parent b4d12771 file · +1 −13Browse files

Unified · Split

hggit/__init__.py+1−13
@@ -106,18 +106,6 @@ for _scheme in util.gitschemes: · 105 unmodified lines
106# support for `hg clone localgitrepo`106# support for `hg clone localgitrepo`
107_oldlocal = hg.schemes['file']107_oldlocal = hg.schemes['file']
108 108
109# COMPAT: hg 1.9 - url.url class moved into util module
110try:
111 urlcls = hgutil.url
112except AttributeError:
113 class urlcls(object):
114 def __init__(self, path):
115 self.p = hgutil.drop_scheme('file', path)
116
117 def localpath(self):
118 return self.p
119
120
121def _isgitdir(path):109def _isgitdir(path):
122 """True if the given file path is a git repo."""110 """True if the given file path is a git repo."""
123 if os.path.exists(os.path.join(path, '.hg')):111 if os.path.exists(os.path.join(path, '.hg')):
@@ -137,7 +125,7 @@ def _isgitdir(path): · 13 unmodified lines
137 125
138 126
139def _local(path):127def _local(path):
140 p = urlcls(path).localpath()128 p = hgutil.url(path).localpath()
141 if _isgitdir(p):129 if _isgitdir(p):
142 return gitrepo130 return gitrepo
143 # detect git ssh urls (which mercurial thinks is a file-like path)131 # detect git ssh urls (which mercurial thinks is a file-like path)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t