Revision | 29056 (tree) |
---|---|
Zeit | 2021-01-12 02:57:04 |
Autor | stefankueng |
patch from Matthias (https://groups.google.com/g/tortoisesvn-dev/c/Ko1Cf6vK4jE/m/TF0P0GJ2CQAJ)
The command "copy to clipboard / revisions" copied the revision numbers unsorted into clipboard.
I wrote a patch that sort the revision numbers before write them to clipboard.
@@ -2040,9 +2040,9 @@ | ||
2040 | 2040 | void CLogDlg::CopyCommaSeparatedRevisionsToClipboard() |
2041 | 2041 | { |
2042 | 2042 | POSITION pos = m_LogList.GetFirstSelectedItemPosition(); |
2043 | - CString sRevisions; | |
2044 | - CString sRevision; | |
2045 | 2043 | |
2044 | + std::set<svn_revnum_t> setSelectedRevisions; | |
2045 | + | |
2046 | 2046 | if (pos != NULL) |
2047 | 2047 | { |
2048 | 2048 | while (pos) |
@@ -2053,18 +2053,20 @@ | ||
2053 | 2053 | PLOGENTRYDATA pLogEntry = m_logEntries.GetVisible(index); |
2054 | 2054 | if (pLogEntry) |
2055 | 2055 | { |
2056 | - sRevision.Format(L"%ld, ", pLogEntry->GetRevision()); | |
2057 | - sRevisions += sRevision; | |
2056 | + setSelectedRevisions.insert(pLogEntry->GetRevision()); | |
2058 | 2057 | } |
2059 | 2058 | } |
2060 | - | |
2061 | - // trim trailing comma and space | |
2062 | - int revisionsLength = sRevisions.GetLength() - 2; | |
2063 | - if (revisionsLength > 0) | |
2064 | - { | |
2065 | - sRevisions = sRevisions.Left(revisionsLength); | |
2066 | - CStringUtils::WriteAsciiStringToClipboard(sRevisions, GetSafeHwnd()); | |
2059 | + } | |
2060 | + if (setSelectedRevisions.size() > 0) | |
2061 | + { | |
2062 | + CString sRevisions; | |
2063 | + std::set<svn_revnum_t>::iterator it; | |
2064 | + for (it = setSelectedRevisions.begin(); it != setSelectedRevisions.end(); ++it) { | |
2065 | + if (!sRevisions.IsEmpty()) | |
2066 | + sRevisions += ", "; | |
2067 | + sRevisions += SVNRev(*it).ToString(); | |
2067 | 2068 | } |
2069 | + CStringUtils::WriteAsciiStringToClipboard(sRevisions, GetSafeHwnd()); | |
2068 | 2070 | } |
2069 | 2071 | } |
2070 | 2072 |