Révision | 25212 (tree) |
---|---|
l'heure | 2014-02-15 06:18:36 |
Auteur | stefankueng |
Use the svn_move_behavior_auto_moves flag when fetching the log, and handle the new actions "moved" and "move-replaced".
@@ -1,6 +1,6 @@ | ||
1 | 1 | // TortoiseSVN - a Windows shell extension for easy version control |
2 | 2 | |
3 | -// Copyright (C) 2007-2009, 2011-2013 - TortoiseSVN | |
3 | +// Copyright (C) 2007-2009, 2011-2014 - TortoiseSVN | |
4 | 4 | |
5 | 5 | // This program is free software; you can redistribute it and/or |
6 | 6 | // modify it under the terms of the GNU General Public License |
@@ -178,6 +178,8 @@ | ||
178 | 178 | |
179 | 179 | case CRevisionInfoContainer::ACTION_ADDED: |
180 | 180 | case CRevisionInfoContainer::ACTION_REPLACED: |
181 | + case CRevisionInfoContainer::ACTION_MOVED: | |
182 | + case CRevisionInfoContainer::ACTION_MOVEREPLACED: | |
181 | 183 | { |
182 | 184 | if (iter.HasFromPath()) |
183 | 185 | { |
@@ -1,6 +1,6 @@ | ||
1 | 1 | // TortoiseSVN - a Windows shell extension for easy version control |
2 | 2 | |
3 | -// Copyright (C) 2007-2010, 2012 - TortoiseSVN | |
3 | +// Copyright (C) 2007-2010, 2012, 2014 - TortoiseSVN | |
4 | 4 | |
5 | 5 | // This program is free software; you can redistribute it and/or |
6 | 6 | // modify it under the terms of the GNU General Public License |
@@ -263,6 +263,14 @@ | ||
263 | 263 | action = CRevisionInfoContainer::ACTION_DELETED; |
264 | 264 | break; |
265 | 265 | |
266 | + case 'V': | |
267 | + action = CRevisionInfoContainer::ACTION_MOVED; | |
268 | + break; | |
269 | + | |
270 | + case 'E': | |
271 | + action = CRevisionInfoContainer::ACTION_MOVEREPLACED; | |
272 | + break; | |
273 | + | |
266 | 274 | default: |
267 | 275 | |
268 | 276 | std::cerr << "ignoring unknown action type" << std::endl; |
@@ -69,6 +69,8 @@ | ||
69 | 69 | static const std::string modifiedActionText = "\n action=\"M\""; |
70 | 70 | static const std::string replacedActionText = "\n action=\"R\""; |
71 | 71 | static const std::string deletedActionText = "\n action=\"D\""; |
72 | + static const std::string movedActionText = "\n action=\"V\""; | |
73 | + static const std::string movereplacedActionText = "\n action=\"E\""; | |
72 | 74 | |
73 | 75 | static const std::string pathText = ">"; |
74 | 76 | static const std::string pathEndText = "</path>\n"; |
@@ -112,6 +114,12 @@ | ||
112 | 114 | case CRevisionInfoContainer::ACTION_REPLACED: |
113 | 115 | file << replacedActionText; |
114 | 116 | break; |
117 | + case CRevisionInfoContainer::ACTION_MOVED: | |
118 | + file << movedActionText; | |
119 | + break; | |
120 | + case CRevisionInfoContainer::ACTION_MOVEREPLACED: | |
121 | + file << movereplacedActionText; | |
122 | + break; | |
115 | 123 | default: |
116 | 124 | break; |
117 | 125 | } |
@@ -1,6 +1,6 @@ | ||
1 | 1 | // TortoiseSVN - a Windows shell extension for easy version control |
2 | 2 | |
3 | -// Copyright (C) 2007-2013 - TortoiseSVN | |
3 | +// Copyright (C) 2007-2014 - TortoiseSVN | |
4 | 4 | |
5 | 5 | // This program is free software; you can redistribute it and/or |
6 | 6 | // modify it under the terms of the GNU General Public License |
@@ -422,7 +422,9 @@ | ||
422 | 422 | |
423 | 423 | if ( ( (cache->GetLogInfo().GetSumChanges (index) |
424 | 424 | & ( CRevisionInfoContainer::ACTION_ADDED |
425 | - | CRevisionInfoContainer::ACTION_REPLACED)) != 0) | |
425 | + | CRevisionInfoContainer::ACTION_REPLACED | |
426 | + | CRevisionInfoContainer::ACTION_MOVED | |
427 | + | CRevisionInfoContainer::ACTION_MOVEREPLACED)) != 0) | |
426 | 428 | && (currentPath.get() != NULL)) |
427 | 429 | { |
428 | 430 | // create the appropriate iterator to follow the potential path change |
@@ -1,6 +1,6 @@ | ||
1 | 1 | // TortoiseSVN - a Windows shell extension for easy version control |
2 | 2 | |
3 | -// Copyright (C) 2007-2011 - TortoiseSVN | |
3 | +// Copyright (C) 2007-2011, 2014 - TortoiseSVN | |
4 | 4 | |
5 | 5 | // This program is free software; you can redistribute it and/or |
6 | 6 | // modify it under the terms of the GNU General Public License |
@@ -268,17 +268,21 @@ | ||
268 | 268 | |
269 | 269 | enum TChangeAction |
270 | 270 | { |
271 | - HAS_COPY_FROM = 0x01, | |
271 | + HAS_COPY_FROM = 0x01, | |
272 | + | |
273 | + ACTION_ADDED = 0x04, | |
274 | + ACTION_CHANGED = 0x08, | |
275 | + ACTION_REPLACED = 0x10, | |
276 | + ACTION_DELETED = 0x20, | |
277 | + ACTION_MOVED = 0x40, | |
278 | + ACTION_MOVEREPLACED = 0x80, | |
272 | 279 | |
273 | - ACTION_ADDED = 0x04, | |
274 | - ACTION_CHANGED = 0x08, | |
275 | - ACTION_REPLACED = 0x10, | |
276 | - ACTION_DELETED = 0x20, | |
277 | - | |
278 | 280 | ANY_ACTION = ACTION_ADDED |
279 | 281 | | ACTION_CHANGED |
280 | 282 | | ACTION_REPLACED |
281 | 283 | | ACTION_DELETED |
284 | + | ACTION_MOVED | |
285 | + | ACTION_MOVEREPLACED | |
282 | 286 | }; |
283 | 287 | |
284 | 288 | /** |
@@ -1,6 +1,6 @@ | ||
1 | 1 | // TortoiseSVN - a Windows shell extension for easy version control |
2 | 2 | |
3 | -// Copyright (C) 2007-2007, 2009-2011 - TortoiseSVN | |
3 | +// Copyright (C) 2007-2007, 2009-2011, 2014 - TortoiseSVN | |
4 | 4 | |
5 | 5 | // This program is free software; you can redistribute it and/or |
6 | 6 | // modify it under the terms of the GNU General Public License |
@@ -49,10 +49,12 @@ | ||
49 | 49 | |
50 | 50 | enum |
51 | 51 | { |
52 | - LOGACTIONS_ADDED = 0x00000001, | |
53 | - LOGACTIONS_MODIFIED = 0x00000002, | |
54 | - LOGACTIONS_REPLACED = 0x00000004, | |
55 | - LOGACTIONS_DELETED = 0x00000008 | |
52 | + LOGACTIONS_ADDED = 0x00000001, | |
53 | + LOGACTIONS_MODIFIED = 0x00000002, | |
54 | + LOGACTIONS_REPLACED = 0x00000004, | |
55 | + LOGACTIONS_DELETED = 0x00000008, | |
56 | + LOGACTIONS_MOVED = 0x00000010, | |
57 | + LOGACTIONS_MOVEREPLACED = 0x00000020 | |
56 | 58 | }; |
57 | 59 | |
58 | 60 | /** |
@@ -181,7 +181,7 @@ | ||
181 | 181 | = (svn_log_changed_path2_t *) apr_hash_get ( log_entry->changed_paths2 |
182 | 182 | , item->key |
183 | 183 | , item->klen); |
184 | - static const char actionKeys[5] = "AMRD"; | |
184 | + static const char actionKeys[7] = "AMRDVE"; | |
185 | 185 | const char* actionKey = strchr (actionKeys, log_item->action); |
186 | 186 | |
187 | 187 | entry.action = actionKey == NULL |
@@ -235,7 +235,7 @@ | ||
235 | 235 | = (svn_log_changed_path_t *) apr_hash_get ( log_entry->changed_paths |
236 | 236 | , item->key |
237 | 237 | , item->klen); |
238 | - static const char actionKeys[5] = "AMRD"; | |
238 | + static const char actionKeys[7] = "AMRDVE"; | |
239 | 239 | const char* actionKey = strchr (actionKeys, log_item->action); |
240 | 240 | |
241 | 241 | entry.action = actionKey == NULL |
@@ -410,7 +410,7 @@ | ||
410 | 410 | , includeChanges |
411 | 411 | , strictNodeHistory |
412 | 412 | , includeMerges |
413 | - , svn_move_behavior_no_moves | |
413 | + , svn_move_behavior_auto_moves | |
414 | 414 | , revprops |
415 | 415 | , LogReceiver |
416 | 416 | , (void *)&baton |
@@ -177,6 +177,8 @@ | ||
177 | 177 | , m_hDeletedIcon(NULL) |
178 | 178 | , m_hMergedIcon(NULL) |
179 | 179 | , m_hReverseMergedIcon(NULL) |
180 | + , m_hMovedIcon(NULL) | |
181 | + , m_hMoveReplacedIcon(NULL) | |
180 | 182 | , m_nIconFolder(0) |
181 | 183 | , m_prevLogEntriesSize(0) |
182 | 184 | , m_temprev(0) |
@@ -218,6 +220,8 @@ | ||
218 | 220 | DestroyIcon(m_hDeletedIcon); |
219 | 221 | DestroyIcon(m_hMergedIcon); |
220 | 222 | DestroyIcon(m_hReverseMergedIcon); |
223 | + DestroyIcon(m_hMovedIcon); | |
224 | + DestroyIcon(m_hMoveReplacedIcon); | |
221 | 225 | if ( m_pStoreSelection ) |
222 | 226 | { |
223 | 227 | m_pStoreSelection->ClearSelection(); |
@@ -428,6 +432,10 @@ | ||
428 | 432 | IMAGE_ICON, 0, 0, LR_DEFAULTSIZE); |
429 | 433 | m_hReverseMergedIcon = (HICON)LoadImage(AfxGetResourceHandle(), |
430 | 434 | MAKEINTRESOURCE(IDI_ACTIONREVERSEMERGED), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE); |
435 | + m_hMovedIcon = (HICON)LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ACTIONREPLACED), | |
436 | + IMAGE_ICON, 0, 0, LR_DEFAULTSIZE); | |
437 | + m_hMoveReplacedIcon = (HICON)LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ACTIONREPLACED), | |
438 | + IMAGE_ICON, 0, 0, LR_DEFAULTSIZE); | |
431 | 439 | } |
432 | 440 | |
433 | 441 | void CLogDlg::ConfigureColumnsForLogListControl() |
@@ -3206,7 +3214,17 @@ | ||
3206 | 3214 | rect.top, m_hReplacedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL); |
3207 | 3215 | nIcons++; |
3208 | 3216 | |
3209 | - if ((pLogEntry->GetDepth())|| | |
3217 | + if (actions & LOGACTIONS_MOVED) | |
3218 | + ::DrawIconEx(pLVCD->nmcd.hdc, rect.left + nIcons*iconwidth + ICONITEMBORDER, | |
3219 | + rect.top, m_hMovedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL); | |
3220 | + nIcons++; | |
3221 | + | |
3222 | + if (actions & LOGACTIONS_MOVEREPLACED) | |
3223 | + ::DrawIconEx(pLVCD->nmcd.hdc, rect.left + nIcons*iconwidth + ICONITEMBORDER, | |
3224 | + rect.top, m_hMoveReplacedIcon, iconwidth, iconheight, 0, NULL, DI_NORMAL); | |
3225 | + nIcons++; | |
3226 | + | |
3227 | + if ((pLogEntry->GetDepth()) || | |
3210 | 3228 | (m_mergedRevs.find(pLogEntry->GetRevision()) != m_mergedRevs.end())) |
3211 | 3229 | { |
3212 | 3230 | if (pLogEntry->IsSubtractiveMerge()) |
@@ -3324,6 +3342,10 @@ | ||
3324 | 3342 | crText = m_Colors.GetColor(CColors::Added); |
3325 | 3343 | if (action == LOGACTIONS_DELETED) |
3326 | 3344 | crText = m_Colors.GetColor(CColors::Deleted); |
3345 | + if (action == LOGACTIONS_MOVED) | |
3346 | + crText = m_Colors.GetColor(CColors::Added); | |
3347 | + if (action == LOGACTIONS_MOVEREPLACED) | |
3348 | + crText = m_Colors.GetColor(CColors::Deleted); | |
3327 | 3349 | } |
3328 | 3350 | if (m_currentChangedArray.GetCount() > pLVCD->nmcd.dwItemSpec) |
3329 | 3351 | { |
@@ -3960,7 +3982,7 @@ | ||
3960 | 3982 | case 1: //action -- dummy text, not drawn. Used to trick the auto-column resizing to not |
3961 | 3983 | // go below the icons |
3962 | 3984 | if (pLogEntry) |
3963 | - lstrcpyn(pItem->pszText, L"XXXXXXXXXX", pItem->cchTextMax); | |
3985 | + lstrcpyn(pItem->pszText, L"XXXXXXXXXXXXXXXX", pItem->cchTextMax); | |
3964 | 3986 | break; |
3965 | 3987 | case 2: //author |
3966 | 3988 | if (pLogEntry) |
@@ -4553,7 +4575,7 @@ | ||
4553 | 4575 | // Adjust columns "Actions" containing icons |
4554 | 4576 | if (col == 1) |
4555 | 4577 | { |
4556 | - const int nMinimumWidth = ICONITEMBORDER+16*5; | |
4578 | + const int nMinimumWidth = ICONITEMBORDER+16*7; | |
4557 | 4579 | if (cx < nMinimumWidth) |
4558 | 4580 | { |
4559 | 4581 | cx = nMinimumWidth; |
@@ -5979,7 +6001,21 @@ | ||
5979 | 6001 | actionText += CLogChangedPath::GetActionString (LOGACTIONS_REPLACED); |
5980 | 6002 | } |
5981 | 6003 | |
5982 | - sToolTipText = CUnicodeUtils::GetUnicode (actionText.c_str()); | |
6004 | + if (actions & LOGACTIONS_MOVED) | |
6005 | + { | |
6006 | + if (!actionText.empty()) | |
6007 | + actionText += "\r\n"; | |
6008 | + actionText += CLogChangedPath::GetActionString(LOGACTIONS_MOVED); | |
6009 | + } | |
6010 | + | |
6011 | + if (actions & LOGACTIONS_MOVEREPLACED) | |
6012 | + { | |
6013 | + if (!actionText.empty()) | |
6014 | + actionText += "\r\n"; | |
6015 | + actionText += CLogChangedPath::GetActionString(LOGACTIONS_MOVEREPLACED); | |
6016 | + } | |
6017 | + | |
6018 | + sToolTipText = CUnicodeUtils::GetUnicode(actionText.c_str()); | |
5983 | 6019 | if ((pLogEntry->GetDepth())||(m_mergedRevs.find(pLogEntry->GetRevision()) != m_mergedRevs.end())) |
5984 | 6020 | { |
5985 | 6021 | if (!sToolTipText.IsEmpty()) |
@@ -418,6 +418,8 @@ | ||
418 | 418 | HICON m_hDeletedIcon; |
419 | 419 | HICON m_hMergedIcon; |
420 | 420 | HICON m_hReverseMergedIcon; |
421 | + HICON m_hMovedIcon; | |
422 | + HICON m_hMoveReplacedIcon; | |
421 | 423 | int m_nIconFolder; |
422 | 424 | |
423 | 425 | HACCEL m_hAccel; |
@@ -1,6 +1,6 @@ | ||
1 | 1 | // TortoiseSVN - a Windows shell extension for easy version control |
2 | 2 | |
3 | -// Copyright (C) 2003-2007, 2009-2013 - TortoiseSVN | |
3 | +// Copyright (C) 2003-2007, 2009-2014 - TortoiseSVN | |
4 | 4 | |
5 | 5 | // This program is free software; you can redistribute it and/or |
6 | 6 | // modify it under the terms of the GNU General Public License |
@@ -104,6 +104,8 @@ | ||
104 | 104 | static std::string deleteActionString; |
105 | 105 | static std::string replacedActionString; |
106 | 106 | static std::string modifiedActionString; |
107 | + static std::string movedActionString; | |
108 | + static std::string movereplacedActionString; | |
107 | 109 | static std::string empty; |
108 | 110 | |
109 | 111 | switch (action) |
@@ -132,6 +134,18 @@ | ||
132 | 134 | |
133 | 135 | return replacedActionString; |
134 | 136 | |
137 | + case LOGACTIONS_MOVED: | |
138 | + if (movedActionString.empty()) | |
139 | + LoadString(movedActionString, IDS_SVNACTION_MOVED); | |
140 | + | |
141 | + return movedActionString; | |
142 | + | |
143 | + case LOGACTIONS_MOVEREPLACED: | |
144 | + if (movereplacedActionString.empty()) | |
145 | + LoadString(movereplacedActionString, IDS_SVNACTION_MOVEREPLACED); | |
146 | + | |
147 | + return movereplacedActionString; | |
148 | + | |
135 | 149 | default: |
136 | 150 | // there should always be an action |
137 | 151 | assert (0); |
@@ -1,6 +1,6 @@ | ||
1 | 1 | // TortoiseSVN - a Windows shell extension for easy version control |
2 | 2 | |
3 | -// Copyright (C) 2003-2008 - TortoiseSVN | |
3 | +// Copyright (C) 2003-2008, 2014 - TortoiseSVN | |
4 | 4 | |
5 | 5 | // This program is free software; you can redistribute it and/or |
6 | 6 | // modify it under the terms of the GNU General Public License |
@@ -93,7 +93,7 @@ | ||
93 | 93 | // again in the same revision |
94 | 94 | |
95 | 95 | if (( revisionInfo.GetSumChanges (index) |
96 | - & CRevisionInfoContainer::ACTION_REPLACED) != 0) | |
96 | + & (CRevisionInfoContainer::ACTION_REPLACED | CRevisionInfoContainer::ACTION_MOVEREPLACED)) != 0) | |
97 | 97 | { |
98 | 98 | CSearchPathTree* startNode |
99 | 99 | = searchTree->FindCommonParent (basePath.GetIndex()); |
@@ -220,7 +220,7 @@ | ||
220 | 220 | { |
221 | 221 | index_t changePathID = iter->GetPathID(); |
222 | 222 | |
223 | - if ( (iter->GetAction() == CRevisionInfoContainer::ACTION_REPLACED) | |
223 | + if (((iter->GetAction() == CRevisionInfoContainer::ACTION_REPLACED) || (iter->GetAction() == CRevisionInfoContainer::ACTION_MOVEREPLACED)) | |
224 | 224 | && (path.GetBasePath().IsSameOrChildOf (changePathID))) |
225 | 225 | { |
226 | 226 | skipSubTree = false; |
@@ -325,16 +325,22 @@ | ||
325 | 325 | classification = CNodeClassification::IS_DELETED; |
326 | 326 | break; |
327 | 327 | |
328 | - case CRevisionInfoContainer::ACTION_ADDED | |
329 | - + CRevisionInfoContainer::HAS_COPY_FROM: | |
330 | - case CRevisionInfoContainer::ACTION_REPLACED | |
331 | - + CRevisionInfoContainer::HAS_COPY_FROM: | |
332 | - classification = CNodeClassification::IS_ADDED | |
328 | + case CRevisionInfoContainer::ACTION_ADDED | |
329 | + + CRevisionInfoContainer::HAS_COPY_FROM: | |
330 | + case CRevisionInfoContainer::ACTION_REPLACED | |
331 | + + CRevisionInfoContainer::HAS_COPY_FROM: | |
332 | + case CRevisionInfoContainer::ACTION_MOVED | |
333 | + + CRevisionInfoContainer::HAS_COPY_FROM: | |
334 | + case CRevisionInfoContainer::ACTION_MOVEREPLACED | |
335 | + + CRevisionInfoContainer::HAS_COPY_FROM: | |
336 | + classification = CNodeClassification::IS_ADDED | |
333 | 337 | + CNodeClassification::IS_COPY_TARGET; |
334 | 338 | break; |
335 | 339 | |
336 | 340 | case CRevisionInfoContainer::ACTION_ADDED: |
337 | 341 | case CRevisionInfoContainer::ACTION_REPLACED: |
342 | + case CRevisionInfoContainer::ACTION_MOVED: | |
343 | + case CRevisionInfoContainer::ACTION_MOVEREPLACED: | |
338 | 344 | classification = CNodeClassification::IS_ADDED; |
339 | 345 | break; |
340 | 346 | } |
@@ -623,7 +629,11 @@ | ||
623 | 629 | + CRevisionInfoContainer::HAS_COPY_FROM: |
624 | 630 | case CRevisionInfoContainer::ACTION_REPLACED |
625 | 631 | + CRevisionInfoContainer::HAS_COPY_FROM: |
626 | - // copy? -> does exist | |
632 | + case CRevisionInfoContainer::ACTION_MOVED | |
633 | + + CRevisionInfoContainer::HAS_COPY_FROM: | |
634 | + case CRevisionInfoContainer::ACTION_MOVEREPLACED | |
635 | + + CRevisionInfoContainer::HAS_COPY_FROM: | |
636 | + // copy? -> does exist | |
627 | 637 | |
628 | 638 | // We can safely assume here, that the source tree |
629 | 639 | // contains the path in question as this is why we |
@@ -634,6 +644,8 @@ | ||
634 | 644 | |
635 | 645 | case CRevisionInfoContainer::ACTION_ADDED: |
636 | 646 | case CRevisionInfoContainer::ACTION_REPLACED: |
647 | + case CRevisionInfoContainer::ACTION_MOVED: | |
648 | + case CRevisionInfoContainer::ACTION_MOVEREPLACED: | |
637 | 649 | // exact addition? -> does exist |
638 | 650 | |
639 | 651 | if (iter->GetPathID() == path.GetIndex()) |