Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Use SVN Switch instead of Update (Issue 245) #179

Open
wants to merge 1 commit into from

2 participants

@evonzee

Patch for Issue 245, replacing svn update with svn switch

@RubenWillems

I do not know the inner workings of svn, but according to
http://www.linuxtopia.org/online_books/programming_tool_guides/version_control_with_subversion/svn.branchmerge.switchwc.html

that command 'switches' the working folder with an url from a svn folder, like a kind of re-mapping

it looks like this solves the problem, but did you also test it with a clean get and the like?
I also do not have svn repo at hand to do all testing needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 27, 2012
  1. Use SVN Switch instead of Update

    eric v authored
This page is out of date. Refresh to see the latest.
View
10 project/UnitTests/Core/SourceControl/SvnTest.cs
@@ -253,7 +253,7 @@ public void CreateLabelFromWorkingCopyWhenTagWorkingCopyTrue()
public void ShouldGetSourceWithAppropriateRevisionNumberIfTagOnSuccessTrueAndModificationsFound()
{
ExpectSvnDirectoryExists(true);
- ExpectToExecuteArguments(string.Format(@"update {0} --revision 10 --no-auth-cache --non-interactive", StringUtil.AutoDoubleQuoteString(DefaultWorkingDirectory)));
+ ExpectToExecuteArguments(string.Format(@"switch {0} {1} --revision 10 --no-auth-cache --non-interactive", svn.TrunkUrl, StringUtil.AutoDoubleQuoteString(DefaultWorkingDirectory)));
IIntegrationResult result = IntegrationResult();
Modification mod = new Modification();
@@ -271,7 +271,7 @@ public void ShouldGetSourceWithAppropriateRevisionNumberIfTagOnSuccessTrueAndMod
public void ShouldGetSourceWithoutRevisionNumberIfTagOnSuccessTrueAndModificationsNotFound()
{
ExpectSvnDirectoryExists(true);
- ExpectToExecuteArguments(string.Format(@"update {0} --no-auth-cache --non-interactive", StringUtil.AutoDoubleQuoteString(DefaultWorkingDirectory)));
+ ExpectToExecuteArguments(string.Format(@"switch {0} {1} --no-auth-cache --non-interactive", svn.TrunkUrl, StringUtil.AutoDoubleQuoteString(DefaultWorkingDirectory)));
svn.AutoGetSource = true;
svn.GetSource(IntegrationResult());
}
@@ -280,7 +280,7 @@ public void ShouldGetSourceWithoutRevisionNumberIfTagOnSuccessTrueAndModificatio
public void ShouldGetSourceWithCredentialsIfSpecifiedIfAutoGetSourceTrue()
{
ExpectSvnDirectoryExists(true);
- ExpectToExecuteArguments(string.Format(@"update {0} --username ""Buck Rogers"" --password ""My Password"" --no-auth-cache --non-interactive", StringUtil.AutoDoubleQuoteString(DefaultWorkingDirectory)));
+ ExpectToExecuteArguments(string.Format(@"switch {0} {1} --username ""Buck Rogers"" --password ""My Password"" --no-auth-cache --non-interactive", svn.TrunkUrl, StringUtil.AutoDoubleQuoteString(DefaultWorkingDirectory)));
svn.Username = "Buck Rogers";
svn.Password = "My Password";
svn.AutoGetSource = true;
@@ -292,7 +292,7 @@ public void ShouldGetSourceWithSpacesInPath()
{
mockFileSystem.ExpectAndReturn("DirectoryExists", true, Path.Combine(DefaultWorkingDirectoryWithSpaces, ".svn"));
- ExpectToExecuteArguments(string.Format(@"update {0} --no-auth-cache --non-interactive", StringUtil.AutoDoubleQuoteString(DefaultWorkingDirectoryWithSpaces)), DefaultWorkingDirectoryWithSpaces);
+ ExpectToExecuteArguments(string.Format(@"switch {0} {1} --no-auth-cache --non-interactive", svn.TrunkUrl, StringUtil.AutoDoubleQuoteString(DefaultWorkingDirectoryWithSpaces)), DefaultWorkingDirectoryWithSpaces);
svn.AutoGetSource = true;
svn.WorkingDirectory = DefaultWorkingDirectoryWithSpaces;
svn.GetSource(IntegrationResult());
@@ -336,7 +336,7 @@ public void ShouldNotCheckoutIfSVNFoldersWithAspNetHackExist()
{
ExpectSvnDirectoryExists(false);
ExpectUnderscoreSvnDirectoryExists(true);
- ExpectToExecuteArguments(string.Format(@"update {0} --no-auth-cache --non-interactive", StringUtil.AutoDoubleQuoteString(DefaultWorkingDirectory)));
+ ExpectToExecuteArguments(string.Format(@"switch {0} {1} --no-auth-cache --non-interactive", svn.TrunkUrl, StringUtil.AutoDoubleQuoteString(DefaultWorkingDirectory)));
svn.AutoGetSource = true;
svn.WorkingDirectory = DefaultWorkingDirectory;
View
3  project/core/sourcecontrol/Svn.cs
@@ -735,7 +735,8 @@ private bool DoesSvnDirectoryExist(IIntegrationResult result)
private ProcessInfo NewGetSourceProcessInfo(IIntegrationResult result)
{
- var buffer = new PrivateArguments("update");
+ var buffer = new PrivateArguments("switch");
+ buffer.Add(string.Empty, TrunkUrl, true);
buffer.Add(null, Path.GetFullPath(result.BaseFromWorkingDirectory(WorkingDirectory)), true);
// Do not use Modification.GetLastChangeNumber() here directly.
AppendRevision(buffer, latestRevision);
Something went wrong with that request. Please try again.