mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fixed parsing VCS requirements with '/' in revision (PY-8623)
This commit is contained in:
@@ -25,7 +25,7 @@ public class PyRequirement {
|
||||
private static final Pattern VERSION_SPEC = Pattern.compile("\\s*(<=?|>=?|==|!=)\\s*((\\w|[-.])+)");
|
||||
private static final Pattern EDITABLE_EGG = Pattern.compile("\\s*(-e)?\\s*([^#]*)(#egg=(.*))?");
|
||||
private static final Pattern RECURSIVE_REQUIREMENT = Pattern.compile("\\s*-r\\s+(.*)");
|
||||
private static final Pattern VCS_PATH = Pattern.compile(".*/([^@/]+)/?(@.*)?");
|
||||
private static final Pattern VCS_PATH = Pattern.compile(".*/([^/]+)/?");
|
||||
|
||||
public enum Relation {
|
||||
LT("<"),
|
||||
@@ -408,8 +408,10 @@ public class PyRequirement {
|
||||
try {
|
||||
final URI uri = new URI(url);
|
||||
if (uri.getScheme() != null) {
|
||||
final String path = uri.getPath();
|
||||
String path = uri.getPath();
|
||||
if (path != null) {
|
||||
final String[] split = path.split("@", 2);
|
||||
path = split[0];
|
||||
final Matcher vcsPathMatcher = VCS_PATH.matcher(path);
|
||||
if (!vcsPathMatcher.matches()) {
|
||||
return null;
|
||||
|
||||
@@ -79,6 +79,12 @@ public class PyRequirementTest extends PyTestCase {
|
||||
PyRequirement.fromString("hg+ssh://hg@bitbucket.org/jespern/django-piston/"));
|
||||
}
|
||||
|
||||
// PY-8623
|
||||
public void testGitRevisionWithSlash() {
|
||||
assertEquals(new PyRequirement("django", null, "git+git://github.com/django/django.git@stable/1.5.x", false),
|
||||
PyRequirement.fromString("git+git://github.com/django/django.git@stable/1.5.x"));
|
||||
}
|
||||
|
||||
private static <T> List<T> list(T... xs) {
|
||||
return Arrays.asList(xs);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user