comparison src/org/tmatesoft/hg/internal/Internals.java @ 407:30922c728341 smartgit3

Better multiline log printout; options to tune default log output
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 16 Mar 2012 12:51:03 +0100
parents b015f3918120
children 0f5696623512
comparison
equal deleted inserted replaced
404:31a719b9f95e 407:30922c728341
22 import java.io.FileOutputStream; 22 import java.io.FileOutputStream;
23 import java.io.IOException; 23 import java.io.IOException;
24 import java.util.ArrayList; 24 import java.util.ArrayList;
25 import java.util.Arrays; 25 import java.util.Arrays;
26 import java.util.Collections; 26 import java.util.Collections;
27 import java.util.Iterator;
27 import java.util.LinkedHashSet; 28 import java.util.LinkedHashSet;
28 import java.util.List; 29 import java.util.List;
29 import java.util.StringTokenizer; 30 import java.util.StringTokenizer;
30 31
31 import org.tmatesoft.hg.core.SessionContext; 32 import org.tmatesoft.hg.core.SessionContext;
318 } 319 }
319 320
320 public boolean shallCacheRevlogs() { 321 public boolean shallCacheRevlogs() {
321 return shallCacheRevlogsInRepo; 322 return shallCacheRevlogsInRepo;
322 } 323 }
324
325 public static <T> CharSequence join(Iterable<T> col, CharSequence separator) {
326 if (col == null) {
327 return String.valueOf(col);
328 }
329 Iterator<T> it = col.iterator();
330 if (!it.hasNext()) {
331 return "[]";
332 }
333 String v = String.valueOf(it.next());
334 StringBuilder sb = new StringBuilder(v);
335 while (it.hasNext()) {
336 sb.append(separator);
337 v = String.valueOf(it.next());
338 sb.append(v);
339 }
340 return sb;
341 }
323 } 342 }