<p4> source control block modifications (Feature #239)


Added by 재석 김 over 4 years ago. Updated over 3 years ago.


Status:Closed Start date:12/13/2012
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:Source Control Spent time: -
Target version:1.8.4

Description

1. Unicode mode support

p4.exe need extra parameter "-C charset" and "-Q charset" for character set to use filesystem and command line. StreamReader need to specify encoding to read proper character written by p4.exe

P4.cs: add public properties CharSet, CommandCharSet and CodePage
P4ConfigProcessInfoCreator: modify methods to support properties above.

2. void GetSource(IIntegrationResult result) performance improvement

<p4> source control block is extremely slow since it sync "entire" depot without use of View property. This is ridiculous since <p4> block is illegal without 'View' property.

P4.cs: modify CreateSyncCommandLine method to use gather viewlines from View property.


P4.zip - modified files described in the article (6.5 kB) 재석 김, 12/13/2012 05:57 am


History

Updated by Ruben Willems about 4 years ago

  • Target version changed from 1.8.3 to 1.8.4

Updated by Ruben Willems over 3 years ago

this update causes 2 tests to fail :
both have this error

should the test be updated, or is there something wrong?

ThoughtWorks.CruiseControl.UnitTests.Core.Sourcecontrol.Perforce.P4Test.GetForceSourceIfGetSourceTrue:
NMock.VerifyException :
MockIP4ProcessInfoCreator.CreateProcessInfo(ThoughtWorks.CruiseControl.Core.Sourcecontrol.Perforce.P4, System.String) called with incorrect parameter (2)

expected:&lt;sync -f @2002/10/31:05:05:00&gt;
but was:&lt;sync -f //depot/myproject/...@2002/10/31:05:05:00&gt;
  • Status changed from New to Feedback

Updated by Ruben Willems over 3 years ago

  • Assignee set to 재석 김

Updated by 재석 김 over 3 years ago

Thanks.

Test should be updated because this difference is exactly what modification causes.
Perforce command "sync @2002/10/31:05:05:05:00" or "sync -f @2002/10/31:05:05:05:00" causes full scan of repository,
while "sync //depot/myproject/...@2002/10/31:05:05:05:00" or "sync -f //depot/myproject/...@2002/10/31:05:05:05:00" have view restriction.
Updated test cases should be affect in UnitTests/Core/SourceControl/Perforce/P4Test.cs

[Test]
public void GetSourceIfGetSourceTrue()
{
    P4 p4 = CreateP4();
    p4.View = "//depot/myproject/...";
    p4.AutoGetSource = true;

    DateTime modificationsToDate = new DateTime(2002, 10, 31, 5, 5, 0);
    ProcessInfo processInfo = new ProcessInfo("getSource");
    processInfoCreatorMock.ExpectAndReturn("CreateProcessInfo", processInfo, p4, "sync //depot/myproject/...@2002/10/31:05:05:00");
    mockProcessExecutor.ExpectAndReturn("Execute", new ProcessResult("", "", 0, false), processInfo);
    p4.GetSource(IntegrationResultMother.CreateSuccessful(modificationsToDate));

    VerifyAll();
}

[Test]
public void GetForceSourceIfGetSourceTrue()
{
    P4 p4 = CreateP4();
    p4.View = "//depot/myproject/...";
    p4.AutoGetSource = true;
    p4.ForceSync = true;

    DateTime modificationsToDate = new DateTime(2002, 10, 31, 5, 5, 0);
    ProcessInfo processInfo = new ProcessInfo("getSource");
    processInfoCreatorMock.ExpectAndReturn("CreateProcessInfo", processInfo, p4, "sync -f //depot/myproject/...@2002/10/31:05:05:00");
    mockProcessExecutor.ExpectAndReturn("Execute", new ProcessResult("", "", 0, false), processInfo);
    p4.GetSource(IntegrationResultMother.CreateSuccessful(modificationsToDate));

    VerifyAll();
}

Updated by Ruben Willems over 3 years ago

  • Status changed from Feedback to In Progress

Updated by Ruben Willems over 3 years ago

  • Status changed from In Progress to Closed
  • Assignee deleted (재석 김)

Also available in: Atom PDF