File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3737 (:(?P<port>\d{1,5}))?
3838 (?P<separator>[:,/])?
3939 (?P<path>
40- (\w[^:.]*) # cut the path at . to negate .git
40+ (\w[^:.@ ]*) # cut the path at . to negate .git, @ from pip
4141 )?
4242"""
4343
110110 )
111111"""
112112
113+ RE_PIP_REV = r"""
114+ (@(?P<rev>.*))
115+ """
116+
113117
114118PIP_DEFAULT_MATCHERS : list [Matcher ] = [
115119 Matcher (
121125 ://
122126 { RE_PATH }
123127 { RE_SUFFIX } ?
128+ { RE_PIP_REV } ?
124129 """ ,
125130 re .VERBOSE ,
126131 ),
132137 rf"""
133138 { RE_PIP_SCP_SCHEME }
134139 { SCP_REGEX } ?
135- { RE_SUFFIX }
140+ { RE_SUFFIX } ?
141+ { RE_PIP_REV } ?
136142 """ ,
137143 re .VERBOSE ,
138144 ),
142148 label = "pip-file-url" ,
143149 description = "pip-style git+file:// URL" ,
144150 pattern = re .compile (
145- r """
151+ rf """
146152 (?P<scheme>git\+file)://
147- (?P<path>.*)
153+ (?P<path>[^@]*)
154+ { RE_PIP_REV } ?
148155 """ ,
149156 re .VERBOSE ,
150157 ),
@@ -229,10 +236,6 @@ class GitURL(URLProtocol, SkipDefaultFieldsReprMixin):
229236 ----------
230237 matcher : str
231238 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
236239 """
237240
238241 url : str
@@ -245,12 +248,8 @@ class GitURL(URLProtocol, SkipDefaultFieldsReprMixin):
245248 # Decoration
246249 suffix : Optional [str ] = None
247250
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
254253
255254 matcher : Optional [str ] = None
256255 matchers = MatcherRegistry = MatcherRegistry (
You can’t perform that action at this time.
0 commit comments