diff options
author | Edwin Kempin <edwin.kempin@sap.com> | 2013-09-11 16:39:05 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-02-10 21:05:24 +0000 |
commit | 9d8d29e97b2ad94a2684b0956a15506836e8eff3 (patch) | |
tree | 095d716034fe27abc084ddb160454c09f5726c99 /src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java | |
parent | 70371bc583fa0387e66ec42d6504641e2f5d7779 (diff) |
Support replication of project deletions
The replication plugin can now be configured to listen to project
deletion events and to replicate the project deletions. In the
configuration it can be decided per remote destination whether project
deletions should be replicated to it or not. By default project
deletions are not replicated.
Change-Id: I1207015ed361155dd0353bed86860c794cdb2517
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
(cherry picked from commit ad923e4e1e4ae3923d15a8b4eee36379423846be)
Reviewed-by: Ismo Haataja <ismo.haataja@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java')
-rw-r--r-- | src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java b/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java index 1054aed..19a9359 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java +++ b/src/main/java/com/googlesource/gerrit/plugins/replication/Destination.java @@ -83,6 +83,7 @@ class Destination { private final GitRepositoryManager gitManager; private final boolean createMissingRepos; private final boolean replicatePermissions; + private final boolean replicateProjectDeletions; private final String remoteNameStyle; private volatile WorkQueue.Executor pool; private final PerThreadRequestScope.Scoper threadScoper; @@ -111,6 +112,8 @@ class Destination { cfg.getBoolean("remote", rc.getName(), "createMissingRepositories", true); replicatePermissions = cfg.getBoolean("remote", rc.getName(), "replicatePermissions", true); + replicateProjectDeletions = + cfg.getBoolean("remote", rc.getName(), "replicateProjectDeletions", false); remoteNameStyle = Objects.firstNonNull( cfg.getString("remote", rc.getName(), "remoteNameStyle"), "slash"); projects = cfg.getStringList("remote", rc.getName(), "projects"); @@ -449,6 +452,10 @@ class Destination { return replicatePermissions; } + boolean isReplicateProjectDeletions() { + return replicateProjectDeletions; + } + List<URIish> getURIs(Project.NameKey project, String urlMatch) { List<URIish> r = Lists.newArrayListWithCapacity(remote.getURIs().size()); for (URIish uri : remote.getURIs()) { |