Revision | 26881 (tree) |
---|---|
Zeit | 2015-10-08 03:12:05 |
Autor | stefankueng |
Fetch the log to find the revision where the external should be pegged to.
Also add a test file for situations where this is required and SVNInfo and the last-committed-rev does not work.
@@ -25,6 +25,9 @@ | ||
25 | 25 | the wrong value. (Stefan) |
26 | 26 | - BUG: Repobrowser failed to properly detect SVNParentPath |
27 | 27 | pages which don't use xml output. (Stefan) |
28 | +- BUG: Adjusting externals used the wrong revision | |
29 | + if the external was copied itself but not | |
30 | + modified later. (Stefan) | |
28 | 31 | |
29 | 32 | Version 1.9.2 |
30 | 33 | - BUG: Performance issue if dragging lots of files |
@@ -21,6 +21,7 @@ | ||
21 | 21 | #include "EditPropExternals.h" |
22 | 22 | #include "EditPropExternalsValue.h" |
23 | 23 | #include "SVN.h" |
24 | +#include "SVNLogHelper.h" | |
24 | 25 | #include "SVNInfo.h" |
25 | 26 | #include "AppUtils.h" |
26 | 27 | #include "ProgressDlg.h" |
@@ -331,6 +332,7 @@ | ||
331 | 332 | } |
332 | 333 | |
333 | 334 | progDlg.SetLine(1, CString(MAKEINTRESOURCE(IDS_EDITPROPS_PROG_FINDHEADREVS))); |
335 | + SVNLogHelper logHelper; | |
334 | 336 | for (auto it = m_externals.begin(); it != m_externals.end(); ++it) |
335 | 337 | { |
336 | 338 | progDlg.SetProgress(count, total); |
@@ -340,11 +342,11 @@ | ||
340 | 342 | count += 4; |
341 | 343 | if (!it->root.IsEmpty()) |
342 | 344 | { |
343 | - const SVNInfoData * pInfo = svnInfo.GetFirstFileInfo(CTSVNPath(it->fullurl), SVNRev(), SVNRev::REV_HEAD); | |
344 | - if ((pInfo == nullptr) || (pInfo->lastchangedrev <= 0)) | |
345 | + auto youngestRev = logHelper.GetYoungestRev(CTSVNPath(it->fullurl)); | |
346 | + if (!youngestRev.IsValid()) | |
345 | 347 | it->headrev = svn.GetHEADRevision(CTSVNPath(it->fullurl), true); |
346 | 348 | else |
347 | - it->headrev = pInfo->lastchangedrev; | |
349 | + it->headrev = youngestRev; | |
348 | 350 | } |
349 | 351 | } |
350 | 352 | progDlg.Stop(); |
@@ -405,6 +407,7 @@ | ||
405 | 407 | svn.SetPromptParentWindow(m_hWnd); |
406 | 408 | SVNInfo svnInfo; |
407 | 409 | svnInfo.SetPromptParentWindow(m_hWnd); |
410 | + SVNLogHelper logHelper; | |
408 | 411 | CProgressDlg progDlg; |
409 | 412 | progDlg.ShowModal(m_hWnd, TRUE); |
410 | 413 | progDlg.SetTitle(IDS_EDITPROPS_PROG_FINDHEADTITLE); |
@@ -427,12 +430,12 @@ | ||
427 | 430 | path_.AppendPathString(m_externals[index].targetDir); |
428 | 431 | m_externals[index].root = svn.GetRepositoryRoot(path_); |
429 | 432 | } |
430 | - | |
431 | - const SVNInfoData * pInfo = svnInfo.GetFirstFileInfo(CTSVNPath(m_externals[index].fullurl), SVNRev(), SVNRev::REV_HEAD); | |
432 | - if ((pInfo == nullptr) || (pInfo->lastchangedrev <= 0)) | |
433 | - m_externals[index].headrev = svn.GetHEADRevision(CTSVNPath(m_externals[index].fullurl), true); | |
433 | + auto fullurl = CTSVNPath(m_externals[index].fullurl); | |
434 | + auto youngestRev = logHelper.GetYoungestRev(fullurl); | |
435 | + if (!youngestRev.IsValid()) | |
436 | + m_externals[index].headrev = svn.GetHEADRevision(fullurl, true); | |
434 | 437 | else |
435 | - m_externals[index].headrev = pInfo->lastchangedrev; | |
438 | + m_externals[index].headrev = youngestRev; | |
436 | 439 | } |
437 | 440 | } |
438 | 441 | } |
@@ -0,0 +1,35 @@ | ||
1 | +:: show properties for b1, adjust external to HEAD should return r2 | |
2 | +:: show properties for b2, adjust external to HEAD should return r5 | |
3 | +svnadmin create repo | |
4 | +svn checkout "file:///%CD%/repo" wc | |
5 | +pushd wc | |
6 | + | |
7 | +mkdir branches | |
8 | +mkdir trunk | |
9 | +svn add trunk | |
10 | +svn add branches | |
11 | +svn ci . -m "" | |
12 | + | |
13 | +echo "File 1" > trunk\file1.txt | |
14 | +svn add trunk\file1.txt | |
15 | +svn ci . -m "" | |
16 | + | |
17 | +svn cp trunk branches/b1 | |
18 | +svn ci . -m "" | |
19 | +svn up | |
20 | + | |
21 | +svn propset svn:externals "../../trunk/file1.txt extfile.txt" branches/b1 | |
22 | +svn ci . -m "" | |
23 | +svn up | |
24 | + | |
25 | +svn cp trunk branches/b2 | |
26 | +svn ci . -m "" | |
27 | +svn up | |
28 | + | |
29 | +svn propset svn:externals "../b2/file1.txt extfile.txt" branches/b2 | |
30 | +svn ci . -m "" | |
31 | +svn up | |
32 | + | |
33 | +svn log -v branches/b1/extfile.txt | |
34 | +svn log -v branches/b2/extfile.txt | |
35 | +popd |