Merge branch 'stable-5.0'
* stable-5.0: Update to latest Photon Orbit R20180606145124 Ensure index change event is fired when index snapshot changed Change-Id: I8724fc92999d2bc0f8bde5e401156738dd9f1ee6 Signed-off-by: Jonathan Nieder <jrn@google.com>
This commit is contained in:
commit
c86c1d5549
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?pde?>
|
<?pde?>
|
||||||
<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
|
<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
|
||||||
<target name="jgit-4.5" sequenceNumber="1527855129">
|
<target name="jgit-4.5" sequenceNumber="1528375371">
|
||||||
<locations>
|
<locations>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.jetty.client" version="9.4.8.v20171121"/>
|
<unit id="org.eclipse.jetty.client" version="9.4.8.v20171121"/>
|
||||||
|
@ -39,6 +39,7 @@
|
||||||
<unit id="org.apache.log4j.source" version="1.2.15.v201012070815"/>
|
<unit id="org.apache.log4j.source" version="1.2.15.v201012070815"/>
|
||||||
<unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
|
<unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
|
||||||
<unit id="org.kohsuke.args4j.source" version="2.33.0.v20160323-2218"/>
|
<unit id="org.kohsuke.args4j.source" version="2.33.0.v20160323-2218"/>
|
||||||
|
<unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
|
||||||
<unit id="org.hamcrest.core" version="1.3.0.v20180420-1519"/>
|
<unit id="org.hamcrest.core" version="1.3.0.v20180420-1519"/>
|
||||||
<unit id="org.hamcrest.core.source" version="1.3.0.v20180420-1519"/>
|
<unit id="org.hamcrest.core.source" version="1.3.0.v20180420-1519"/>
|
||||||
<unit id="org.hamcrest.library" version="1.3.0.v20180524-2246"/>
|
<unit id="org.hamcrest.library" version="1.3.0.v20180524-2246"/>
|
||||||
|
@ -65,7 +66,7 @@
|
||||||
<unit id="org.slf4j.impl.log4j12.source" version="1.7.2.v20131105-2200"/>
|
<unit id="org.slf4j.impl.log4j12.source" version="1.7.2.v20131105-2200"/>
|
||||||
<unit id="com.jcraft.jzlib" version="1.1.1.v201205102305"/>
|
<unit id="com.jcraft.jzlib" version="1.1.1.v201205102305"/>
|
||||||
<unit id="com.jcraft.jzlib.source" version="1.1.1.v201205102305"/>
|
<unit id="com.jcraft.jzlib.source" version="1.1.1.v201205102305"/>
|
||||||
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20180531190352/repository"/>
|
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20180606145124/repository"/>
|
||||||
</location>
|
</location>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.osgi" version="0.0.0"/>
|
<unit id="org.eclipse.osgi" version="0.0.0"/>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
target "jgit-4.5" with source configurePhase
|
target "jgit-4.5" with source configurePhase
|
||||||
|
|
||||||
include "projects/jetty-9.4.8.tpd"
|
include "projects/jetty-9.4.8.tpd"
|
||||||
include "orbit/R20180531190352-Photon.tpd"
|
include "orbit/R20180606145124-Photon.tpd"
|
||||||
|
|
||||||
location "http://download.eclipse.org/releases/mars/" {
|
location "http://download.eclipse.org/releases/mars/" {
|
||||||
org.eclipse.osgi lazy
|
org.eclipse.osgi lazy
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?pde?>
|
<?pde?>
|
||||||
<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
|
<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
|
||||||
<target name="jgit-4.6" sequenceNumber="1527855115">
|
<target name="jgit-4.6" sequenceNumber="1528375359">
|
||||||
<locations>
|
<locations>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.jetty.client" version="9.4.8.v20171121"/>
|
<unit id="org.eclipse.jetty.client" version="9.4.8.v20171121"/>
|
||||||
|
@ -39,6 +39,7 @@
|
||||||
<unit id="org.apache.log4j.source" version="1.2.15.v201012070815"/>
|
<unit id="org.apache.log4j.source" version="1.2.15.v201012070815"/>
|
||||||
<unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
|
<unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
|
||||||
<unit id="org.kohsuke.args4j.source" version="2.33.0.v20160323-2218"/>
|
<unit id="org.kohsuke.args4j.source" version="2.33.0.v20160323-2218"/>
|
||||||
|
<unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
|
||||||
<unit id="org.hamcrest.core" version="1.3.0.v20180420-1519"/>
|
<unit id="org.hamcrest.core" version="1.3.0.v20180420-1519"/>
|
||||||
<unit id="org.hamcrest.core.source" version="1.3.0.v20180420-1519"/>
|
<unit id="org.hamcrest.core.source" version="1.3.0.v20180420-1519"/>
|
||||||
<unit id="org.hamcrest.library" version="1.3.0.v20180524-2246"/>
|
<unit id="org.hamcrest.library" version="1.3.0.v20180524-2246"/>
|
||||||
|
@ -65,7 +66,7 @@
|
||||||
<unit id="org.slf4j.impl.log4j12.source" version="1.7.2.v20131105-2200"/>
|
<unit id="org.slf4j.impl.log4j12.source" version="1.7.2.v20131105-2200"/>
|
||||||
<unit id="com.jcraft.jzlib" version="1.1.1.v201205102305"/>
|
<unit id="com.jcraft.jzlib" version="1.1.1.v201205102305"/>
|
||||||
<unit id="com.jcraft.jzlib.source" version="1.1.1.v201205102305"/>
|
<unit id="com.jcraft.jzlib.source" version="1.1.1.v201205102305"/>
|
||||||
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20180531190352/repository"/>
|
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20180606145124/repository"/>
|
||||||
</location>
|
</location>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.osgi" version="0.0.0"/>
|
<unit id="org.eclipse.osgi" version="0.0.0"/>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
target "jgit-4.6" with source configurePhase
|
target "jgit-4.6" with source configurePhase
|
||||||
|
|
||||||
include "projects/jetty-9.4.8.tpd"
|
include "projects/jetty-9.4.8.tpd"
|
||||||
include "orbit/R20180531190352-Photon.tpd"
|
include "orbit/R20180606145124-Photon.tpd"
|
||||||
|
|
||||||
location "http://download.eclipse.org/releases/neon/" {
|
location "http://download.eclipse.org/releases/neon/" {
|
||||||
org.eclipse.osgi lazy
|
org.eclipse.osgi lazy
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?pde?>
|
<?pde?>
|
||||||
<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
|
<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
|
||||||
<target name="jgit-4.7" sequenceNumber="1527855092">
|
<target name="jgit-4.7" sequenceNumber="1528375339">
|
||||||
<locations>
|
<locations>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.jetty.client" version="9.4.8.v20171121"/>
|
<unit id="org.eclipse.jetty.client" version="9.4.8.v20171121"/>
|
||||||
|
@ -39,6 +39,7 @@
|
||||||
<unit id="org.apache.log4j.source" version="1.2.15.v201012070815"/>
|
<unit id="org.apache.log4j.source" version="1.2.15.v201012070815"/>
|
||||||
<unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
|
<unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
|
||||||
<unit id="org.kohsuke.args4j.source" version="2.33.0.v20160323-2218"/>
|
<unit id="org.kohsuke.args4j.source" version="2.33.0.v20160323-2218"/>
|
||||||
|
<unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
|
||||||
<unit id="org.hamcrest.core" version="1.3.0.v20180420-1519"/>
|
<unit id="org.hamcrest.core" version="1.3.0.v20180420-1519"/>
|
||||||
<unit id="org.hamcrest.core.source" version="1.3.0.v20180420-1519"/>
|
<unit id="org.hamcrest.core.source" version="1.3.0.v20180420-1519"/>
|
||||||
<unit id="org.hamcrest.library" version="1.3.0.v20180524-2246"/>
|
<unit id="org.hamcrest.library" version="1.3.0.v20180524-2246"/>
|
||||||
|
@ -65,7 +66,7 @@
|
||||||
<unit id="org.slf4j.impl.log4j12.source" version="1.7.2.v20131105-2200"/>
|
<unit id="org.slf4j.impl.log4j12.source" version="1.7.2.v20131105-2200"/>
|
||||||
<unit id="com.jcraft.jzlib" version="1.1.1.v201205102305"/>
|
<unit id="com.jcraft.jzlib" version="1.1.1.v201205102305"/>
|
||||||
<unit id="com.jcraft.jzlib.source" version="1.1.1.v201205102305"/>
|
<unit id="com.jcraft.jzlib.source" version="1.1.1.v201205102305"/>
|
||||||
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20180531190352/repository"/>
|
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20180606145124/repository"/>
|
||||||
</location>
|
</location>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.osgi" version="0.0.0"/>
|
<unit id="org.eclipse.osgi" version="0.0.0"/>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
target "jgit-4.7" with source configurePhase
|
target "jgit-4.7" with source configurePhase
|
||||||
|
|
||||||
include "projects/jetty-9.4.8.tpd"
|
include "projects/jetty-9.4.8.tpd"
|
||||||
include "orbit/R20180531190352-Photon.tpd"
|
include "orbit/R20180606145124-Photon.tpd"
|
||||||
|
|
||||||
location "http://download.eclipse.org/releases/oxygen/" {
|
location "http://download.eclipse.org/releases/oxygen/" {
|
||||||
org.eclipse.osgi lazy
|
org.eclipse.osgi lazy
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?pde?>
|
<?pde?>
|
||||||
<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
|
<!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
|
||||||
<target name="jgit-4.8" sequenceNumber="1527855087">
|
<target name="jgit-4.8" sequenceNumber="1528373976">
|
||||||
<locations>
|
<locations>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.jetty.client" version="9.4.8.v20171121"/>
|
<unit id="org.eclipse.jetty.client" version="9.4.8.v20171121"/>
|
||||||
|
@ -39,6 +39,7 @@
|
||||||
<unit id="org.apache.log4j.source" version="1.2.15.v201012070815"/>
|
<unit id="org.apache.log4j.source" version="1.2.15.v201012070815"/>
|
||||||
<unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
|
<unit id="org.kohsuke.args4j" version="2.33.0.v20160323-2218"/>
|
||||||
<unit id="org.kohsuke.args4j.source" version="2.33.0.v20160323-2218"/>
|
<unit id="org.kohsuke.args4j.source" version="2.33.0.v20160323-2218"/>
|
||||||
|
<unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
|
||||||
<unit id="org.hamcrest.core" version="1.3.0.v20180420-1519"/>
|
<unit id="org.hamcrest.core" version="1.3.0.v20180420-1519"/>
|
||||||
<unit id="org.hamcrest.core.source" version="1.3.0.v20180420-1519"/>
|
<unit id="org.hamcrest.core.source" version="1.3.0.v20180420-1519"/>
|
||||||
<unit id="org.hamcrest.library" version="1.3.0.v20180524-2246"/>
|
<unit id="org.hamcrest.library" version="1.3.0.v20180524-2246"/>
|
||||||
|
@ -65,7 +66,7 @@
|
||||||
<unit id="org.slf4j.impl.log4j12.source" version="1.7.2.v20131105-2200"/>
|
<unit id="org.slf4j.impl.log4j12.source" version="1.7.2.v20131105-2200"/>
|
||||||
<unit id="com.jcraft.jzlib" version="1.1.1.v201205102305"/>
|
<unit id="com.jcraft.jzlib" version="1.1.1.v201205102305"/>
|
||||||
<unit id="com.jcraft.jzlib.source" version="1.1.1.v201205102305"/>
|
<unit id="com.jcraft.jzlib.source" version="1.1.1.v201205102305"/>
|
||||||
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20180531190352/repository"/>
|
<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20180606145124/repository"/>
|
||||||
</location>
|
</location>
|
||||||
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
<location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
|
||||||
<unit id="org.eclipse.osgi" version="0.0.0"/>
|
<unit id="org.eclipse.osgi" version="0.0.0"/>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
target "jgit-4.8" with source configurePhase
|
target "jgit-4.8" with source configurePhase
|
||||||
|
|
||||||
include "projects/jetty-9.4.8.tpd"
|
include "projects/jetty-9.4.8.tpd"
|
||||||
include "orbit/R20180531190352-Photon.tpd"
|
include "orbit/R20180606145124-Photon.tpd"
|
||||||
|
|
||||||
location "http://download.eclipse.org/releases/oxygen/" {
|
location "http://download.eclipse.org/releases/oxygen/" {
|
||||||
org.eclipse.osgi lazy
|
org.eclipse.osgi lazy
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
target "R20180531190352-Photon" with source configurePhase
|
target "R20180606145124-Photon" with source configurePhase
|
||||||
// see http://download.eclipse.org/tools/orbit/downloads/
|
// see http://download.eclipse.org/tools/orbit/downloads/
|
||||||
|
|
||||||
location "http://download.eclipse.org/tools/orbit/downloads/drops/R20180531190352/repository" {
|
location "http://download.eclipse.org/tools/orbit/downloads/drops/R20180606145124/repository" {
|
||||||
org.apache.ant [1.9.6.v201510161327,1.9.6.v201510161327]
|
org.apache.ant [1.9.6.v201510161327,1.9.6.v201510161327]
|
||||||
org.apache.ant.source [1.9.6.v201510161327,1.9.6.v201510161327]
|
org.apache.ant.source [1.9.6.v201510161327,1.9.6.v201510161327]
|
||||||
org.apache.commons.codec [1.9.0.v20170208-1614,1.9.0.v20170208-1614]
|
org.apache.commons.codec [1.9.0.v20170208-1614,1.9.0.v20170208-1614]
|
||||||
|
@ -18,6 +18,7 @@ location "http://download.eclipse.org/tools/orbit/downloads/drops/R2018053119035
|
||||||
org.apache.log4j.source [1.2.15.v201012070815,1.2.15.v201012070815]
|
org.apache.log4j.source [1.2.15.v201012070815,1.2.15.v201012070815]
|
||||||
org.kohsuke.args4j [2.33.0.v20160323-2218,2.33.0.v20160323-2218]
|
org.kohsuke.args4j [2.33.0.v20160323-2218,2.33.0.v20160323-2218]
|
||||||
org.kohsuke.args4j.source [2.33.0.v20160323-2218,2.33.0.v20160323-2218]
|
org.kohsuke.args4j.source [2.33.0.v20160323-2218,2.33.0.v20160323-2218]
|
||||||
|
org.hamcrest [1.1.0.v20090501071000,1.1.0.v20090501071000]
|
||||||
org.hamcrest.core [1.3.0.v20180420-1519,1.3.0.v20180420-1519]
|
org.hamcrest.core [1.3.0.v20180420-1519,1.3.0.v20180420-1519]
|
||||||
org.hamcrest.core.source [1.3.0.v20180420-1519,1.3.0.v20180420-1519]
|
org.hamcrest.core.source [1.3.0.v20180420-1519,1.3.0.v20180420-1519]
|
||||||
org.hamcrest.library [1.3.0.v20180524-2246,1.3.0.v20180524-2246]
|
org.hamcrest.library [1.3.0.v20180524-2246,1.3.0.v20180524-2246]
|
|
@ -56,7 +56,7 @@
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
|
||||||
import org.eclipse.jgit.annotations.Nullable;
|
import org.eclipse.jgit.annotations.Nullable;
|
||||||
import org.eclipse.jgit.api.errors.JGitInternalException;
|
import org.eclipse.jgit.api.errors.JGitInternalException;
|
||||||
|
@ -125,7 +125,10 @@ public class FileRepository extends Repository {
|
||||||
private final RefDatabase refs;
|
private final RefDatabase refs;
|
||||||
private final ObjectDirectory objectDatabase;
|
private final ObjectDirectory objectDatabase;
|
||||||
|
|
||||||
private AtomicReference<FileSnapshot> snapshot = new AtomicReference<>();
|
private final ReentrantLock snapshotLock = new ReentrantLock();
|
||||||
|
|
||||||
|
// protected by snapshotLock
|
||||||
|
private FileSnapshot snapshot;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a representation of a Git repository.
|
* Construct a representation of a Git repository.
|
||||||
|
@ -240,8 +243,9 @@ public void onConfigChanged(ConfigChangedEvent event) {
|
||||||
Long.valueOf(repositoryFormatVersion)));
|
Long.valueOf(repositoryFormatVersion)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isBare())
|
if (!isBare()) {
|
||||||
snapshot.getAndSet(FileSnapshot.save(getIndexFile()));
|
snapshot = FileSnapshot.save(getIndexFile());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadSystemConfig() throws IOException {
|
private void loadSystemConfig() throws IOException {
|
||||||
|
@ -549,17 +553,30 @@ private void detectIndexChanges() {
|
||||||
}
|
}
|
||||||
|
|
||||||
File indexFile = getIndexFile();
|
File indexFile = getIndexFile();
|
||||||
if (snapshot.get() == null) {
|
snapshotLock.lock();
|
||||||
snapshot.getAndSet(FileSnapshot.save(indexFile));
|
try {
|
||||||
} else if (snapshot.get().isModified(indexFile)) {
|
if (snapshot == null) {
|
||||||
|
snapshot = FileSnapshot.save(indexFile);
|
||||||
|
} else if (snapshot.isModified(indexFile)) {
|
||||||
|
snapshotLock.unlock();
|
||||||
notifyIndexChanged(false);
|
notifyIndexChanged(false);
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
if (snapshotLock.isHeldByCurrentThread()) {
|
||||||
|
snapshotLock.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
public void notifyIndexChanged(boolean internal) {
|
public void notifyIndexChanged(boolean internal) {
|
||||||
snapshot.getAndSet(FileSnapshot.save(getIndexFile()));
|
snapshotLock.lock();
|
||||||
|
try {
|
||||||
|
snapshot = FileSnapshot.save(getIndexFile());
|
||||||
|
} finally {
|
||||||
|
snapshotLock.unlock();
|
||||||
|
}
|
||||||
fireEvent(new IndexChangedEvent(internal));
|
fireEvent(new IndexChangedEvent(internal));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue