File tree Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Original file line number Diff line number Diff line change 37
37
(:(?P<port>\d{1,5}))?
38
38
(?P<separator>[:,/])?
39
39
(?P<path>
40
- (\w[^:.]*) # cut the path at . to negate .git
40
+ (\w[^:.@ ]*) # cut the path at . to negate .git, @ from pip
41
41
)?
42
42
"""
43
43
110
110
)
111
111
"""
112
112
113
+ RE_PIP_REV = r"""
114
+ (@(?P<rev>.*))
115
+ """
116
+
113
117
114
118
PIP_DEFAULT_MATCHERS : list [Matcher ] = [
115
119
Matcher (
121
125
://
122
126
{ RE_PATH }
123
127
{ RE_SUFFIX } ?
128
+ { RE_PIP_REV } ?
124
129
""" ,
125
130
re .VERBOSE ,
126
131
),
132
137
rf"""
133
138
{ RE_PIP_SCP_SCHEME }
134
139
{ SCP_REGEX } ?
135
- { RE_SUFFIX }
140
+ { RE_SUFFIX } ?
141
+ { RE_PIP_REV } ?
136
142
""" ,
137
143
re .VERBOSE ,
138
144
),
142
148
label = "pip-file-url" ,
143
149
description = "pip-style git+file:// URL" ,
144
150
pattern = re .compile (
145
- r """
151
+ rf """
146
152
(?P<scheme>git\+file)://
147
- (?P<path>.*)
153
+ (?P<path>[^@]*)
154
+ { RE_PIP_REV } ?
148
155
""" ,
149
156
re .VERBOSE ,
150
157
),
@@ -229,10 +236,6 @@ class GitURL(URLProtocol, SkipDefaultFieldsReprMixin):
229
236
----------
230
237
matcher : str
231
238
name of the :class:`~libvcs.parse.base.Matcher`
232
-
233
- branch : str, optional
234
- Default URL parsers don't output these,
235
- can be added by extending or passing manually
236
239
"""
237
240
238
241
url : str
@@ -245,12 +248,8 @@ class GitURL(URLProtocol, SkipDefaultFieldsReprMixin):
245
248
# Decoration
246
249
suffix : Optional [str ] = None
247
250
248
- #
249
- # commit-ish: tag, branch, ref, revision
250
- #
251
- ref : Optional [str ] = None
252
- branch : Optional [str ] = None
253
- tag : Optional [str ] = None
251
+ # commit-ish (rev): tag, branch, ref
252
+ rev : Optional [str ] = None
254
253
255
254
matcher : Optional [str ] = None
256
255
matchers = MatcherRegistry = MatcherRegistry (
You can’t perform that action at this time.
0 commit comments