From 4283dd8ec06b5de56ee817a44abc008a94e55500 Mon Sep 17 00:00:00 2001 From: irengrig Date: Thu, 1 Nov 2012 12:58:58 +0400 Subject: [PATCH 1/3] - Bombed for concurrent Subversion writes test; code for getting svnkit delays for concurrent WC access --- .../jetbrains/idea/svn/SvnLockingTest.java | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnLockingTest.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnLockingTest.java index e067ee50953c..171bb1c35cb8 100644 --- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnLockingTest.java +++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnLockingTest.java @@ -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 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 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(false, delay); + } + } + try { + Thread.sleep(delay); + } catch (InterruptedException e) { + // + } + return new Pair(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"); From aeb9321357fe77026ef4eb43114988b9b7c2f4fb Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Thu, 1 Nov 2012 13:29:58 +0400 Subject: [PATCH 2/3] IDEA-94002 Inline Diff: inaccurate markers for additions and deletions Use custom range highlighter renderer: draw to the left of the letter, don't overlap with the bottom line separator. --- .../diff/impl/highlighting/DiffMarkup.java | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/diff/impl/highlighting/DiffMarkup.java b/platform/platform-impl/src/com/intellij/openapi/diff/impl/highlighting/DiffMarkup.java index edb1cd41aa91..25defaf6d335 100644 --- a/platform/platform-impl/src/com/intellij/openapi/diff/impl/highlighting/DiffMarkup.java +++ b/platform/platform-impl/src/com/intellij/openapi/diff/impl/highlighting/DiffMarkup.java @@ -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, From ea218f37f91eba31e544b6811b8ac8d31de9109e Mon Sep 17 00:00:00 2001 From: irengrig Date: Thu, 1 Nov 2012 13:50:28 +0400 Subject: [PATCH 3/3] IDEA-93961 Git log: "Refresh" buttons activates branches display always --- plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java b/plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java index eb478c55aa7b..01e9acb66616 100644 --- a/plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java +++ b/plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java @@ -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);