Skip to content

Commit e3000c3

Browse files
author
John Lianoglou
committed
Chunking svn add and svn delete operations
Chunking in the interests of improving performance with larger changesets.
1 parent 8e65915 commit e3000c3

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

lib/main.js

+13-5
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,26 @@ module.exports = {
140140
prepareWcForCommitting: function prepareWcForCommitting(wcPath) {
141141
var unversionedFiles = module.exports.getUnversionedFiles(wcPath);
142142
var missingFiles = module.exports.getMissingFiles(wcPath);
143+
var chunkSize = 20;
143144

144-
_.forEach(unversionedFiles, function svnAddNew(newFileEntry) {
145-
shell.exec(util.format('svn add "%s"', newFileEntry.absPath), {
145+
_.forEach(_.chunk(unversionedFiles, chunkSize), function svnAddNew(filesInChunk) {
146+
var paths = _.flatMap(filesInChunk, function extractAbsolutePaths(entry) {
147+
return [entry.absPath];
148+
});
149+
150+
shell.exec(util.format('svn add "%s"', paths.join('" "')), {
146151
silent: true
147152
});
148153
});
149154

150-
_.forEach(missingFiles, function svnDeleteMissing(missingFileEntry) {
151-
shell.exec(util.format('svn delete "%s"', missingFileEntry.absPath), {
155+
_.forEach(_.chunk(missingFiles, chunkSize), function svnDeleteMissing(filesInChunk) {
156+
var paths = _.flatMap(filesInChunk, function extractAbsolutePaths(entry) {
157+
return [entry.absPath];
158+
});
159+
160+
shell.exec(util.format('svn delete "%s"', paths.join('" "')), {
152161
silent: true
153162
});
154163
});
155164
}
156-
157165
};

0 commit comments

Comments
 (0)