From cf018d04b7c9471f56cb54d23a9026061523911a Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Fri, 7 Jul 2017 08:34:38 +0200 Subject: [PATCH] Fixed issue #2955: LogDlg: infinite line to parent when initial commit is branched Signed-off-by: Sven Strickroth --- src/Changelog.txt | 1 + src/TortoiseProc/GitLogListBase.cpp | 3 +++ src/TortoiseProc/LogDataVector.cpp | 8 ++++++-- src/TortoiseProc/lanes.cpp | 8 ++++---- src/TortoiseProc/lanes.h | 3 ++- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/Changelog.txt b/src/Changelog.txt index 00a7e242d..71b9d8ef8 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -55,6 +55,7 @@ Released: unreleased * Fixed issue #3013: Error message if remote Git output contains non-ASCII chars * Fixed issue #3014: MergeDlg: Commit dialog is opened instead of resovle dialog after resolve button pressed * Fixed issue #2926: Don't report an error for invalid remote symbolic references + * Fixed issue #2955: LogDlg: infinite line to parent when initial commit is branched = Release 2.4.0 = Released: 2017-01-31 diff --git a/src/TortoiseProc/GitLogListBase.cpp b/src/TortoiseProc/GitLogListBase.cpp index 540dc188a..afa1a878c 100644 --- a/src/TortoiseProc/GitLogListBase.cpp +++ b/src/TortoiseProc/GitLogListBase.cpp @@ -868,6 +868,7 @@ void CGitLogListBase::paintGraphLane(HDC hdc, int laneHeight,int type, int x1, i break; case Lanes::TAIL_L: case Lanes::INITIAL: + case Lanes::MERGE_FORK_L_INITIAL: case Lanes::BOUNDARY: case Lanes::BOUNDARY_C: case Lanes::BOUNDARY_R: @@ -902,6 +903,7 @@ void CGitLogListBase::paintGraphLane(HDC hdc, int laneHeight,int type, int x1, i //p->drawLine(P_180, P_CENTER); break; case Lanes::MERGE_FORK_L: + case Lanes::MERGE_FORK_L_INITIAL: case Lanes::HEAD_L: case Lanes::TAIL_L: case Lanes::BOUNDARY_L: @@ -935,6 +937,7 @@ void CGitLogListBase::paintGraphLane(HDC hdc, int laneHeight,int type, int x1, i case Lanes::MERGE_FORK: case Lanes::MERGE_FORK_R: case Lanes::MERGE_FORK_L: + case Lanes::MERGE_FORK_L_INITIAL: //p->setPen(Qt::NoPen); //p->setBrush(col); //p->drawRect(R_CENTER); diff --git a/src/TortoiseProc/LogDataVector.cpp b/src/TortoiseProc/LogDataVector.cpp index f3d587050..fe9af8b7d 100644 --- a/src/TortoiseProc/LogDataVector.cpp +++ b/src/TortoiseProc/LogDataVector.cpp @@ -1,6 +1,6 @@ // TortoiseGit - a Windows shell extension for easy version control -// Copyright (C) 2009-2013, 2015-2016 - TortoiseGit +// Copyright (C) 2009-2013, 2015-2017 - TortoiseGit // Copyright (C) 2007-2008 - TortoiseSVN // This program is free software; you can redistribute it and/or @@ -317,7 +317,7 @@ void CLogDataVector::updateLanes(GitRevLoglist& c, Lanes& lns, CGitHash& sha) if (isDiscontinuity) lns.changeActiveLane(sha); // uses previous isBoundary state - lns.setBoundary(c.IsBoundary() == TRUE); // update must be here + lns.setBoundary(c.IsBoundary() == TRUE, isInitial); // update must be here TRACE(L"%s %d", (LPCTSTR)c.m_CommitHash.ToString(), c.IsBoundary()); if (isFork) @@ -342,7 +342,11 @@ void CLogDataVector::updateLanes(GitRevLoglist& c, Lanes& lns, CGitHash& sha) if (isMerge) lns.afterMerge(); if (isFork) + { lns.afterFork(); + if (isInitial) + lns.setInitial(); + } if (lns.isBranch()) lns.afterBranch(); } \ No newline at end of file diff --git a/src/TortoiseProc/lanes.cpp b/src/TortoiseProc/lanes.cpp index 511486c78..3a81d4300 100644 --- a/src/TortoiseProc/lanes.cpp +++ b/src/TortoiseProc/lanes.cpp @@ -2,7 +2,7 @@ Description: history graph computation Author: Marco Costalba (C) 2005-2007 - Copyright (C) 2008-2015 - TortoiseGit + Copyright (C) 2008-2015-2017 - TortoiseGit Copyright: See COPYING file that comes with this distribution @@ -16,7 +16,7 @@ void Lanes::init(const CGitHash& expectedSha) { clear(); activeLane = 0; - setBoundary(false); + setBoundary(false, false); bool wasEmptyCross = false; add(BRANCH, expectedSha, activeLane, wasEmptyCross); } @@ -26,12 +26,12 @@ void Lanes::clear() { nextShaVec.clear(); } -void Lanes::setBoundary(bool b) { +void Lanes::setBoundary(bool b, bool initial) { // changes the state so must be called as first one NODE = b ? BOUNDARY_C : MERGE_FORK; NODE_R = b ? BOUNDARY_R : MERGE_FORK_R; - NODE_L = b ? BOUNDARY_L : MERGE_FORK_L; + NODE_L = b ? BOUNDARY_L : (initial ? MERGE_FORK_L_INITIAL : MERGE_FORK_L); boundary = b; if (boundary) diff --git a/src/TortoiseProc/lanes.h b/src/TortoiseProc/lanes.h index f60928653..159f803c6 100644 --- a/src/TortoiseProc/lanes.h +++ b/src/TortoiseProc/lanes.h @@ -24,6 +24,7 @@ public: MERGE_FORK, MERGE_FORK_R, MERGE_FORK_L, + MERGE_FORK_L_INITIAL, JOIN, JOIN_R, JOIN_L, @@ -71,7 +72,7 @@ public: void init(const CGitHash& expectedSha); void clear(); bool isFork(const CGitHash& sha, bool& isDiscontinuity); - void setBoundary(bool isBoundary); + void setBoundary(bool isBoundary, bool isInitial); void setFork(const CGitHash& sha); void setMerge(const CGitHashList& parents); void setInitial(); -- 2.11.4.GIT