/** * Update this remote's definition within the configuration. * * @param rc * the configuration file to store ourselves into. */ public void update(Config rc) { final List<String> vlst = new ArrayList<>(); vlst.clear(); for (URIish u : getURIs()) vlst.add(u.toPrivateString()); rc.setStringList(SECTION, getName(), KEY_URL, vlst); vlst.clear(); for (URIish u : getPushURIs()) vlst.add(u.toPrivateString()); rc.setStringList(SECTION, getName(), KEY_PUSHURL, vlst); vlst.clear(); for (RefSpec u : getFetchRefSpecs()) vlst.add(u.toString()); rc.setStringList(SECTION, getName(), KEY_FETCH, vlst); vlst.clear(); for (RefSpec u : getPushRefSpecs()) vlst.add(u.toString()); rc.setStringList(SECTION, getName(), KEY_PUSH, vlst); set(rc, KEY_UPLOADPACK, getUploadPack(), DEFAULT_UPLOAD_PACK); set(rc, KEY_RECEIVEPACK, getReceivePack(), DEFAULT_RECEIVE_PACK); set(rc, KEY_TAGOPT, getTagOpt().option(), TagOpt.AUTO_FOLLOW.option()); set(rc, KEY_MIRROR, mirror, DEFAULT_MIRROR); set(rc, KEY_TIMEOUT, timeout, 0); }
/** * Apply provided remote configuration on this transport. * * @param cfg * configuration to apply on this transport. */ public void applyConfig(RemoteConfig cfg) { setOptionUploadPack(cfg.getUploadPack()); setOptionReceivePack(cfg.getReceivePack()); setTagOpt(cfg.getTagOpt()); fetch = cfg.getFetchRefSpecs(); push = cfg.getPushRefSpecs(); timeout = cfg.getTimeout(); }
RemoteConfig config = new RemoteConfig(repo.getConfig(), getRemote()); refSpecs.addAll(config.getPushRefSpecs());
private String getProposedTargetBranch() { List<RefSpec> pushRefSpecs = remoteConfig.getPushRefSpecs(); String destination = null; if (pushRefSpecs.size() > 0) { destination = pushRefSpecs.get(0).getDestination(); if (destination.startsWith(Constants.R_HEADS)) destination = destination.substring(Constants.R_HEADS.length()); else if (destination.startsWith("refs/for/")) //$NON-NLS-1$ destination = destination.substring("refs/for/".length()); //$NON-NLS-1$ } return destination; }
private void configurePushRefSpec() { String gerritBranch = gerritConfiguration.getBranch(); List<RefSpec> pushRefSpecs = new ArrayList<RefSpec>(remoteConfig.getPushRefSpecs()); for (RefSpec refSpec : pushRefSpecs) { remoteConfig.removePushRefSpec(refSpec); } remoteConfig.addPushRefSpec(new RefSpec( "HEAD:refs/for/" + gerritBranch)); //$NON-NLS-1$ }
uriViewer.setInput(null); if (config.getPushRefSpecs().isEmpty()) specViewer.setInput(new String[] { UIText.SimpleConfigurePushDialog_DefaultPushNoRefspec}); else specViewer.setInput(config.getPushRefSpecs()); specViewer.getTable().setEnabled(!config.getPushRefSpecs().isEmpty());
pushRefSpecs.addAll(config.getPushRefSpecs());
/** * Update this remote's definition within the configuration. * * @param rc * the configuration file to store ourselves into. */ public void update(Config rc) { final List<String> vlst = new ArrayList<>(); vlst.clear(); for (URIish u : getURIs()) vlst.add(u.toPrivateString()); rc.setStringList(SECTION, getName(), KEY_URL, vlst); vlst.clear(); for (URIish u : getPushURIs()) vlst.add(u.toPrivateString()); rc.setStringList(SECTION, getName(), KEY_PUSHURL, vlst); vlst.clear(); for (RefSpec u : getFetchRefSpecs()) vlst.add(u.toString()); rc.setStringList(SECTION, getName(), KEY_FETCH, vlst); vlst.clear(); for (RefSpec u : getPushRefSpecs()) vlst.add(u.toString()); rc.setStringList(SECTION, getName(), KEY_PUSH, vlst); set(rc, KEY_UPLOADPACK, getUploadPack(), DEFAULT_UPLOAD_PACK); set(rc, KEY_RECEIVEPACK, getReceivePack(), DEFAULT_RECEIVE_PACK); set(rc, KEY_TAGOPT, getTagOpt().option(), TagOpt.AUTO_FOLLOW.option()); set(rc, KEY_MIRROR, mirror, DEFAULT_MIRROR); set(rc, KEY_TIMEOUT, timeout, 0); }
/** * Update this remote's definition within the configuration. * * @param rc * the configuration file to store ourselves into. */ public void update(final Config rc) { final List<String> vlst = new ArrayList<String>(); vlst.clear(); for (final URIish u : getURIs()) vlst.add(u.toPrivateString()); rc.setStringList(SECTION, getName(), KEY_URL, vlst); vlst.clear(); for (final URIish u : getPushURIs()) vlst.add(u.toPrivateString()); rc.setStringList(SECTION, getName(), KEY_PUSHURL, vlst); vlst.clear(); for (final RefSpec u : getFetchRefSpecs()) vlst.add(u.toString()); rc.setStringList(SECTION, getName(), KEY_FETCH, vlst); vlst.clear(); for (final RefSpec u : getPushRefSpecs()) vlst.add(u.toString()); rc.setStringList(SECTION, getName(), KEY_PUSH, vlst); set(rc, KEY_UPLOADPACK, getUploadPack(), DEFAULT_UPLOAD_PACK); set(rc, KEY_RECEIVEPACK, getReceivePack(), DEFAULT_RECEIVE_PACK); set(rc, KEY_TAGOPT, getTagOpt().option(), TagOpt.AUTO_FOLLOW.option()); set(rc, KEY_MIRROR, mirror, DEFAULT_MIRROR); set(rc, KEY_TIMEOUT, timeout, 0); }
/** * Apply provided remote configuration on this transport. * * @param cfg * configuration to apply on this transport. */ public void applyConfig(final RemoteConfig cfg) { setOptionUploadPack(cfg.getUploadPack()); setOptionReceivePack(cfg.getReceivePack()); setTagOpt(cfg.getTagOpt()); fetch = cfg.getFetchRefSpecs(); push = cfg.getPushRefSpecs(); timeout = cfg.getTimeout(); }
/** * Apply provided remote configuration on this transport. * * @param cfg * configuration to apply on this transport. */ public void applyConfig(RemoteConfig cfg) { setOptionUploadPack(cfg.getUploadPack()); setOptionReceivePack(cfg.getReceivePack()); setTagOpt(cfg.getTagOpt()); fetch = cfg.getFetchRefSpecs(); push = cfg.getPushRefSpecs(); timeout = cfg.getTimeout(); }
return !rconfig.getPushRefSpecs().isEmpty() && (!rconfig.getPushURIs().isEmpty() || !rconfig .getURIs().isEmpty());
private void runPushOperation(final int timeout) { GitSynchronizeDataSet gsds = (GitSynchronizeDataSet) getConfiguration() .getProperty(SYNCHRONIZATION_DATA); for (GitSynchronizeData gsd : gsds) { String remoteName = gsd.getSrcRemoteName(); if (remoteName == null) continue; RemoteConfig rc; Repository repo = gsd.getRepository(); StoredConfig config = repo.getConfig(); try { rc = new RemoteConfig(config, remoteName); } catch (URISyntaxException e) { Activator .logError( "Unable to create RemoteConfiguration for remote: " + remoteName, e); //$NON-NLS-1$ continue; } if (rc.getPushRefSpecs().isEmpty()) rc.addPushRefSpec(new RefSpec(HEAD + ":" + gsd.getDstMerge())); //$NON-NLS-1$ PushOperationUI push = new PushOperationUI(repo, rc, timeout, false); push.setCredentialsProvider(new EGitCredentialsProvider()); push.start(); } }
else { if (pushSpecs) predefinedConfigured = remoteConfig.getPushRefSpecs(); else predefinedConfigured = remoteConfig.getFetchRefSpecs();
RemoteConfig config = new RemoteConfig(repo.getConfig(), getRemote()); refSpecs.addAll(config.getPushRefSpecs());
RemoteConfig config = new RemoteConfig(repo.getConfig(), getRemote()); refSpecs.addAll(config.getPushRefSpecs());
pushSpecs.addAll(config.getPushRefSpecs()); final Collection<RemoteRefUpdate> updates = Transport .findRemoteRefUpdatesFor(localDb, pushSpecs,