return packetsArray;
    public SVNCommitPacket[] doCollectCommitItems(File[] paths, boolean keepLocks, boolean force, boolean recursive, boolean combinePackets) throws SVNException {        if (paths == null || paths.length == 0) {            return new SVNCommitPacket[0];        }        Collection packets = new ArrayList();        Map targets = new HashMap();        SVNStatusClient statusClient = new SVNStatusClient(getRepositoryFactory(), getOptions());        SVNWCAccess[] wcAccesses = SVNCommitUtil.createCommitWCAccess2(paths, recursive, force, targets, statusClient);        for (int i = 0; i < wcAccesses.length; i++) {            SVNWCAccess wcAccess = wcAccesses[i];            Collection targetPaths = (Collection) targets.get(wcAccess);            try {                Map lockTokens = new HashMap();                SVNCommitItem[] commitItems = SVNCommitUtil.harvestCommitables(wcAccess, targetPaths, lockTokens, !keepLocks, recursive, force);                boolean hasModifications = false;                for (int j = 0; commitItems != null && j < commitItems.length; j++) {                    SVNCommitItem commitItem = commitItems[j];                    if (commitItem.isAdded() || commitItem.isDeleted() || commitItem.isContentsModified() || commitItem.isPropertiesModified() || commitItem.isCopied()) {                        hasModifications = true;                        break;                    }                }                if (!hasModifications) {                    wcAccess.close(true);                    continue;                }                packets.add(new SVNCommitPacket(wcAccess, commitItems, lockTokens));            } catch (SVNException e) {                for (int j = 0; j < wcAccesses.length; j++) {                    wcAccesses[j].close(true);                }                throw new SVNException("svn: Commit failed (details follow):", e);            }        }        SVNCommitPacket[] packetsArray = (SVNCommitPacket[]) packets.toArray(new SVNCommitPacket[packets.size()]);        if (!combinePackets) {            return packetsArray;        }        Map repoUUIDs = new HashMap();        Map locktokensMap = new HashMap();        try {            // get wc root for each packet and uuid for each root.            // group items by uuid.            for (int i = 0; i < packetsArray.length; i++) {                SVNCommitPacket packet = packetsArray[i];                File wcRoot = SVNWCUtil.getWorkingCopyRoot(packet.getCommitItems()[0].getWCAccess().getAnchor().getRoot(), true);                SVNWCAccess rootWCAccess = SVNWCAccess.create(wcRoot);                String uuid = rootWCAccess.getTargetEntry().getUUID();                rootWCAccess.close(false);                if (uuid == null) {                    SVNErrorManager.error("svn: Cannot get repository UUID for entry at '" + wcRoot + "'");                }                if (!repoUUIDs.containsKey(uuid)) {                    repoUUIDs.put(uuid, new ArrayList());                    locktokensMap.put(uuid, new HashMap());                }                Collection items = (Collection) repoUUIDs.get(uuid);                Map lockTokens = (Map) locktokensMap.get(uuid);                for (int j = 0; j < packet.getCommitItems().length; j++) {                    items.add(packet.getCommitItems()[j]);                }                if (packet.getLockTokens() != null) {                    lockTokens.putAll(packet.getLockTokens());                }            }            packetsArray = new SVNCommitPacket[repoUUIDs.size()];            int index = 0;            for (Iterator roots = repoUUIDs.keySet().iterator(); roots.hasNext();) {                String uuid = (String) roots.next();                Collection items = (Collection) repoUUIDs.get(uuid);                Map lockTokens = (Map) locktokensMap.get(uuid);                SVNCommitItem[] itemsArray = (SVNCommitItem[]) items.toArray(new SVNCommitItem[items.size()]);                packetsArray[index++] = new SVNCommitPacket(null, itemsArray, lockTokens);            }        } catch (SVNException e) {            for (int j = 0; j < wcAccesses.length; j++) {                wcAccesses[j].close(true);            }            throw new SVNException("svn: Commit failed (details follow):", e);        }        return packetsArray;            }