public void disposeCommitPacket(Object lockingContext, boolean disposeParentContext) throws SVNException { if (lockingContext instanceof SVNCommitPacket[]) { SVNCommitPacket[] packets = (SVNCommitPacket[]) lockingContext; for (int i = 0; i < packets.length; i++) { try { packets[i].dispose(); } catch (SVNException e) { // } } } else if (lockingContext instanceof SVNCommitPacket) { ((SVNCommitPacket) lockingContext).dispose(); } }
public SVNCommitPacket removeSkippedItems() { if (this == EMPTY) { return EMPTY; } Collection items = new ArrayList(); Map lockTokens = getLockTokens() == null ? null : new SVNHashMap(getLockTokens()); SVNCommitItem[] filteredItems = filterSkippedItemsAndLockTokens(items, lockTokens); return new SVNCommitPacket(null, filteredItems, lockTokens); }
/** * Determines if an item intended for a commit is set to * be skipped - that is not to be committed. * * @param item an item to check * @return <span class="javakeyword">true</span> if the item * is set to be skipped, otherwise <span class="javakeyword">false</span> * @see #setCommitItemSkipped(SVNCommitItem, boolean) */ public boolean isCommitItemSkipped(SVNCommitItem item) { int index = getItemIndex(item); if (index >= 0 && index < myIsSkipped.length) { return myIsSkipped[index]; } return true; }
boolean needsSleepForTimeStamp = false; for (int p = 0; p < commitPackets.length; p++) { SVNCommitPacket commitPacket = commitPackets[p].removeSkippedItems(); if (commitPacket.getCommitItems().length == 0) { continue; commitMessage = getCommitHandler().getCommitMessage(commitMessage, commitPacket.getCommitItems()); if (commitMessage == null) { infos.add(SVNCommitInfo.NULL); String baseURL = SVNCommitUtil.translateCommitables(commitPacket.getCommitItems(), commitables); Map lockTokens = SVNCommitUtil.translateLockTokens(commitPacket.getLockTokens(), baseURL); for (int i = 0; i < commitPacket.getCommitItems().length; i++) { commitPacket.getCommitItems()[i].getWCAccess().setEventHandler(getEventDispatcher()); commitPacket.dispose();
continue; packets.add(new SVNCommitPacket(wcAccess, commitItems, lockTokens)); } catch (SVNException e) { for (int j = 0; j < wcAccesses.length; j++) { checkCancelled(); SVNCommitPacket packet = packetsArray[i]; File wcRoot = SVNWCUtil.getWorkingCopyRoot(packet.getCommitItems()[0].getWCAccess().getAnchor(), true); SVNWCAccess rootWCAccess = createWCAccess(); String uuid = null; for (int j = 0; j < packet.getCommitItems().length; j++) { items.add(packet.getCommitItems()[j]); if (packet.getLockTokens() != null) { lockTokens.putAll(packet.getLockTokens()); Map lockTokens = (Map) locktokensMap.get(uuid); SVNCommitItem[] itemsArray = (SVNCommitItem[]) items.toArray(new SVNCommitItem[items.size()]); packetsArray[index++] = new SVNCommitPacket(null, itemsArray, lockTokens);
SVNCommitPacket packet = doCollectCommitItems(paths, keepLocks, force, recursive); try { packet = packet.removeSkippedItems(); return doCommit(packet, keepLocks, commitMessage); } finally { if (packet != null) { packet.dispose();
SVNCommitPacket removeSkippedItems() { if (this == EMPTY) { return EMPTY; } Collection items = new ArrayList(); Map lockTokens = myLockTokens == null ? null : new HashMap(myLockTokens); for (int i = 0; myCommitItems != null && i < myCommitItems.length; i++) { SVNCommitItem commitItem = myCommitItems[i]; if (!myIsSkipped[i]) { items.add(commitItem); } else if (lockTokens != null) { lockTokens.remove(commitItem.getURL().toString()); } } SVNCommitItem[] filteredItems = (SVNCommitItem[]) items.toArray(new SVNCommitItem[items.size()]); return new SVNCommitPacket(null, filteredItems, lockTokens); }
packet.setLockingContext(runner, oldPacket); Map<SVNURL, String> lockTokens = new HashMap<SVNURL, String>(); SVNCommitItem[] items = oldPacket.getCommitItems(); @SuppressWarnings("unchecked") Map<String, String> locks = oldPacket.getLockTokens(); if (locks != null) { for (String url : locks.keySet()) { item.getCopyFromRevision() != null ? item.getCopyFromRevision().getNumber() : -1, flags); if (oldPacket.isCommitItemSkipped(item)) { packet.setItemSkipped(newItem.getPath(), true);
public void setItemSkipped(File file, boolean skipped) { final String path = SVNFileUtil.getFilePath(file); if (skipped) { skippedPaths.add(path); } else { skippedPaths.remove(path); } if (lockingContext != null && lockingContext instanceof SVNCommitPacket && !(lockingContext instanceof SvnCodec.SVNCommitPacketWrapper)) { final SvnCommitItem commitItem = itemsByPath.get(path); if (commitItem != null) { final SVNCommitPacket oldPacket = (SVNCommitPacket) lockingContext; final SVNCommitItem[] oldItems = oldPacket.getCommitItems(); for (SVNCommitItem oldItem : oldItems) { if (SVNFileUtil.getFilePath(oldItem.getFile()).equals(path)) { oldPacket.setCommitItemSkipped(oldItem, true); break; } } } } }
elapsed += System.currentTimeMillis(); if (logger.isDebugEnabled()) { final StringBuilder changes = new StringBuilder("Committed " + commit.getCommitItems().length + " changes: "); for (final SVNCommitItem item : commit.getCommitItems()) { changes.append(item.getKind() + " - " + item.getPath() + ", ");
boolean needsSleepForTimeStamp = false; for (int p = 0; p < commitPackets.length; p++) { SVNCommitPacket commitPacket = commitPackets[p].removeSkippedItems(); if (commitPacket.getCommitItems().length == 0) { continue; commitMessage = getCommitHandler().getCommitMessage(commitMessage, commitPacket.getCommitItems()); if (commitMessage == null) { infos.add(SVNCommitInfo.NULL); SVNURL baseURL = SVNCommitUtil.translateCommitables(commitPacket.getCommitItems(), commitables); Map lockTokens = SVNCommitUtil.translateLockTokens(commitPacket.getLockTokens(), baseURL.toString()); SVNCommitItem firstItem = commitPacket.getCommitItems()[0]; SVNRepository repository = createRepository(baseURL, firstItem.getFile(), firstItem.getWCAccess(), true); SVNCommitMediator mediator = new SVNCommitMediator(commitables); SVNPropertiesManager.validateRevisionProperties(revisionProperties); commitEditor = repository.getCommitEditor(commitMessage, lockTokens, keepLocks, revisionProperties, mediator); for (int i = 0; i < commitPacket.getCommitItems().length; i++) { commitPacket.getCommitItems()[i].getWCAccess().setEventHandler(getEventDispatcher()); commitPacket.dispose();
continue; packets.add(new SVNCommitPacket(wcAccess, commitItems, lockTokens)); } catch (SVNException e) { for (int j = 0; j < wcAccesses.length; j++) { checkCancelled(); SVNCommitPacket packet = packetsArray[i]; File wcRoot = SVNWCUtil.getWorkingCopyRoot(packet.getCommitItems()[0].getWCAccess().getAnchor(), true); SVNWCAccess rootWCAccess = createWCAccess(); String uuid = null; for (int j = 0; j < packet.getCommitItems().length; j++) { items.add(packet.getCommitItems()[j]); if (packet.getLockTokens() != null) { lockTokens.putAll(packet.getLockTokens()); Map lockTokens = (Map) locktokensMap.get(uuid); SVNCommitItem[] itemsArray = (SVNCommitItem[]) items.toArray(new SVNCommitItem[items.size()]); packetsArray[index++] = new SVNCommitPacket(null, itemsArray, lockTokens);
SVNCommitPacket packet = doCollectCommitItems(paths, keepLocks, force, depth, changelists); try { packet = packet.removeSkippedItems(); return doCommit(packet, keepLocks, keepChangelist, commitMessage, revisionProperties); } finally { if (packet != null) { packet.dispose();
SVNCommitPacket removeSkippedItems() { if (this == EMPTY) { return EMPTY; } Collection items = new ArrayList(); Map lockTokens = myLockTokens == null ? null : new SVNHashMap(myLockTokens); for (int i = 0; myCommitItems != null && i < myCommitItems.length; i++) { SVNCommitItem commitItem = myCommitItems[i]; if (!myIsSkipped[i]) { items.add(commitItem); } else if (lockTokens != null) { lockTokens.remove(commitItem.getURL().toString()); } } SVNCommitItem[] filteredItems = (SVNCommitItem[]) items.toArray(new SVNCommitItem[items.size()]); return new SVNCommitPacket(null, filteredItems, lockTokens); }
elapsed += System.currentTimeMillis(); if (logger.isDebugEnabled()) { final StringBuilder changes = new StringBuilder("Committed " + commit.getCommitItems().length + " changes: "); for (final SVNCommitItem item : commit.getCommitItems()) { changes.append(item.getKind() + " - " + item.getPath() + ", ");
boolean needsSleepForTimeStamp = false; for (int p = 0; p < commitPackets.length; p++) { SVNCommitPacket commitPacket = commitPackets[p].removeSkippedItems(); if (commitPacket.getCommitItems().length == 0) { continue; commitMessage = getCommitHandler().getCommitMessage(commitMessage, commitPacket.getCommitItems()); if (commitMessage == null) { infos.add(SVNCommitInfo.NULL); SVNURL baseURL = SVNCommitUtil.translateCommitables(commitPacket.getCommitItems(), commitables); Map lockTokens = SVNCommitUtil.translateLockTokens(commitPacket.getLockTokens(), baseURL.toString()); SVNCommitItem firstItem = commitPacket.getCommitItems()[0]; SVNRepository repository = createRepository(baseURL, firstItem.getFile(), firstItem.getWCAccess(), true); for (int i = 0; i < commitPacket.getCommitItems().length; i++) { commitPacket.getCommitItems()[i].getWCAccess().setEventHandler(getEventDispatcher()); commitPacket.dispose();
continue; packets.add(new SVNCommitPacket(wcAccess, commitItems, lockTokens)); } catch (SVNException e) { for (int j = 0; j < wcAccesses.length; j++) { checkCancelled(); SVNCommitPacket packet = packetsArray[i]; File wcRoot = SVNWCUtil.getWorkingCopyRoot(packet.getCommitItems()[0].getWCAccess().getAnchor(), true); SVNWCAccess rootWCAccess = createWCAccess(); String uuid = null; for (int j = 0; j < packet.getCommitItems().length; j++) { items.add(packet.getCommitItems()[j]); if (packet.getLockTokens() != null) { lockTokens.putAll(packet.getLockTokens()); Map lockTokens = (Map) locktokensMap.get(uuid); SVNCommitItem[] itemsArray = (SVNCommitItem[]) items.toArray(new SVNCommitItem[items.size()]); packetsArray[index++] = new SVNCommitPacket((SVNWCAccess)null, itemsArray, lockTokens);
SVNCommitPacket packet = doCollectCommitItems(paths, keepLocks, force, depth, changelists); try { packet = packet.removeSkippedItems(); return doCommit(packet, keepLocks, keepChangelist, commitMessage, revisionProperties); } finally { if (packet != null) { packet.dispose();
/** * Determines if an item intended for a commit is set to * be skipped - that is not to be committed. * * @param item an item to check * @return <span class="javakeyword">true</span> if the item * is set to be skipped, otherwise <span class="javakeyword">false</span> * @see #setCommitItemSkipped(SVNCommitItem, boolean) */ public boolean isCommitItemSkipped(SVNCommitItem item) { int index = getItemIndex(item); if (index >= 0 && index < myIsSkipped.length) { return myIsSkipped[index]; } return true; }
SVNCommitPacket removeSkippedItems() { if (this == EMPTY) { return EMPTY; } Collection items = new ArrayList(); Map lockTokens = myLockTokens == null ? null : new SVNHashMap(myLockTokens); for (int i = 0; myCommitItems != null && i < myCommitItems.length; i++) { SVNCommitItem commitItem = myCommitItems[i]; if (!myIsSkipped[i]) { items.add(commitItem); } else if (lockTokens != null) { lockTokens.remove(commitItem.getURL().toString()); } } SVNCommitItem[] filteredItems = (SVNCommitItem[]) items.toArray(new SVNCommitItem[items.size()]); return new SVNCommitPacket(null, filteredItems, lockTokens); }