• R/O
  • SSH
  • HTTPS

tortoisesvn: コミット


コミットメタ情報

リビジョン28534 (tree)
日時2019-03-15 08:42:28
作者csware

ログメッセージ

* Fix editing a conflicted line or identical removed line resulted in missing EOL
* Don't introduce EOL marker for empty lines on "use block"
* Don't introduce EOL marker for empty identical removed lines on "use block"

変更サマリ

差分

--- trunk/src/TortoiseMerge/BaseView.cpp (revision 28533)
+++ trunk/src/TortoiseMerge/BaseView.cpp (revision 28534)
@@ -1,6 +1,7 @@
11 // TortoiseMerge - a Diff/Patch program
22
33 // Copyright (C) 2003-2019 - TortoiseSVN
4+// Copyright (C) 2019 - TortoiseGit
45
56 // This program is free software; you can redistribute it and/or
67 // modify it under the terms of the GNU General Public License
@@ -3887,7 +3888,7 @@
38873888 lineData.sLine.Insert(ptCaretViewPos.x, (wchar_t)nChar);
38883889 }
38893890 }
3890- if (IsStateEmpty(lineData.state))
3891+ if (IsStateEmpty(lineData.state) || IsStateConflicted(lineData.state) || lineData.state == DIFFSTATE_IDENTICALREMOVED)
38913892 {
38923893 // if not last line set EOL
38933894 for (int nCheckViewLine = nViewLine+1; nCheckViewLine < GetViewCount(); nCheckViewLine++)
@@ -3901,7 +3902,7 @@
39013902 // make sure previous (non empty) line have EOL set
39023903 for (int nCheckViewLine = nViewLine-1; nCheckViewLine > 0; nCheckViewLine--)
39033904 {
3904- if (!IsViewLineEmpty(nCheckViewLine))
3905+ if (!IsViewLineEmpty(nCheckViewLine) && GetViewState(nCheckViewLine) != DIFFSTATE_IDENTICALREMOVED)
39053906 {
39063907 if (GetViewLineEnding(nCheckViewLine) == EOL_NOENDING)
39073908 {
@@ -6585,6 +6586,31 @@
65856586 sLine.Insert(nLeft, sText);
65866587 ptCaretViewPos = SetupPoint(nLeft + sText.GetLength(), nViewLine);
65876588 SetViewLine(nViewLine, sLine);
6589+
6590+ auto viewState = GetViewState(nViewLine);
6591+ if (IsStateEmpty(viewState) || IsStateConflicted(viewState) || viewState == DIFFSTATE_IDENTICALREMOVED)
6592+ {
6593+ // if not last line set EOL
6594+ for (int nCheckViewLine = nViewLine + 1; nCheckViewLine < GetViewCount(); ++nCheckViewLine)
6595+ {
6596+ if (!IsViewLineEmpty(nCheckViewLine))
6597+ {
6598+ SetViewLineEnding(nViewLine, m_lineendings);
6599+ break;
6600+ }
6601+ }
6602+ // make sure previous (non empty) line have EOL set
6603+ for (int nCheckViewLine = nViewLine - 1; nCheckViewLine > 0; --nCheckViewLine)
6604+ {
6605+ if (!IsViewLineEmpty(nCheckViewLine))
6606+ {
6607+ if (GetViewLineEnding(nCheckViewLine) == EOL_NOENDING)
6608+ SetViewLineEnding(nCheckViewLine, m_lineendings);
6609+ break;
6610+ }
6611+ }
6612+ }
6613+
65886614 SetViewState(nViewLine, DIFFSTATE_EDITED);
65896615 SetModified();
65906616 SaveUndoStep();
--- trunk/src/TortoiseMerge/BottomView.cpp (revision 28533)
+++ trunk/src/TortoiseMerge/BottomView.cpp (revision 28534)
@@ -1,6 +1,7 @@
11 // TortoiseMerge - a Diff/Patch program
22
33 // Copyright (C) 2006-2013 - TortoiseSVN
4+// Copyright (C) 2019 - TortoiseGit
45
56 // This program is free software; you can redistribute it and/or
67 // modify it under the terms of the GNU General Public License
@@ -60,7 +61,7 @@
6061 for (int viewLine = nFirstViewLine; viewLine <= nLastViewLine; viewLine++)
6162 {
6263 viewdata lineData = pwndView->GetViewData(viewLine);
63- if ((lineData.ending != EOL_NOENDING)||(viewLine < (GetViewCount()-1)))
64+ if ((lineData.ending != EOL_NOENDING) || (viewLine < (GetViewCount() - 1) && lineData.state != DIFFSTATE_CONFLICTEMPTY && lineData.state != DIFFSTATE_IDENTICALREMOVED))
6465 lineData.ending = m_lineendings;
6566 lineData.state = ResolveState(lineData.state);
6667 SetViewData(viewLine, lineData);
@@ -70,7 +71,7 @@
7071 // make sure previous (non empty) line have EOL set
7172 for (int nCheckViewLine = nFirstViewLine-1; nCheckViewLine > 0; nCheckViewLine--)
7273 {
73- if (!IsViewLineEmpty(nCheckViewLine))
74+ if (!IsViewLineEmpty(nCheckViewLine) && GetViewState(nCheckViewLine) != DIFFSTATE_IDENTICALREMOVED)
7475 {
7576 if (GetViewLineEnding(nCheckViewLine) == EOL_NOENDING)
7677 {
@@ -113,7 +114,7 @@
113114 for (int viewLine = nFirstViewLine; viewLine <= nLastViewLine; viewLine++)
114115 {
115116 viewdata lineData = pwndFirst->GetViewData(viewLine);
116- if ((lineData.ending != EOL_NOENDING)||(viewLine < (GetViewCount()-1)))
117+ if ((lineData.ending != EOL_NOENDING) || (viewLine < (GetViewCount() - 1) && lineData.state != DIFFSTATE_CONFLICTEMPTY && lineData.state != DIFFSTATE_IDENTICALREMOVED))
117118 lineData.ending = m_lineendings;
118119 lineData.state = ResolveState(lineData.state);
119120 SetViewData(viewLine, lineData);
旧リポジトリブラウザで表示