Merge remote-tracking branch 'origin/master'

This commit is contained in:
Ekaterina Tuzova
2012-11-01 14:05:56 +04:00
3 changed files with 59 additions and 7 deletions
@@ -78,17 +78,27 @@ public abstract class DiffMarkup implements EditorSource, Disposable {
TextDiffType type = fragment instanceof LineFragment
? DiffUtil.makeTextDiffType((LineFragment)fragment)
: TextDiffType.create(diffTypeEnum);
TextRange range = fragment.getRange(getSide());
TextAttributes attributes = type.getTextAttributes(editor);
final TextRange range = fragment.getRange(getSide());
final TextAttributes attributes = type.getTextAttributes(editor);
if (attributes == null) {
return;
}
RangeHighlighter rangeMarker;
if (range.getLength() == 0) {
TextAttributes textAttributes = new TextAttributes(null, null, attributes.getBackgroundColor(), EffectType.BOXED, Font.PLAIN);
rangeMarker = markupModel.addRangeHighlighter(range.getStartOffset(), range.getStartOffset(), LAYER,
textAttributes, HighlighterTargetArea.EXACT_RANGE);
final int offset = range.getStartOffset();
rangeMarker = markupModel.addRangeHighlighter(offset, offset, LAYER,
attributes, HighlighterTargetArea.EXACT_RANGE);
rangeMarker.setCustomRenderer(new CustomHighlighterRenderer() {
@Override
public void paint(@NotNull Editor ed, @NotNull RangeHighlighter highlighter, @NotNull Graphics g) {
g.setColor(attributes.getBackgroundColor());
Point point = ed.logicalPositionToXY(ed.offsetToLogicalPosition(offset));
int endy = point.y + ed.getLineHeight() - 1;
g.drawLine(point.x, point.y, point.x, endy);
g.drawLine(point.x - 1, point.y, point.x - 1, endy);
}
});
}
else {
rangeMarker = markupModel.addRangeHighlighter(range.getStartOffset(), range.getEndOffset(), LAYER,
@@ -1637,7 +1637,7 @@ public class GitLogUI implements Disposable {
myTableModel.useDateGroupingStrategy();
}
myEqualToHeadr.getParent().setVisible(! myThereIsDisordering);
myEqualToHeadr.getParent().setVisible(! myThereIsDisordering && myMyShowTreeAction.isSelected(null));
if (! haveFilters) {
/*if (myMyShowTreeAction.isSelected(null)) {
myEqualToHeadr.getParent().setVisible(true);
@@ -105,7 +105,6 @@ public class SvnLockingTest extends TestCase {
}
}
@Bombed(year=2020, month = 1,day = 1,description = "waiting for http://issues.tmatesoft.com/issue/SVNKIT-317")
public void testOnlyWrites() throws Exception {
final OnlyWrite operation1 = new OnlyWrite("one");
final OnlyWrite operation2 = new OnlyWrite("two");
@@ -152,6 +151,49 @@ public class SvnLockingTest extends TestCase {
}
}
/*public void testDelays() throws Exception {
final HandlerCopy handler = new HandlerCopy(10000);
for (int i = 0; i < 1000; i++) {
final Pair<Boolean, Integer> pair = handler.call(i);
System.out.println("# " + i + " DELAY: " + pair.getSecond() + " CONTINUE: " + pair.getFirst());
}
}
private static class HandlerCopy {
private static final int[] delays = { 1, 2, 5, 10, 15, 20, 25, 25, 25, 50, 50, 100 };
private static final int[] totals = { 0, 1, 3, 8, 18, 33, 53, 78, 103, 128, 178, 228 };
private final int timeout;
public HandlerCopy(int timeout) {
this.timeout = timeout;
}
public Pair<Boolean, Integer> call(int number) {
int delay;
int prior;
if (number < delays.length) {
delay = delays[number];
prior = totals[number];
} else {
delay = delays[delays.length - 1];
prior = totals[delays.length - 1] + delay*(number - (delays.length - 1));
}
if (prior + delay > timeout) {
delay = timeout - prior;
if (delay <= 0) {
return new Pair<Boolean, Integer>(false, delay);
}
}
try {
Thread.sleep(delay);
} catch (InterruptedException e) {
//
}
return new Pair<Boolean, Integer>(true, delay);
}
}*/
@Bombed(year=2020, month = 1,day = 1,description = "not clear. by specification, read should not get access if write lock is taken; sometimes it is not the case.")
public void testReadInBetweenWrites() throws Exception {
final HangInWrite operation1 = new HangInWrite("one1");