Skip to content

Commit

Permalink
Use SVN Switch instead of Update
Browse files Browse the repository at this point in the history
  • Loading branch information
eric v committed Dec 27, 2012
1 parent 9067cb5 commit 388ed45
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions project/UnitTests/Core/SourceControl/SvnTest.cs
Expand Up @@ -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();
Expand All @@ -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());
}
Expand All @@ -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;
Expand All @@ -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());
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion project/core/sourcecontrol/Svn.cs
Expand Up @@ -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);
Expand Down

0 comments on commit 388ed45

Please sign in to comment.