• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision26881 (tree)
Zeit2015-10-08 03:12:05
Autorstefankueng

Log Message

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.

Ändern Zusammenfassung

Diff

--- trunk/src/Changelog.txt (revision 26880)
+++ trunk/src/Changelog.txt (revision 26881)
@@ -25,6 +25,9 @@
2525 the wrong value. (Stefan)
2626 - BUG: Repobrowser failed to properly detect SVNParentPath
2727 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)
2831
2932 Version 1.9.2
3033 - BUG: Performance issue if dragging lots of files
--- trunk/src/TortoiseProc/Properties/EditPropExternals.cpp (revision 26880)
+++ trunk/src/TortoiseProc/Properties/EditPropExternals.cpp (revision 26881)
@@ -21,6 +21,7 @@
2121 #include "EditPropExternals.h"
2222 #include "EditPropExternalsValue.h"
2323 #include "SVN.h"
24+#include "SVNLogHelper.h"
2425 #include "SVNInfo.h"
2526 #include "AppUtils.h"
2627 #include "ProgressDlg.h"
@@ -331,6 +332,7 @@
331332 }
332333
333334 progDlg.SetLine(1, CString(MAKEINTRESOURCE(IDS_EDITPROPS_PROG_FINDHEADREVS)));
335+ SVNLogHelper logHelper;
334336 for (auto it = m_externals.begin(); it != m_externals.end(); ++it)
335337 {
336338 progDlg.SetProgress(count, total);
@@ -340,11 +342,11 @@
340342 count += 4;
341343 if (!it->root.IsEmpty())
342344 {
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())
345347 it->headrev = svn.GetHEADRevision(CTSVNPath(it->fullurl), true);
346348 else
347- it->headrev = pInfo->lastchangedrev;
349+ it->headrev = youngestRev;
348350 }
349351 }
350352 progDlg.Stop();
@@ -405,6 +407,7 @@
405407 svn.SetPromptParentWindow(m_hWnd);
406408 SVNInfo svnInfo;
407409 svnInfo.SetPromptParentWindow(m_hWnd);
410+ SVNLogHelper logHelper;
408411 CProgressDlg progDlg;
409412 progDlg.ShowModal(m_hWnd, TRUE);
410413 progDlg.SetTitle(IDS_EDITPROPS_PROG_FINDHEADTITLE);
@@ -427,12 +430,12 @@
427430 path_.AppendPathString(m_externals[index].targetDir);
428431 m_externals[index].root = svn.GetRepositoryRoot(path_);
429432 }
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);
434437 else
435- m_externals[index].headrev = pInfo->lastchangedrev;
438+ m_externals[index].headrev = youngestRev;
436439 }
437440 }
438441 }
--- trunk/test/Scripts/pegexternalstohead.bat (nonexistent)
+++ trunk/test/Scripts/pegexternalstohead.bat (revision 26881)
@@ -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
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Show on old repository browser