Adjust the version parser to handle extra data at the end of
the Gerrit version.
ex: 2.14.5.1-22-g711fbcb105 or 2.15-rc1-577-g6b1fed0abe
Adjust the oxygen target platform.

Change-Id: I6255a0c0045f8259facc918b5f52209ae624c2b9
Signed-off-by: Jacques Bouthillier <lmcbout@gmail.com>
diff --git a/org.eclipse.egerrit.core/src/org/eclipse/egerrit/internal/core/GerritRepository.java b/org.eclipse.egerrit.core/src/org/eclipse/egerrit/internal/core/GerritRepository.java
index 4e34a12..54afe05 100644
--- a/org.eclipse.egerrit.core/src/org/eclipse/egerrit/internal/core/GerritRepository.java
+++ b/org.eclipse.egerrit.core/src/org/eclipse/egerrit/internal/core/GerritRepository.java
@@ -347,13 +347,15 @@
 		return version;
 	}
 
-	private static final Pattern MAJOR_MINOR_MICRO_VERSION_PATTERN = Pattern.compile("(\\d+)\\.(\\d+)(\\.\\d+)?"); //$NON-NLS-1$
+	private static final Pattern MAJOR_MINOR_MICRO_VERSION_PATTERN = Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)?(.*)"); //$NON-NLS-1$
 
 	private static final Pattern MAJOR_MINOR_QUALIFIER_VERSION_PATTERN = Pattern.compile("(\\d+)\\.(\\d+)-(\\w+).*"); //$NON-NLS-1$
 
 	private static final Pattern MAJOR_MINOR_MICRO_QUALIFIER_VERSION_PATTERN = Pattern
 			.compile("(\\d+)\\.(\\d+).(\\d+)-(\\w+).*"); //$NON-NLS-1$
 
+	private static final Pattern MAJOR_MINOR_RC_VERSION_PATTERN = Pattern.compile("(\\d+)\\.(\\d+)(\\d+)?(.*)"); //$NON-NLS-1$
+
 	private Version parseVersion(String rawVersion) {
 
 		// The raw version string has the general form:
@@ -377,6 +379,14 @@
 					Integer.parseInt(matcher.group(3)), matcher.group(4));
 
 		}
+		//Try to math  a major-minor with any other string attach (2.15-rc1-577-g6b1fed0abe)
+		// "<major>.<minor>-<qualifier>"
+		matcher = MAJOR_MINOR_RC_VERSION_PATTERN.matcher(rawVersion);
+		if (matcher.matches()) {
+			return new Version(Integer.parseInt(matcher.group(1)), Integer.parseInt(matcher.group(2)), 0,
+					matcher.group(4));
+		}
+
 		return Version.emptyVersion;
 	}
 
diff --git a/org.eclipse.egerrit.target/eGerrit-Eclipse_4.7-oxygen.target b/org.eclipse.egerrit.target/eGerrit-Eclipse_4.7-oxygen.target
index 9f797c0..6ce337b 100644
--- a/org.eclipse.egerrit.target/eGerrit-Eclipse_4.7-oxygen.target
+++ b/org.eclipse.egerrit.target/eGerrit-Eclipse_4.7-oxygen.target
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>

-<?pde version="3.8"?><target name="eGerrit-Eclipse_4.7-oxygen" sequenceNumber="3">

+<?pde version="3.8"?><target name="eGerrit-Eclipse_4.7-oxygen" sequenceNumber="4">

 <locations>

 <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">

 <unit id="org.eclipse.license.feature.group" version="0.0.0"/>

@@ -7,7 +7,8 @@
 </location>

 <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">

 <unit id="org.eclipse.swt.tools" version="0.0.0"/>

-<repository location="http://download.eclipse.org/eclipse/updates/4.7milestones/"/>

+<unit id="org.eclipse.sdk.ide" version="0.0.0"/>

+<repository location="http://download.eclipse.org/eclipse/updates/4.7/"/>

 </location>

 <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">

 <unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>

@@ -27,10 +28,6 @@
 <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20150519210750/repository/"/>

 </location>

 <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">

-<unit id="org.eclipse.sdk.ide" version="0.0.0"/>

-<repository location="http://download.eclipse.org/eclipse/updates/4.7-I-builds"/>

-</location>

-<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">

 <unit id="org.eclipse.rcptt.ecl.core" version="0.0.0"/>

 <unit id="org.eclipse.rcptt.ecl.parser" version="0.0.0"/>

 <unit id="org.eclipse.rcptt.ecl.dispatch" version="0.0.0"/>