All newlines are unix (in the repo).

This commit is contained in:
Matt Burke
2011-01-27 16:40:32 -05:00
parent 67908e912f
commit c96eca911b
37 changed files with 2167 additions and 2167 deletions
+147 -147
View File
@@ -1,148 +1,148 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{09BF8124-19A8-45BE-896B-536CA0F3F0FC}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Sep.Git.Tfs.Vs2008</RootNamespace>
<AssemblyName>GitTfs.Vs2008</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.TeamFoundation, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86">
<HintPath>C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TeamFoundation.Client, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86">
<HintPath>C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TeamFoundation.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86">
<HintPath>C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TeamFoundation.Common.Library, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86">
<HintPath>C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.Common.Library.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TeamFoundation.VersionControl.Client, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86">
<HintPath>C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.VersionControl.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TeamFoundation.WorkItemTracking.Client, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86">
<HintPath>C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.WorkItemTracking.Client.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="StructureMap, Version=2.5.3.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\StructureMap\StructureMap.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\GitTfs.VsCommon\TfsApiBridge.cs">
<Link>TfsApiBridge.cs</Link>
</Compile>
<Compile Include="..\GitTfs.VsCommon\TfsHelper.Common.cs">
<Link>TfsHelper.Common.cs</Link>
</Compile>
<Compile Include="..\GitTfs.VsCommon\Wrappers.cs">
<Link>Wrappers.cs</Link>
</Compile>
<Compile Include="..\Version.cs">
<Link>Properties\Version.cs</Link>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TfsHelper.Vs2008.cs" />
<Compile Include="TfsPlugin.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GitTfs\GitTfs.csproj">
<Project>{55C169E0-93CC-488C-9885-1D4EAF4EA236}</Project>
<Name>GitTfs</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PostBuildEvent>xcopy /y "$(TargetDir)*.dll" "$(SolutionDir)GitTfs\$(OutDir)"</PostBuildEvent>
</PropertyGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{09BF8124-19A8-45BE-896B-536CA0F3F0FC}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Sep.Git.Tfs.Vs2008</RootNamespace>
<AssemblyName>GitTfs.Vs2008</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.TeamFoundation, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86">
<HintPath>C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TeamFoundation.Client, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86">
<HintPath>C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TeamFoundation.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86">
<HintPath>C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TeamFoundation.Common.Library, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86">
<HintPath>C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.Common.Library.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TeamFoundation.VersionControl.Client, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86">
<HintPath>C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.VersionControl.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TeamFoundation.WorkItemTracking.Client, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86">
<HintPath>C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.WorkItemTracking.Client.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="StructureMap, Version=2.5.3.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\StructureMap\StructureMap.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\GitTfs.VsCommon\TfsApiBridge.cs">
<Link>TfsApiBridge.cs</Link>
</Compile>
<Compile Include="..\GitTfs.VsCommon\TfsHelper.Common.cs">
<Link>TfsHelper.Common.cs</Link>
</Compile>
<Compile Include="..\GitTfs.VsCommon\Wrappers.cs">
<Link>Wrappers.cs</Link>
</Compile>
<Compile Include="..\Version.cs">
<Link>Properties\Version.cs</Link>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TfsHelper.Vs2008.cs" />
<Compile Include="TfsPlugin.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GitTfs\GitTfs.csproj">
<Project>{55C169E0-93CC-488C-9885-1D4EAF4EA236}</Project>
<Name>GitTfs</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PostBuildEvent>xcopy /y "$(TargetDir)*.dll" "$(SolutionDir)GitTfs\$(OutDir)"</PostBuildEvent>
</PropertyGroup>
</Project>
+11 -11
View File
@@ -1,5 +1,5 @@
using System;
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using Microsoft.TeamFoundation.Client;
using Sep.Git.Tfs.Core.TfsInterop;
@@ -12,15 +12,15 @@ namespace Sep.Git.Tfs.VsCommon
public string TfsClientLibraryVersion
{
get { return typeof(TeamFoundationServer).Assembly.GetName().Version.ToString() + " (MS)"; }
}
public bool CanShowCheckinDialog { get { return false; } }
public long ShowCheckinDialog(IWorkspace workspace, IPendingChange[] pendingChanges, IEnumerable<IWorkItemCheckedInfo> checkedInfos, string checkinComment)
{
throw new NotImplementedException();
}
}
public bool CanShowCheckinDialog { get { return false; } }
public long ShowCheckinDialog(IWorkspace workspace, IPendingChange[] pendingChanges, IEnumerable<IWorkItemCheckedInfo> checkedInfos, string checkinComment)
{
throw new NotImplementedException();
}
private void UpdateServer()
{
if (string.IsNullOrEmpty(Url))
+139 -139
View File
@@ -1,140 +1,140 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{C5A374D3-A2E1-407C-9D6D-541FDB53BD62}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Sep.Git.Tfs.Vs2010</RootNamespace>
<AssemblyName>GitTfs.Vs2010</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.TeamFoundation, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation.Common.Library, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation.VersionControl.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation.WorkItemTracking.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="StructureMap, Version=2.5.3.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\StructureMap\StructureMap.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\GitTfs.VsCommon\TfsApiBridge.cs">
<Link>TfsApiBridge.cs</Link>
</Compile>
<Compile Include="..\GitTfs.VsCommon\TfsHelper.Common.cs">
<Link>TfsHelper.Common.cs</Link>
</Compile>
<Compile Include="..\GitTfs.VsCommon\Wrappers.cs">
<Link>Wrappers.cs</Link>
</Compile>
<Compile Include="..\Version.cs">
<Link>Properties\Version.cs</Link>
</Compile>
<Compile Include="ParentForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TfsHelper.Vs2010.cs" />
<Compile Include="TfsPlugin.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GitTfs\GitTfs.csproj">
<Project>{55C169E0-93CC-488C-9885-1D4EAF4EA236}</Project>
<Name>GitTfs</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PostBuildEvent>xcopy /y "$(TargetDir)*.dll" "$(SolutionDir)GitTfs\$(OutDir)"</PostBuildEvent>
</PropertyGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{C5A374D3-A2E1-407C-9D6D-541FDB53BD62}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Sep.Git.Tfs.Vs2010</RootNamespace>
<AssemblyName>GitTfs.Vs2010</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.TeamFoundation, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation.Common.Library, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation.VersionControl.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation.WorkItemTracking.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="StructureMap, Version=2.5.3.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\StructureMap\StructureMap.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\GitTfs.VsCommon\TfsApiBridge.cs">
<Link>TfsApiBridge.cs</Link>
</Compile>
<Compile Include="..\GitTfs.VsCommon\TfsHelper.Common.cs">
<Link>TfsHelper.Common.cs</Link>
</Compile>
<Compile Include="..\GitTfs.VsCommon\Wrappers.cs">
<Link>Wrappers.cs</Link>
</Compile>
<Compile Include="..\Version.cs">
<Link>Properties\Version.cs</Link>
</Compile>
<Compile Include="ParentForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TfsHelper.Vs2010.cs" />
<Compile Include="TfsPlugin.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GitTfs\GitTfs.csproj">
<Project>{55C169E0-93CC-488C-9885-1D4EAF4EA236}</Project>
<Name>GitTfs</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PostBuildEvent>xcopy /y "$(TargetDir)*.dll" "$(SolutionDir)GitTfs\$(OutDir)"</PostBuildEvent>
</PropertyGroup>
</Project>
+27 -27
View File
@@ -1,27 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Sep.Git.Tfs.Vs2010
{
public class ParentForm : Form
{
public ParentForm()
{
WindowState = FormWindowState.Minimized;
ShowInTaskbar = false;
FormBorderStyle = FormBorderStyle.None;
StartPosition = FormStartPosition.CenterParent;
}
protected override void OnLoad(EventArgs e)
{
Visible = false;
base.OnLoad(e);
WindowState = FormWindowState.Normal;
CenterToParent();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Sep.Git.Tfs.Vs2010
{
public class ParentForm : Form
{
public ParentForm()
{
WindowState = FormWindowState.Minimized;
ShowInTaskbar = false;
FormBorderStyle = FormBorderStyle.None;
StartPosition = FormStartPosition.CenterParent;
}
protected override void OnLoad(EventArgs e)
{
Visible = false;
base.OnLoad(e);
WindowState = FormWindowState.Normal;
CenterToParent();
}
}
}
+91 -91
View File
@@ -1,91 +1,91 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.VersionControl.Client;
using Microsoft.Win32;
using Sep.Git.Tfs.Core.TfsInterop;
using Sep.Git.Tfs.Util;
using Sep.Git.Tfs.Vs2010;
namespace Sep.Git.Tfs.VsCommon
{
public partial class TfsHelper : ITfsHelper
{
private TfsTeamProjectCollection server;
public string TfsClientLibraryVersion
{
get { return typeof(TfsTeamProjectCollection).Assembly.GetName().Version.ToString() + " (MS)"; }
}
private void UpdateServer()
{
if (string.IsNullOrEmpty(Url))
{
server = null;
}
else
{
server = new TfsTeamProjectCollection(new Uri(Url), new UICredentialsProvider());
server.EnsureAuthenticated();
}
}
private TfsTeamProjectCollection Server
{
get
{
return server;
}
}
public bool CanShowCheckinDialog { get { return true; } }
public long ShowCheckinDialog(IWorkspace workspace, IPendingChange[] pendingChanges, IEnumerable<IWorkItemCheckedInfo> checkedInfos, string checkinComment)
{
return ShowCheckinDialog(_bridge.Unwrap<Workspace>(workspace),
pendingChanges.Select(p => _bridge.Unwrap<PendingChange>(p)).ToArray(),
checkedInfos.Select(c => _bridge.Unwrap<WorkItemCheckedInfo>(c)).ToArray(),
checkinComment);
}
private long ShowCheckinDialog(Workspace workspace, PendingChange[] pendingChanges,
WorkItemCheckedInfo[] checkedInfos, string checkinComment)
{
using (var parentForm = new ParentForm())
{
parentForm.Show();
var dialog = Activator.CreateInstance(GetCheckinDialogType(), new object[] {workspace.VersionControlServer});
return dialog.Call<int>("Show", parentForm.Handle, workspace, pendingChanges, pendingChanges,
checkinComment, null, null, checkedInfos);
}
}
private const string DialogAssemblyName = "Microsoft.TeamFoundation.VersionControl.ControlAdapter";
private static Type GetCheckinDialogType()
{
return GetDialogAssembly().GetType(DialogAssemblyName + ".CheckinDialog");
}
private static Assembly GetDialogAssembly()
{
return Assembly.LoadFrom(GetDialogAssemblyPath());
}
private static string GetDialogAssemblyPath()
{
return Path.Combine(GetVs2010InstallDir(), "PrivateAssemblies", DialogAssemblyName + ".dll");
}
private static string GetVs2010InstallDir()
{
return Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\VisualStudio\10.0").GetValue("InstallDir").ToString();
}
}
}
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.VersionControl.Client;
using Microsoft.Win32;
using Sep.Git.Tfs.Core.TfsInterop;
using Sep.Git.Tfs.Util;
using Sep.Git.Tfs.Vs2010;
namespace Sep.Git.Tfs.VsCommon
{
public partial class TfsHelper : ITfsHelper
{
private TfsTeamProjectCollection server;
public string TfsClientLibraryVersion
{
get { return typeof(TfsTeamProjectCollection).Assembly.GetName().Version.ToString() + " (MS)"; }
}
private void UpdateServer()
{
if (string.IsNullOrEmpty(Url))
{
server = null;
}
else
{
server = new TfsTeamProjectCollection(new Uri(Url), new UICredentialsProvider());
server.EnsureAuthenticated();
}
}
private TfsTeamProjectCollection Server
{
get
{
return server;
}
}
public bool CanShowCheckinDialog { get { return true; } }
public long ShowCheckinDialog(IWorkspace workspace, IPendingChange[] pendingChanges, IEnumerable<IWorkItemCheckedInfo> checkedInfos, string checkinComment)
{
return ShowCheckinDialog(_bridge.Unwrap<Workspace>(workspace),
pendingChanges.Select(p => _bridge.Unwrap<PendingChange>(p)).ToArray(),
checkedInfos.Select(c => _bridge.Unwrap<WorkItemCheckedInfo>(c)).ToArray(),
checkinComment);
}
private long ShowCheckinDialog(Workspace workspace, PendingChange[] pendingChanges,
WorkItemCheckedInfo[] checkedInfos, string checkinComment)
{
using (var parentForm = new ParentForm())
{
parentForm.Show();
var dialog = Activator.CreateInstance(GetCheckinDialogType(), new object[] {workspace.VersionControlServer});
return dialog.Call<int>("Show", parentForm.Handle, workspace, pendingChanges, pendingChanges,
checkinComment, null, null, checkedInfos);
}
}
private const string DialogAssemblyName = "Microsoft.TeamFoundation.VersionControl.ControlAdapter";
private static Type GetCheckinDialogType()
{
return GetDialogAssembly().GetType(DialogAssemblyName + ".CheckinDialog");
}
private static Assembly GetDialogAssembly()
{
return Assembly.LoadFrom(GetDialogAssemblyPath());
}
private static string GetDialogAssemblyPath()
{
return Path.Combine(GetVs2010InstallDir(), "PrivateAssemblies", DialogAssemblyName + ".dll");
}
private static string GetVs2010InstallDir()
{
return Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\VisualStudio\10.0").GetValue("InstallDir").ToString();
}
}
}
+92 -92
View File
@@ -2,7 +2,7 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Linq;
using Microsoft.TeamFoundation.Server;
using Microsoft.TeamFoundation.VersionControl.Client;
using Microsoft.TeamFoundation.WorkItemTracking.Client;
@@ -17,27 +17,27 @@ namespace Sep.Git.Tfs.VsCommon
{
private readonly TextWriter _stdout;
private string _url;
private readonly TfsApiBridge _bridge;
private readonly IContainer _container;
private readonly TfsApiBridge _bridge;
private readonly IContainer _container;
public TfsHelper(TextWriter stdout, TfsApiBridge bridge, IContainer container)
{
_stdout = stdout;
_bridge = bridge;
_container = container;
_bridge = bridge;
_container = container;
}
public string Url
{
get { return _url; }
set { _url = value; UpdateServer(); }
}
private string[] _legacyUrls;
public string[] LegacyUrls
{
get { return _legacyUrls ?? (_legacyUrls = new string[0]); }
set { _legacyUrls = value; }
}
private string[] _legacyUrls;
public string[] LegacyUrls
{
get { return _legacyUrls ?? (_legacyUrls = new string[0]); }
set { _legacyUrls = value; }
}
private VersionControlServer VersionControl
@@ -105,60 +105,60 @@ namespace Sep.Git.Tfs.VsCommon
}
private Workspace GetWorkspace(string localDirectory, string repositoryPath)
{
try
{
var workspace = VersionControl.CreateWorkspace(GenerateWorkspaceName());
workspace.CreateMapping(new WorkingFolder(repositoryPath, localDirectory));
return workspace;
}
catch (MappingConflictException e)
{
throw new GitTfsException(e.Message, new string[] { "Run 'git tfs cleanup-workspace' to remove the workspace." }, e);
}
{
try
{
var workspace = VersionControl.CreateWorkspace(GenerateWorkspaceName());
workspace.CreateMapping(new WorkingFolder(repositoryPath, localDirectory));
return workspace;
}
catch (MappingConflictException e)
{
throw new GitTfsException(e.Message, new string[] { "Run 'git tfs cleanup-workspace' to remove the workspace." }, e);
}
}
private string GenerateWorkspaceName()
{
return "git-tfs-" + Guid.NewGuid().ToString();
}
public void CleanupWorkspaces(string workingDirectory)
{
Trace.WriteLine("Looking for workspaces mapped to @\"" + workingDirectory +"\"...", "cleanup-workspace");
var workspace = VersionControl.TryGetWorkspace(workingDirectory);
if(workspace != null)
{
Trace.WriteLine("Found mapping in workspace \"" + workspace.DisplayName + "\".", "cleanup-workspace");
if (workspace.Folders.Length == 1)
{
_stdout.WriteLine("Removing workspace \"" + workspace.DisplayName + "\".");
workspace.Delete();
}
else
{
foreach (var mapping in workspace.Folders.Where(f => Path.GetFullPath(f.LocalItem).ToLower() == Path.GetFullPath(workingDirectory).ToLower()))
{
_stdout.WriteLine("Removing @\"" + mapping.LocalItem + "\" from workspace \"" + workspace.DisplayName + "\".");
workspace.DeleteMapping(mapping);
}
}
}
}
public bool HasShelveset(string shelvesetName)
{
var matchingShelvesets = VersionControl.QueryShelvesets(shelvesetName, VersionControl.AuthenticatedUser);
return matchingShelvesets != null && matchingShelvesets.Length > 0;
}
public IShelveset CreateShelveset(IWorkspace workspace, string shelvesetName)
{
var shelveset = new Shelveset(_bridge.Unwrap<Workspace>(workspace).VersionControlServer, shelvesetName, workspace.OwnerName);
return _bridge.Wrap<WrapperForShelveset, Shelveset>(shelveset);
}
}
public void CleanupWorkspaces(string workingDirectory)
{
Trace.WriteLine("Looking for workspaces mapped to @\"" + workingDirectory +"\"...", "cleanup-workspace");
var workspace = VersionControl.TryGetWorkspace(workingDirectory);
if(workspace != null)
{
Trace.WriteLine("Found mapping in workspace \"" + workspace.DisplayName + "\".", "cleanup-workspace");
if (workspace.Folders.Length == 1)
{
_stdout.WriteLine("Removing workspace \"" + workspace.DisplayName + "\".");
workspace.Delete();
}
else
{
foreach (var mapping in workspace.Folders.Where(f => Path.GetFullPath(f.LocalItem).ToLower() == Path.GetFullPath(workingDirectory).ToLower()))
{
_stdout.WriteLine("Removing @\"" + mapping.LocalItem + "\" from workspace \"" + workspace.DisplayName + "\".");
workspace.DeleteMapping(mapping);
}
}
}
}
public bool HasShelveset(string shelvesetName)
{
var matchingShelvesets = VersionControl.QueryShelvesets(shelvesetName, VersionControl.AuthenticatedUser);
return matchingShelvesets != null && matchingShelvesets.Length > 0;
}
public IShelveset CreateShelveset(IWorkspace workspace, string shelvesetName)
{
var shelveset = new Shelveset(_bridge.Unwrap<Workspace>(workspace).VersionControlServer, shelvesetName, workspace.OwnerName);
return _bridge.Wrap<WrapperForShelveset, Shelveset>(shelveset);
}
public IIdentity GetIdentity(string username)
{
return _bridge.Wrap<WrapperForIdentity, Identity>(GroupSecurityService.ReadIdentity(SearchFactor.AccountName, username, QueryMembership.None));
@@ -175,35 +175,35 @@ namespace Sep.Git.Tfs.VsCommon
public IChangeset GetChangeset(int changesetId)
{
return _bridge.Wrap<WrapperForChangeset, Changeset>(VersionControl.GetChangeset(changesetId));
}
public bool MatchesUrl(string tfsUrl)
{
return Url == tfsUrl || LegacyUrls.Contains(tfsUrl);
}
public IEnumerable<IWorkItemCheckinInfo> GetWorkItemInfos(IEnumerable<string> workItems, TfsWorkItemCheckinAction checkinAction)
{
return
GetWorkItemInfosHelper<IWorkItemCheckinInfo, WrapperForWorkItemCheckinInfo, WorkItemCheckinInfo>(
workItems, checkinAction, GetWorkItemInfo);
}
public IEnumerable<IWorkItemCheckedInfo> GetWorkItemCheckedInfos(IEnumerable<string> workItems, TfsWorkItemCheckinAction checkinAction)
{
return
GetWorkItemInfosHelper<IWorkItemCheckedInfo, WrapperForWorkItemCheckedInfo, WorkItemCheckedInfo>(
workItems, checkinAction, GetWorkItemCheckedInfo);
}
private IEnumerable<TInterface> GetWorkItemInfosHelper<TInterface, TWrapper, TInstance>(IEnumerable<string> workItems,
TfsWorkItemCheckinAction checkinAction, Func<string, WorkItemCheckinAction, TInstance> func)
where TWrapper : class
{
return (from workItem in workItems
select _bridge.Wrap<TWrapper, TInstance>(
func(workItem, _bridge.Convert<WorkItemCheckinAction>(checkinAction))))
.Cast<TInterface>();
public bool MatchesUrl(string tfsUrl)
{
return Url == tfsUrl || LegacyUrls.Contains(tfsUrl);
}
public IEnumerable<IWorkItemCheckinInfo> GetWorkItemInfos(IEnumerable<string> workItems, TfsWorkItemCheckinAction checkinAction)
{
return
GetWorkItemInfosHelper<IWorkItemCheckinInfo, WrapperForWorkItemCheckinInfo, WorkItemCheckinInfo>(
workItems, checkinAction, GetWorkItemInfo);
}
public IEnumerable<IWorkItemCheckedInfo> GetWorkItemCheckedInfos(IEnumerable<string> workItems, TfsWorkItemCheckinAction checkinAction)
{
return
GetWorkItemInfosHelper<IWorkItemCheckedInfo, WrapperForWorkItemCheckedInfo, WorkItemCheckedInfo>(
workItems, checkinAction, GetWorkItemCheckedInfo);
}
private IEnumerable<TInterface> GetWorkItemInfosHelper<TInterface, TWrapper, TInstance>(IEnumerable<string> workItems,
TfsWorkItemCheckinAction checkinAction, Func<string, WorkItemCheckinAction, TInstance> func)
where TWrapper : class
{
return (from workItem in workItems
select _bridge.Wrap<TWrapper, TInstance>(
func(workItem, _bridge.Convert<WorkItemCheckinAction>(checkinAction))))
.Cast<TInterface>();
}
private WorkItemCheckinInfo GetWorkItemInfo(string workItem, WorkItemCheckinAction checkinAction)
@@ -213,9 +213,9 @@ namespace Sep.Git.Tfs.VsCommon
private static WorkItemCheckedInfo GetWorkItemCheckedInfo(string workitem, WorkItemCheckinAction checkinAction)
{
return new WorkItemCheckedInfo(Convert.ToInt32(workitem), true, checkinAction);
private static WorkItemCheckedInfo GetWorkItemCheckedInfo(string workitem, WorkItemCheckinAction checkinAction)
{
return new WorkItemCheckedInfo(Convert.ToInt32(workitem), true, checkinAction);
}
}
}
+8 -8
View File
@@ -204,14 +204,14 @@ namespace Sep.Git.Tfs.VsCommon
public WrapperForWorkItemCheckinInfo(WorkItemCheckinInfo workItemCheckinInfo) : base(workItemCheckinInfo)
{
}
}
public class WrapperForWorkItemCheckedInfo : WrapperFor<WorkItemCheckedInfo>, IWorkItemCheckedInfo
{
public WrapperForWorkItemCheckedInfo(WorkItemCheckedInfo workItemCheckinInfo)
: base(workItemCheckinInfo)
{
}
}
public class WrapperForWorkItemCheckedInfo : WrapperFor<WorkItemCheckedInfo>, IWorkItemCheckedInfo
{
public WrapperForWorkItemCheckedInfo(WorkItemCheckedInfo workItemCheckinInfo)
: base(workItemCheckinInfo)
{
}
}
public class WrapperForPendingChange : WrapperFor<PendingChange>, IPendingChange
+62 -62
View File
@@ -1,62 +1,62 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1F1648A7-FD88-4016-82DB-35E25BCBB038}"
ProjectSection(SolutionItems) = preProject
GitTfs.vsmdi = GitTfs.vsmdi
GitTfs1.vsmdi = GitTfs1.vsmdi
LocalTestRun.testrunconfig = LocalTestRun.testrunconfig
README = README
TODO = TODO
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitTfs", "GitTfs\GitTfs.csproj", "{55C169E0-93CC-488C-9885-1D4EAF4EA236}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitTfsTest", "GitTfsTest\GitTfsTest.csproj", "{DDFB4746-2BCE-4B34-8E45-056324CF140D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitTfsBenchmarks", "GitTfsBenchmarks\GitTfsBenchmarks.csproj", "{7C7FEA7A-24A1-4834-9815-1DF980C340F3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitTfs.Vs2008", "GitTfs.Vs2008\GitTfs.Vs2008.csproj", "{09BF8124-19A8-45BE-896B-536CA0F3F0FC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitTfs.Vs2010", "GitTfs.Vs2010\GitTfs.Vs2010.csproj", "{C5A374D3-A2E1-407C-9D6D-541FDB53BD62}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitTfsTest.Vs2010", "GitTfsTest.Vs2010\GitTfsTest.Vs2010.csproj", "{B2BF1C1C-BB58-4DEF-BFEF-DE0D2FE2E8F7}"
EndProject
Global
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = GitTfs1.vsmdi
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{55C169E0-93CC-488C-9885-1D4EAF4EA236}.Debug|x86.ActiveCfg = Debug|x86
{55C169E0-93CC-488C-9885-1D4EAF4EA236}.Debug|x86.Build.0 = Debug|x86
{55C169E0-93CC-488C-9885-1D4EAF4EA236}.Release|x86.ActiveCfg = Release|x86
{55C169E0-93CC-488C-9885-1D4EAF4EA236}.Release|x86.Build.0 = Release|x86
{DDFB4746-2BCE-4B34-8E45-056324CF140D}.Debug|x86.ActiveCfg = Debug|x86
{DDFB4746-2BCE-4B34-8E45-056324CF140D}.Debug|x86.Build.0 = Debug|x86
{DDFB4746-2BCE-4B34-8E45-056324CF140D}.Release|x86.ActiveCfg = Release|x86
{DDFB4746-2BCE-4B34-8E45-056324CF140D}.Release|x86.Build.0 = Release|x86
{7C7FEA7A-24A1-4834-9815-1DF980C340F3}.Debug|x86.ActiveCfg = Debug|x86
{7C7FEA7A-24A1-4834-9815-1DF980C340F3}.Debug|x86.Build.0 = Debug|x86
{7C7FEA7A-24A1-4834-9815-1DF980C340F3}.Release|x86.ActiveCfg = Release|x86
{7C7FEA7A-24A1-4834-9815-1DF980C340F3}.Release|x86.Build.0 = Release|x86
{09BF8124-19A8-45BE-896B-536CA0F3F0FC}.Debug|x86.ActiveCfg = Debug|x86
{09BF8124-19A8-45BE-896B-536CA0F3F0FC}.Debug|x86.Build.0 = Debug|x86
{09BF8124-19A8-45BE-896B-536CA0F3F0FC}.Release|x86.ActiveCfg = Release|x86
{09BF8124-19A8-45BE-896B-536CA0F3F0FC}.Release|x86.Build.0 = Release|x86
{C5A374D3-A2E1-407C-9D6D-541FDB53BD62}.Debug|x86.ActiveCfg = Debug|x86
{C5A374D3-A2E1-407C-9D6D-541FDB53BD62}.Debug|x86.Build.0 = Debug|x86
{C5A374D3-A2E1-407C-9D6D-541FDB53BD62}.Release|x86.ActiveCfg = Release|x86
{C5A374D3-A2E1-407C-9D6D-541FDB53BD62}.Release|x86.Build.0 = Release|x86
{B2BF1C1C-BB58-4DEF-BFEF-DE0D2FE2E8F7}.Debug|x86.ActiveCfg = Debug|x86
{B2BF1C1C-BB58-4DEF-BFEF-DE0D2FE2E8F7}.Debug|x86.Build.0 = Debug|x86
{B2BF1C1C-BB58-4DEF-BFEF-DE0D2FE2E8F7}.Release|x86.ActiveCfg = Release|x86
{B2BF1C1C-BB58-4DEF-BFEF-DE0D2FE2E8F7}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1F1648A7-FD88-4016-82DB-35E25BCBB038}"
ProjectSection(SolutionItems) = preProject
GitTfs.vsmdi = GitTfs.vsmdi
GitTfs1.vsmdi = GitTfs1.vsmdi
LocalTestRun.testrunconfig = LocalTestRun.testrunconfig
README = README
TODO = TODO
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitTfs", "GitTfs\GitTfs.csproj", "{55C169E0-93CC-488C-9885-1D4EAF4EA236}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitTfsTest", "GitTfsTest\GitTfsTest.csproj", "{DDFB4746-2BCE-4B34-8E45-056324CF140D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitTfsBenchmarks", "GitTfsBenchmarks\GitTfsBenchmarks.csproj", "{7C7FEA7A-24A1-4834-9815-1DF980C340F3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitTfs.Vs2008", "GitTfs.Vs2008\GitTfs.Vs2008.csproj", "{09BF8124-19A8-45BE-896B-536CA0F3F0FC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitTfs.Vs2010", "GitTfs.Vs2010\GitTfs.Vs2010.csproj", "{C5A374D3-A2E1-407C-9D6D-541FDB53BD62}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitTfsTest.Vs2010", "GitTfsTest.Vs2010\GitTfsTest.Vs2010.csproj", "{B2BF1C1C-BB58-4DEF-BFEF-DE0D2FE2E8F7}"
EndProject
Global
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = GitTfs1.vsmdi
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{55C169E0-93CC-488C-9885-1D4EAF4EA236}.Debug|x86.ActiveCfg = Debug|x86
{55C169E0-93CC-488C-9885-1D4EAF4EA236}.Debug|x86.Build.0 = Debug|x86
{55C169E0-93CC-488C-9885-1D4EAF4EA236}.Release|x86.ActiveCfg = Release|x86
{55C169E0-93CC-488C-9885-1D4EAF4EA236}.Release|x86.Build.0 = Release|x86
{DDFB4746-2BCE-4B34-8E45-056324CF140D}.Debug|x86.ActiveCfg = Debug|x86
{DDFB4746-2BCE-4B34-8E45-056324CF140D}.Debug|x86.Build.0 = Debug|x86
{DDFB4746-2BCE-4B34-8E45-056324CF140D}.Release|x86.ActiveCfg = Release|x86
{DDFB4746-2BCE-4B34-8E45-056324CF140D}.Release|x86.Build.0 = Release|x86
{7C7FEA7A-24A1-4834-9815-1DF980C340F3}.Debug|x86.ActiveCfg = Debug|x86
{7C7FEA7A-24A1-4834-9815-1DF980C340F3}.Debug|x86.Build.0 = Debug|x86
{7C7FEA7A-24A1-4834-9815-1DF980C340F3}.Release|x86.ActiveCfg = Release|x86
{7C7FEA7A-24A1-4834-9815-1DF980C340F3}.Release|x86.Build.0 = Release|x86
{09BF8124-19A8-45BE-896B-536CA0F3F0FC}.Debug|x86.ActiveCfg = Debug|x86
{09BF8124-19A8-45BE-896B-536CA0F3F0FC}.Debug|x86.Build.0 = Debug|x86
{09BF8124-19A8-45BE-896B-536CA0F3F0FC}.Release|x86.ActiveCfg = Release|x86
{09BF8124-19A8-45BE-896B-536CA0F3F0FC}.Release|x86.Build.0 = Release|x86
{C5A374D3-A2E1-407C-9D6D-541FDB53BD62}.Debug|x86.ActiveCfg = Debug|x86
{C5A374D3-A2E1-407C-9D6D-541FDB53BD62}.Debug|x86.Build.0 = Debug|x86
{C5A374D3-A2E1-407C-9D6D-541FDB53BD62}.Release|x86.ActiveCfg = Release|x86
{C5A374D3-A2E1-407C-9D6D-541FDB53BD62}.Release|x86.Build.0 = Release|x86
{B2BF1C1C-BB58-4DEF-BFEF-DE0D2FE2E8F7}.Debug|x86.ActiveCfg = Debug|x86
{B2BF1C1C-BB58-4DEF-BFEF-DE0D2FE2E8F7}.Debug|x86.Build.0 = Debug|x86
{B2BF1C1C-BB58-4DEF-BFEF-DE0D2FE2E8F7}.Release|x86.ActiveCfg = Release|x86
{B2BF1C1C-BB58-4DEF-BFEF-DE0D2FE2E8F7}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
+10 -10
View File
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<TestLists xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<TestList name="Lists of Tests" id="8c43106b-9dc1-4907-a29f-aa66a61bf5b6">
<RunConfiguration id="5655a60c-4b6a-4d38-b593-3d93e2d5c1a2" name="Local Test Run" storage="localtestrun.testrunconfig" type="Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration, Microsoft.VisualStudio.QualityTools.Common, PublicKeyToken=b03f5f7f11d50a3a" />
</TestList>
<TestList name="Results Not in a List" id="8c84fa94-04c1-424b-9868-57a2d4851a1d">
<TestLinks>
<TestLink id="93c5a086-fc39-0ab2-9077-b5ae2e028ce2" name="ShouldWriteCommandHelp" storage="gittfstest\bin\debug\gittfstest.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" />
</TestLinks>
</TestList>
<?xml version="1.0" encoding="utf-8"?>
<TestLists xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<TestList name="Lists of Tests" id="8c43106b-9dc1-4907-a29f-aa66a61bf5b6">
<RunConfiguration id="5655a60c-4b6a-4d38-b593-3d93e2d5c1a2" name="Local Test Run" storage="localtestrun.testrunconfig" type="Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration, Microsoft.VisualStudio.QualityTools.Common, PublicKeyToken=b03f5f7f11d50a3a" />
</TestList>
<TestList name="Results Not in a List" id="8c84fa94-04c1-424b-9868-57a2d4851a1d">
<TestLinks>
<TestLink id="93c5a086-fc39-0ab2-9077-b5ae2e028ce2" name="ShouldWriteCommandHelp" storage="gittfstest\bin\debug\gittfstest.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel, PublicKeyToken=b03f5f7f11d50a3a" />
</TestLinks>
</TestList>
</TestLists>
+24 -24
View File
@@ -1,27 +1,27 @@
using System.ComponentModel;
using System.IO;
using Sep.Git.Tfs.Core;
using Sep.Git.Tfs.Util;
using System.ComponentModel;
using System.IO;
using Sep.Git.Tfs.Core;
using Sep.Git.Tfs.Util;
namespace Sep.Git.Tfs.Commands
{
[PluggableWithAliases("checkintool", "ct")]
[Description("checkintool [options] [ref-to-checkin]")]
[RequiresValidGitRepository]
public class CheckinTool : CheckinBase
{
public CheckinTool(TextWriter stdout, CheckinOptions checkinOptions, TfsWriter writer) : base(stdout, checkinOptions, writer)
{
}
protected override long DoCheckin(TfsChangesetInfo changeset, string refToCheckin)
{
if (!changeset.Remote.Tfs.CanShowCheckinDialog)
throw new GitTfsException(
"checkintool does not work with this TFS version (" + changeset.Remote.Tfs.TfsClientLibraryVersion + ").",
new[] {"Try installing the VS2010 edition of Team Explorer."});
return changeset.Remote.CheckinTool(refToCheckin, changeset);
}
{
[PluggableWithAliases("checkintool", "ct")]
[Description("checkintool [options] [ref-to-checkin]")]
[RequiresValidGitRepository]
public class CheckinTool : CheckinBase
{
public CheckinTool(TextWriter stdout, CheckinOptions checkinOptions, TfsWriter writer) : base(stdout, checkinOptions, writer)
{
}
protected override long DoCheckin(TfsChangesetInfo changeset, string refToCheckin)
{
if (!changeset.Remote.Tfs.CanShowCheckinDialog)
throw new GitTfsException(
"checkintool does not work with this TFS version (" + changeset.Remote.Tfs.TfsClientLibraryVersion + ").",
new[] {"Try installing the VS2010 edition of Team Explorer."});
return changeset.Remote.CheckinTool(refToCheckin, changeset);
}
}
}
+11 -11
View File
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
@@ -28,17 +28,17 @@ namespace Sep.Git.Tfs.Commands
get { return this.MakeNestedOptionResults(init, fetch); }
}
public int Run(string tfsUrl, string tfsRepositoryPath)
{
return Run(tfsUrl, tfsRepositoryPath, Path.GetFileName(tfsRepositoryPath));
}
public int Run(string tfsUrl, string tfsRepositoryPath)
{
return Run(tfsUrl, tfsRepositoryPath, Path.GetFileName(tfsRepositoryPath));
}
public int Run(string tfsUrl, string tfsRepositoryPath, string gitRepositoryPath)
{
var retVal = 0;
retVal = init.Run(tfsUrl, tfsRepositoryPath, gitRepositoryPath);
if (retVal == 0) retVal = fetch.Run();
if (retVal == 0) globals.Repository.CommandNoisy("merge", globals.Repository.ReadAllTfsRemotes().First().RemoteRef);
{
var retVal = 0;
retVal = init.Run(tfsUrl, tfsRepositoryPath, gitRepositoryPath);
if (retVal == 0) retVal = fetch.Run();
if (retVal == 0) globals.Repository.CommandNoisy("merge", globals.Repository.ReadAllTfsRemotes().First().RemoteRef);
return retVal;
}
}
+79 -79
View File
@@ -1,79 +1,79 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using CommandLine.OptParse;
using Sep.Git.Tfs.Core;
using StructureMap;
namespace Sep.Git.Tfs.Commands
{
[Pluggable("fetch")]
[Description("fetch [options] [tfs-remote-id]...")]
[RequiresValidGitRepository]
public class Fetch : GitTfsCommand
{
private readonly FcOptions fcOptions;
private readonly RemoteOptions remoteOptions;
private readonly Globals globals;
public Fetch(Globals globals, RemoteOptions remoteOptions, FcOptions fcOptions)
{
this.fcOptions = fcOptions;
this.remoteOptions = remoteOptions;
this.globals = globals;
}
// [OptDef(OptValType.ValueReq)]
// [ShortOptionName('r')]
// public int? revision { get; set; }
[OptDef(OptValType.Flag)]
[LongOptionName("fetch-all")]
public bool all { get; set; }
[OptDef(OptValType.Flag)]
[ShortOptionName('p')]
public bool parents { get; set; }
public IEnumerable<IOptionResults> ExtraOptions
{
get { return this.MakeNestedOptionResults(fcOptions, remoteOptions); }
}
public int Run()
{
return Run(globals.RemoteId);
}
public int Run(params string[] args)
{
foreach(var remote in GetRemotesToFetch(args))
{
Trace.WriteLine("Fetching from TFS remote " + remote.Id);
DoFetch(remote);
}
return 0;
}
protected virtual void DoFetch(IGitTfsRemote remote)
{
remote.Fetch();
}
private IEnumerable<IGitTfsRemote> GetRemotesToFetch(IList<string> args)
{
IEnumerable<IGitTfsRemote> remotesToFetch;
if (parents)
remotesToFetch = globals.Repository.GetParentTfsCommits("HEAD").Select(commit => commit.Remote);
else if (all)
remotesToFetch = globals.Repository.ReadAllTfsRemotes();
else
remotesToFetch = args.Select(arg => globals.Repository.ReadTfsRemote(arg));
return remotesToFetch;
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using CommandLine.OptParse;
using Sep.Git.Tfs.Core;
using StructureMap;
namespace Sep.Git.Tfs.Commands
{
[Pluggable("fetch")]
[Description("fetch [options] [tfs-remote-id]...")]
[RequiresValidGitRepository]
public class Fetch : GitTfsCommand
{
private readonly FcOptions fcOptions;
private readonly RemoteOptions remoteOptions;
private readonly Globals globals;
public Fetch(Globals globals, RemoteOptions remoteOptions, FcOptions fcOptions)
{
this.fcOptions = fcOptions;
this.remoteOptions = remoteOptions;
this.globals = globals;
}
// [OptDef(OptValType.ValueReq)]
// [ShortOptionName('r')]
// public int? revision { get; set; }
[OptDef(OptValType.Flag)]
[LongOptionName("fetch-all")]
public bool all { get; set; }
[OptDef(OptValType.Flag)]
[ShortOptionName('p')]
public bool parents { get; set; }
public IEnumerable<IOptionResults> ExtraOptions
{
get { return this.MakeNestedOptionResults(fcOptions, remoteOptions); }
}
public int Run()
{
return Run(globals.RemoteId);
}
public int Run(params string[] args)
{
foreach(var remote in GetRemotesToFetch(args))
{
Trace.WriteLine("Fetching from TFS remote " + remote.Id);
DoFetch(remote);
}
return 0;
}
protected virtual void DoFetch(IGitTfsRemote remote)
{
remote.Fetch();
}
private IEnumerable<IGitTfsRemote> GetRemotesToFetch(IList<string> args)
{
IEnumerable<IGitTfsRemote> remotesToFetch;
if (parents)
remotesToFetch = globals.Repository.GetParentTfsCommits("HEAD").Select(commit => commit.Remote);
else if (all)
remotesToFetch = globals.Repository.ReadAllTfsRemotes();
else
remotesToFetch = args.Select(arg => globals.Repository.ReadTfsRemote(arg));
return remotesToFetch;
}
}
}
+64 -64
View File
@@ -1,31 +1,31 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using CommandLine.OptParse;
using Sep.Git.Tfs.Core;
using Sep.Git.Tfs.Util;
using StructureMap;
using StructureMap.Pipeline;
using StructureMap.Query;
using IContainer = StructureMap.IContainer;
using Sep.Git.Tfs.Core;
using Sep.Git.Tfs.Util;
using StructureMap;
using StructureMap.Pipeline;
using StructureMap.Query;
using IContainer = StructureMap.IContainer;
namespace Sep.Git.Tfs.Commands
{
[Pluggable("help")]
[Description("help [command-name]")]
public class Help : GitTfsCommand
{
private readonly TextWriter output;
private readonly GitTfsCommandFactory commandFactory;
private readonly IContainer _container;
private readonly TextWriter output;
private readonly GitTfsCommandFactory commandFactory;
private readonly IContainer _container;
public Help(TextWriter output, GitTfsCommandFactory commandFactory, IContainer container)
{
this.output = output;
this.commandFactory = commandFactory;
_container = container;
this.output = output;
this.commandFactory = commandFactory;
_container = container;
}
public IEnumerable<IOptionResults> ExtraOptions
@@ -39,15 +39,15 @@ namespace Sep.Git.Tfs.Commands
/// </summary>
public int Run(IList<string> args)
{
foreach(var arg in args)
{
foreach(var arg in args)
{
var command = commandFactory.GetCommand(arg);
if(command != null)
{
return Run(command);
}
}
return GitTfsExitCodes.InvalidArguments;
}
return GitTfsExitCodes.InvalidArguments;
}
/// <summary>
@@ -56,17 +56,17 @@ namespace Sep.Git.Tfs.Commands
public int Run()
{
output.WriteLine("Usage: git-tfs [command] [options]");
foreach(var pair in GetCommandMap())
foreach(var pair in GetCommandMap())
{
output.Write(" " + pair.Key);
if (pair.Value.Any())
{
output.WriteLine(" (" + string.Join(", ", pair.Value) + ")");
}
else
{
output.WriteLine();
output.Write(" " + pair.Key);
if (pair.Value.Any())
{
output.WriteLine(" (" + string.Join(", ", pair.Value) + ")");
}
else
{
output.WriteLine();
}
}
output.WriteLine(" (use 'git-tfs help [command]' for more information)");
@@ -91,36 +91,36 @@ namespace Sep.Git.Tfs.Commands
return GitTfsExitCodes.Help;
}
private Dictionary<string, IEnumerable<string>> GetCommandMap()
{
return (from instance in GetCommandInstances()
where instance.Name != null
orderby instance.Name
select instance.Name)
.ToDictionary(s => s, s => commandFactory.GetAliasesForCommandName(s));
}
private string GetCommandName(GitTfsCommand command)
{
return (from instance in GetCommandInstances()
where instance.ConcreteType == command.GetType()
select instance.Name).Single();
}
private IEnumerable<InstanceRef> GetCommandInstances()
{
return _container.Model
.PluginTypes
.Single(p => p.PluginType == typeof (GitTfsCommand))
.Instances
.Where(i => i != null);
private Dictionary<string, IEnumerable<string>> GetCommandMap()
{
return (from instance in GetCommandInstances()
where instance.Name != null
orderby instance.Name
select instance.Name)
.ToDictionary(s => s, s => commandFactory.GetAliasesForCommandName(s));
}
private string GetCommandName(GitTfsCommand command)
{
return (from instance in GetCommandInstances()
where instance.ConcreteType == command.GetType()
select instance.Name).Single();
}
private IEnumerable<InstanceRef> GetCommandInstances()
{
return _container.Model
.PluginTypes
.Single(p => p.PluginType == typeof (GitTfsCommand))
.Instances
.Where(i => i != null);
}
private string GetCommandUsage(GitTfsCommand command)
{
var descriptionAttribute =
command.GetType().GetCustomAttributes(typeof (DescriptionAttribute), false).FirstOrDefault() as
DescriptionAttribute;
DescriptionAttribute;
var commandName = GetCommandName(command);
return (descriptionAttribute != null)
? descriptionAttribute.Description
@@ -128,18 +128,18 @@ namespace Sep.Git.Tfs.Commands
}
}
public interface IHelpHelper
{
int ShowHelp(GitTfsCommand command);
int ShowHelpForInvalidArguments(GitTfsCommand command);
public interface IHelpHelper
{
int ShowHelp(GitTfsCommand command);
int ShowHelpForInvalidArguments(GitTfsCommand command);
}
public class HelpHelper : IHelpHelper
{
private readonly IContainer _container;
public HelpHelper(IContainer container)
{
_container = container;
{
private readonly IContainer _container;
public HelpHelper(IContainer container)
{
_container = container;
}
public int ShowHelp(GitTfsCommand command)
+14 -14
View File
@@ -1,14 +1,14 @@
using System.ComponentModel;
using StructureMap;
namespace Sep.Git.Tfs.Commands
{
[Pluggable("quick-clone")]
[Description("quick-clone [options] tfs-url repository-path <git-repository-path>")]
public class QuickClone : Clone
{
public QuickClone(Globals globals, Init init, QuickFetch fetch) : base(globals, fetch, init)
{
}
}
}
using System.ComponentModel;
using StructureMap;
namespace Sep.Git.Tfs.Commands
{
[Pluggable("quick-clone")]
[Description("quick-clone [options] tfs-url repository-path <git-repository-path>")]
public class QuickClone : Clone
{
public QuickClone(Globals globals, Init init, QuickFetch fetch) : base(globals, fetch, init)
{
}
}
}
+16 -16
View File
@@ -1,16 +1,16 @@
using Sep.Git.Tfs.Core;
namespace Sep.Git.Tfs.Commands
{
public class QuickFetch : Fetch
{
public QuickFetch(Globals globals, RemoteOptions remoteOptions, FcOptions fcOptions) : base(globals, remoteOptions, fcOptions)
{
}
protected override void DoFetch(IGitTfsRemote remote)
{
remote.QuickFetch();
}
}
}
using Sep.Git.Tfs.Core;
namespace Sep.Git.Tfs.Commands
{
public class QuickFetch : Fetch
{
public QuickFetch(Globals globals, RemoteOptions remoteOptions, FcOptions fcOptions) : base(globals, remoteOptions, fcOptions)
{
}
protected override void DoFetch(IGitTfsRemote remote)
{
remote.QuickFetch();
}
}
}
+8 -8
View File
@@ -64,10 +64,10 @@ namespace Sep.Git.Tfs.Core
{
try
{
var allRemotes = GetTfsRemotes();
return
allRemotes.Values.First(
remote => remote.Tfs.MatchesUrl(tfsUrl) && remote.TfsRepositoryPath == tfsRepositoryPath);
var allRemotes = GetTfsRemotes();
return
allRemotes.Values.First(
remote => remote.Tfs.MatchesUrl(tfsUrl) && remote.TfsRepositoryPath == tfsRepositoryPath);
}
catch (Exception e)
{
@@ -119,8 +119,8 @@ namespace Sep.Git.Tfs.Core
case "url":
remote.Tfs.Url = value;
break;
case "legacy-urls":
remote.Tfs.LegacyUrls = value.Split(',');
case "legacy-urls":
remote.Tfs.LegacyUrls = value.Split(',');
break;
case "repository":
remote.TfsRepositoryPath = value;
@@ -258,8 +258,8 @@ namespace Sep.Git.Tfs.Core
}
}
private IGitChangedFile BuildGitChangedFile(GitChangeInfo change)
{
private IGitChangedFile BuildGitChangedFile(GitChangeInfo change)
{
return change.ToGitChangedFile(_container.With((IGitRepository)this));
}
+403 -403
View File
@@ -1,403 +1,403 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using Sep.Git.Tfs.Commands;
using Sep.Git.Tfs.Core.TfsInterop;
namespace Sep.Git.Tfs.Core
{
public class GitTfsRemote : IGitTfsRemote
{
private static readonly Regex isInDotGit = new Regex("(?:^|/)\\.git(?:/|$)");
private static readonly Regex treeShaRegex = new Regex("^tree (" + GitTfsConstants.Sha1 + ")");
private readonly Globals globals;
private readonly TextWriter stdout;
private readonly RemoteOptions remoteOptions;
private long? maxChangesetId;
private string maxCommitHash;
public GitTfsRemote(RemoteOptions remoteOptions, Globals globals, ITfsHelper tfsHelper, TextWriter stdout)
{
this.remoteOptions = remoteOptions;
this.globals = globals;
this.stdout = stdout;
Tfs = tfsHelper;
}
public string Id { get; set; }
public string TfsRepositoryPath { get; set; }
public string IgnoreRegexExpression { get; set; }
public IGitRepository Repository { get; set; }
public ITfsHelper Tfs { get; set; }
public long MaxChangesetId
{
get { InitHistory(); return maxChangesetId.Value; }
set { maxChangesetId = value; }
}
public string MaxCommitHash
{
get { InitHistory(); return maxCommitHash; }
set { maxCommitHash = value; }
}
private void InitHistory()
{
if (maxChangesetId == null)
{
var mostRecentUpdate = Repository.GetParentTfsCommits(RemoteRef).FirstOrDefault();
if (mostRecentUpdate != null)
{
MaxCommitHash = mostRecentUpdate.GitCommit;
MaxChangesetId = mostRecentUpdate.ChangesetId;
}
else
{
MaxChangesetId = 0;
}
}
}
private string Dir
{
get
{
return Ext.CombinePaths(globals.GitDir, "tfs", Id);
}
}
private string IndexFile
{
get
{
return Path.Combine(Dir, "index");
}
}
private string WorkingDirectory
{
get
{
return Path.Combine(Dir, "workspace");
}
}
public void CleanupWorkspace()
{
Tfs.CleanupWorkspaces(WorkingDirectory);
}
public bool ShouldSkip(string path)
{
return IsInDotGit(path) ||
IsIgnored(path, IgnoreRegexExpression) ||
IsIgnored(path, remoteOptions.IgnoreRegex);
}
private bool IsIgnored(string path, string expression)
{
return expression != null && new Regex(expression).IsMatch(path);
}
private bool IsInDotGit(string path)
{
return isInDotGit.IsMatch(path);
}
public string GetPathInGitRepo(string tfsPath)
{
if(!tfsPath.StartsWith(TfsRepositoryPath,StringComparison.InvariantCultureIgnoreCase)) return null;
tfsPath = tfsPath.Substring(TfsRepositoryPath.Length);
while (tfsPath.StartsWith("/"))
tfsPath = tfsPath.Substring(1);
return tfsPath;
}
public void Fetch(Dictionary<long, string> mergeInfo)
{
foreach (var changeset in FetchChangesets())
{
AssertTemporaryIndexClean(MaxCommitHash);
var log = Apply(MaxCommitHash, changeset);
if(mergeInfo.ContainsKey(changeset.Summary.ChangesetId))
log.CommitParents.Add(mergeInfo[changeset.Summary.ChangesetId]);
UpdateRef(Commit(log), changeset.Summary.ChangesetId);
DoGcIfNeeded();
}
}
public void QuickFetch()
{
var changeset = Tfs.GetLatestChangeset(this);
AssertTemporaryIndexEmpty();
var log = CopyTree(MaxCommitHash, changeset);
UpdateRef(Commit(log), changeset.Summary.ChangesetId);
DoGcIfNeeded();
}
private IEnumerable<ITfsChangeset> FetchChangesets()
{
Trace.WriteLine(RemoteRef + ": Getting changesets from " + (MaxChangesetId + 1) + " to current ...", "info");
var changesets = Tfs.GetChangesets(TfsRepositoryPath, MaxChangesetId + 1, this);
changesets = changesets.OrderBy(cs => cs.Summary.ChangesetId);
return changesets;
}
private void UpdateRef(string commitHash, long changesetId)
{
MaxCommitHash = commitHash;
MaxChangesetId = changesetId;
Repository.CommandNoisy("update-ref", "-m", "C" + MaxChangesetId, RemoteRef, MaxCommitHash);
Repository.CommandNoisy("update-ref", TagPrefix + "C" + MaxChangesetId, MaxCommitHash);
LogCurrentMapping();
}
private void LogCurrentMapping()
{
stdout.WriteLine("C" + MaxChangesetId + " = " + MaxCommitHash);
}
private string TagPrefix
{
get { return "refs/tags/tfs/" + Id + "/"; }
}
public string RemoteRef
{
get { return "refs/remotes/tfs/" + Id; }
}
private void DoGcIfNeeded()
{
Trace.WriteLine("GC Countdown: " + globals.GcCountdown);
if(--globals.GcCountdown < 0)
{
globals.GcCountdown = globals.GcPeriod;
Repository.CommandNoisy("gc", "--auto");
}
}
private void AssertTemporaryIndexClean(string treeish)
{
if(string.IsNullOrEmpty(treeish))
{
AssertTemporaryIndexEmpty();
return;
}
WithTemporaryIndex(() => AssertIndexClean(treeish));
}
private void AssertTemporaryIndexEmpty()
{
if (File.Exists(IndexFile))
File.Delete(IndexFile);
}
private void AssertIndexClean(string treeish)
{
if (!File.Exists(IndexFile)) Repository.CommandNoisy("read-tree", treeish);
var currentTree = Repository.CommandOneline("write-tree");
var expectedCommitInfo = Repository.Command("cat-file", "commit", treeish);
var expectedCommitTree = treeShaRegex.Match(expectedCommitInfo).Groups[1].Value;
if (expectedCommitTree != currentTree)
{
Trace.WriteLine("Index mismatch: " + expectedCommitTree + " != " + currentTree);
Trace.WriteLine("rereading " + treeish);
File.Delete(IndexFile);
Repository.CommandNoisy("read-tree", treeish);
currentTree = Repository.CommandOneline("write-tree");
if (expectedCommitTree != currentTree)
{
throw new Exception("Unable to create a clean temporary index: trees (" + treeish + ") " + expectedCommitTree + " != " + currentTree);
}
}
}
private LogEntry Apply(string lastCommit, ITfsChangeset changeset)
{
LogEntry result = null;
WithTemporaryIndex(
() => GitIndexInfo.Do(Repository, index => result = changeset.Apply(lastCommit, index)));
WithTemporaryIndex(
() => result.Tree = Repository.CommandOneline("write-tree"));
if(!String.IsNullOrEmpty(lastCommit)) result.CommitParents.Add(lastCommit);
return result;
}
private LogEntry CopyTree(string lastCommit, ITfsChangeset changeset)
{
LogEntry result = null;
WithTemporaryIndex(
() => GitIndexInfo.Do(Repository, index => result = changeset.CopyTree(index)));
WithTemporaryIndex(
() => result.Tree = Repository.CommandOneline("write-tree"));
if (!String.IsNullOrEmpty(lastCommit)) result.CommitParents.Add(lastCommit);
return result;
}
private string Commit(LogEntry logEntry)
{
string commitHash = null;
WithCommitHeaderEnv(logEntry, () => commitHash = WriteCommit(logEntry));
// TODO (maybe): StoreChangesetMetadata(commitInfo);
return commitHash;
}
private string WriteCommit(LogEntry logEntry)
{
// TODO (maybe): encode logEntry.Log according to 'git config --get i18n.commitencoding', if specified
//var commitEncoding = Repository.CommandOneline("config", "i18n.commitencoding");
//var encoding = LookupEncoding(commitEncoding) ?? Encoding.UTF8;
string commitHash = null;
Repository.CommandInputOutputPipe((procIn, procOut) =>
{
procIn.WriteLine(logEntry.Log);
procIn.WriteLine(GitTfsConstants.TfsCommitInfoFormat, Tfs.Url,
TfsRepositoryPath, logEntry.ChangesetId);
procIn.Close();
commitHash = ParseCommitInfo(procOut.ReadToEnd());
}, BuildCommitCommand(logEntry));
return commitHash;
}
private string[] BuildCommitCommand(LogEntry logEntry)
{
var tree = logEntry.Tree ?? GetTemporaryIndexTreeSha();
tree.AssertValidSha();
var commitCommand = new List<string> { "commit-tree", tree };
foreach (var parent in logEntry.CommitParents)
{
commitCommand.Add("-p");
commitCommand.Add(parent);
}
return commitCommand.ToArray();
}
private string GetTemporaryIndexTreeSha()
{
string tree = null;
WithTemporaryIndex(() => tree = Repository.CommandOneline("write-tree"));
return tree;
}
private string ParseCommitInfo(string commitTreeOutput)
{
return commitTreeOutput.Trim();
}
//private Encoding LookupEncoding(string encoding)
//{
// if(encoding == null)
// return null;
// throw new NotImplementedException("Need to implement encoding lookup for " + encoding);
//}
private void WithCommitHeaderEnv(LogEntry logEntry, Action action)
{
WithTemporaryEnvironment(action, new Dictionary<string, string>
{
{"GIT_AUTHOR_NAME", logEntry.AuthorName},
{"GIT_AUTHOR_EMAIL", logEntry.AuthorEmail},
{"GIT_AUTHOR_DATE", logEntry.Date.FormatForGit()},
{"GIT_COMMITTER_DATE", logEntry.Date.FormatForGit()},
{"GIT_COMMITTER_NAME", logEntry.CommitterName ?? logEntry.AuthorName},
{"GIT_COMMITTER_EMAIL", logEntry.CommitterEmail ?? logEntry.AuthorEmail}
});
}
private void WithTemporaryIndex(Action action)
{
WithTemporaryEnvironment(() =>
{
Directory.CreateDirectory(Path.GetDirectoryName(IndexFile));
action();
}, new Dictionary<string, string> {{"GIT_INDEX_FILE", IndexFile}});
}
private void WithTemporaryEnvironment(Action action, IDictionary<string, string> newEnvironment)
{
var oldEnvironment = new Dictionary<string, string>();
PushEnvironment(newEnvironment, oldEnvironment);
try
{
action();
}
finally
{
PushEnvironment(oldEnvironment);
}
}
private void PushEnvironment(IDictionary<string, string> desiredEnvironment)
{
PushEnvironment(desiredEnvironment, new Dictionary<string, string>());
}
private void PushEnvironment(IDictionary<string, string> desiredEnvironment, IDictionary<string, string> oldEnvironment)
{
foreach(var key in desiredEnvironment.Keys)
{
oldEnvironment[key] = Environment.GetEnvironmentVariable(key);
Environment.SetEnvironmentVariable(key, desiredEnvironment[key]);
}
}
public void Shelve(string shelvesetName, string head, TfsChangesetInfo parentChangeset, bool evaluateCheckinPolicies)
{
Tfs.WithWorkspace(WorkingDirectory, this, parentChangeset,
workspace => Shelve(shelvesetName, head, parentChangeset, evaluateCheckinPolicies, workspace));
}
public bool HasShelveset(string shelvesetName)
{
return Tfs.HasShelveset(shelvesetName);
}
private void Shelve(string shelvesetName, string head, TfsChangesetInfo parentChangeset, bool evaluateCheckinPolicies, ITfsWorkspace workspace)
{
PendChangesToWorkspace(head, parentChangeset, workspace);
workspace.Shelve(shelvesetName, evaluateCheckinPolicies);
}
public long CheckinTool(string head, TfsChangesetInfo parentChangeset)
{
var changeset = 0L;
Tfs.WithWorkspace(WorkingDirectory, this, parentChangeset,
workspace => changeset = CheckinTool(head, parentChangeset, workspace));
return changeset;
}
private long CheckinTool(string head, TfsChangesetInfo parentChangeset, ITfsWorkspace workspace)
{
PendChangesToWorkspace(head, parentChangeset, workspace);
return workspace.CheckinTool();
}
private void PendChangesToWorkspace(string head, TfsChangesetInfo parentChangeset, ITfsWorkspace workspace)
{
foreach (var change in Repository.GetChangedFiles(parentChangeset.GitCommit, head))
{
change.Apply(workspace);
}
}
public long Checkin(string head, TfsChangesetInfo parentChangeset)
{
var changeset = 0L;
Tfs.WithWorkspace(WorkingDirectory, this, parentChangeset,
workspace => changeset = Checkin(head, parentChangeset, workspace));
return changeset;
}
private long Checkin(string head, TfsChangesetInfo parentChangeset, ITfsWorkspace workspace)
{
PendChangesToWorkspace(head, parentChangeset, workspace);
return workspace.Checkin();
}
}
}
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using Sep.Git.Tfs.Commands;
using Sep.Git.Tfs.Core.TfsInterop;
namespace Sep.Git.Tfs.Core
{
public class GitTfsRemote : IGitTfsRemote
{
private static readonly Regex isInDotGit = new Regex("(?:^|/)\\.git(?:/|$)");
private static readonly Regex treeShaRegex = new Regex("^tree (" + GitTfsConstants.Sha1 + ")");
private readonly Globals globals;
private readonly TextWriter stdout;
private readonly RemoteOptions remoteOptions;
private long? maxChangesetId;
private string maxCommitHash;
public GitTfsRemote(RemoteOptions remoteOptions, Globals globals, ITfsHelper tfsHelper, TextWriter stdout)
{
this.remoteOptions = remoteOptions;
this.globals = globals;
this.stdout = stdout;
Tfs = tfsHelper;
}
public string Id { get; set; }
public string TfsRepositoryPath { get; set; }
public string IgnoreRegexExpression { get; set; }
public IGitRepository Repository { get; set; }
public ITfsHelper Tfs { get; set; }
public long MaxChangesetId
{
get { InitHistory(); return maxChangesetId.Value; }
set { maxChangesetId = value; }
}
public string MaxCommitHash
{
get { InitHistory(); return maxCommitHash; }
set { maxCommitHash = value; }
}
private void InitHistory()
{
if (maxChangesetId == null)
{
var mostRecentUpdate = Repository.GetParentTfsCommits(RemoteRef).FirstOrDefault();
if (mostRecentUpdate != null)
{
MaxCommitHash = mostRecentUpdate.GitCommit;
MaxChangesetId = mostRecentUpdate.ChangesetId;
}
else
{
MaxChangesetId = 0;
}
}
}
private string Dir
{
get
{
return Ext.CombinePaths(globals.GitDir, "tfs", Id);
}
}
private string IndexFile
{
get
{
return Path.Combine(Dir, "index");
}
}
private string WorkingDirectory
{
get
{
return Path.Combine(Dir, "workspace");
}
}
public void CleanupWorkspace()
{
Tfs.CleanupWorkspaces(WorkingDirectory);
}
public bool ShouldSkip(string path)
{
return IsInDotGit(path) ||
IsIgnored(path, IgnoreRegexExpression) ||
IsIgnored(path, remoteOptions.IgnoreRegex);
}
private bool IsIgnored(string path, string expression)
{
return expression != null && new Regex(expression).IsMatch(path);
}
private bool IsInDotGit(string path)
{
return isInDotGit.IsMatch(path);
}
public string GetPathInGitRepo(string tfsPath)
{
if(!tfsPath.StartsWith(TfsRepositoryPath,StringComparison.InvariantCultureIgnoreCase)) return null;
tfsPath = tfsPath.Substring(TfsRepositoryPath.Length);
while (tfsPath.StartsWith("/"))
tfsPath = tfsPath.Substring(1);
return tfsPath;
}
public void Fetch(Dictionary<long, string> mergeInfo)
{
foreach (var changeset in FetchChangesets())
{
AssertTemporaryIndexClean(MaxCommitHash);
var log = Apply(MaxCommitHash, changeset);
if(mergeInfo.ContainsKey(changeset.Summary.ChangesetId))
log.CommitParents.Add(mergeInfo[changeset.Summary.ChangesetId]);
UpdateRef(Commit(log), changeset.Summary.ChangesetId);
DoGcIfNeeded();
}
}
public void QuickFetch()
{
var changeset = Tfs.GetLatestChangeset(this);
AssertTemporaryIndexEmpty();
var log = CopyTree(MaxCommitHash, changeset);
UpdateRef(Commit(log), changeset.Summary.ChangesetId);
DoGcIfNeeded();
}
private IEnumerable<ITfsChangeset> FetchChangesets()
{
Trace.WriteLine(RemoteRef + ": Getting changesets from " + (MaxChangesetId + 1) + " to current ...", "info");
var changesets = Tfs.GetChangesets(TfsRepositoryPath, MaxChangesetId + 1, this);
changesets = changesets.OrderBy(cs => cs.Summary.ChangesetId);
return changesets;
}
private void UpdateRef(string commitHash, long changesetId)
{
MaxCommitHash = commitHash;
MaxChangesetId = changesetId;
Repository.CommandNoisy("update-ref", "-m", "C" + MaxChangesetId, RemoteRef, MaxCommitHash);
Repository.CommandNoisy("update-ref", TagPrefix + "C" + MaxChangesetId, MaxCommitHash);
LogCurrentMapping();
}
private void LogCurrentMapping()
{
stdout.WriteLine("C" + MaxChangesetId + " = " + MaxCommitHash);
}
private string TagPrefix
{
get { return "refs/tags/tfs/" + Id + "/"; }
}
public string RemoteRef
{
get { return "refs/remotes/tfs/" + Id; }
}
private void DoGcIfNeeded()
{
Trace.WriteLine("GC Countdown: " + globals.GcCountdown);
if(--globals.GcCountdown < 0)
{
globals.GcCountdown = globals.GcPeriod;
Repository.CommandNoisy("gc", "--auto");
}
}
private void AssertTemporaryIndexClean(string treeish)
{
if(string.IsNullOrEmpty(treeish))
{
AssertTemporaryIndexEmpty();
return;
}
WithTemporaryIndex(() => AssertIndexClean(treeish));
}
private void AssertTemporaryIndexEmpty()
{
if (File.Exists(IndexFile))
File.Delete(IndexFile);
}
private void AssertIndexClean(string treeish)
{
if (!File.Exists(IndexFile)) Repository.CommandNoisy("read-tree", treeish);
var currentTree = Repository.CommandOneline("write-tree");
var expectedCommitInfo = Repository.Command("cat-file", "commit", treeish);
var expectedCommitTree = treeShaRegex.Match(expectedCommitInfo).Groups[1].Value;
if (expectedCommitTree != currentTree)
{
Trace.WriteLine("Index mismatch: " + expectedCommitTree + " != " + currentTree);
Trace.WriteLine("rereading " + treeish);
File.Delete(IndexFile);
Repository.CommandNoisy("read-tree", treeish);
currentTree = Repository.CommandOneline("write-tree");
if (expectedCommitTree != currentTree)
{
throw new Exception("Unable to create a clean temporary index: trees (" + treeish + ") " + expectedCommitTree + " != " + currentTree);
}
}
}
private LogEntry Apply(string lastCommit, ITfsChangeset changeset)
{
LogEntry result = null;
WithTemporaryIndex(
() => GitIndexInfo.Do(Repository, index => result = changeset.Apply(lastCommit, index)));
WithTemporaryIndex(
() => result.Tree = Repository.CommandOneline("write-tree"));
if(!String.IsNullOrEmpty(lastCommit)) result.CommitParents.Add(lastCommit);
return result;
}
private LogEntry CopyTree(string lastCommit, ITfsChangeset changeset)
{
LogEntry result = null;
WithTemporaryIndex(
() => GitIndexInfo.Do(Repository, index => result = changeset.CopyTree(index)));
WithTemporaryIndex(
() => result.Tree = Repository.CommandOneline("write-tree"));
if (!String.IsNullOrEmpty(lastCommit)) result.CommitParents.Add(lastCommit);
return result;
}
private string Commit(LogEntry logEntry)
{
string commitHash = null;
WithCommitHeaderEnv(logEntry, () => commitHash = WriteCommit(logEntry));
// TODO (maybe): StoreChangesetMetadata(commitInfo);
return commitHash;
}
private string WriteCommit(LogEntry logEntry)
{
// TODO (maybe): encode logEntry.Log according to 'git config --get i18n.commitencoding', if specified
//var commitEncoding = Repository.CommandOneline("config", "i18n.commitencoding");
//var encoding = LookupEncoding(commitEncoding) ?? Encoding.UTF8;
string commitHash = null;
Repository.CommandInputOutputPipe((procIn, procOut) =>
{
procIn.WriteLine(logEntry.Log);
procIn.WriteLine(GitTfsConstants.TfsCommitInfoFormat, Tfs.Url,
TfsRepositoryPath, logEntry.ChangesetId);
procIn.Close();
commitHash = ParseCommitInfo(procOut.ReadToEnd());
}, BuildCommitCommand(logEntry));
return commitHash;
}
private string[] BuildCommitCommand(LogEntry logEntry)
{
var tree = logEntry.Tree ?? GetTemporaryIndexTreeSha();
tree.AssertValidSha();
var commitCommand = new List<string> { "commit-tree", tree };
foreach (var parent in logEntry.CommitParents)
{
commitCommand.Add("-p");
commitCommand.Add(parent);
}
return commitCommand.ToArray();
}
private string GetTemporaryIndexTreeSha()
{
string tree = null;
WithTemporaryIndex(() => tree = Repository.CommandOneline("write-tree"));
return tree;
}
private string ParseCommitInfo(string commitTreeOutput)
{
return commitTreeOutput.Trim();
}
//private Encoding LookupEncoding(string encoding)
//{
// if(encoding == null)
// return null;
// throw new NotImplementedException("Need to implement encoding lookup for " + encoding);
//}
private void WithCommitHeaderEnv(LogEntry logEntry, Action action)
{
WithTemporaryEnvironment(action, new Dictionary<string, string>
{
{"GIT_AUTHOR_NAME", logEntry.AuthorName},
{"GIT_AUTHOR_EMAIL", logEntry.AuthorEmail},
{"GIT_AUTHOR_DATE", logEntry.Date.FormatForGit()},
{"GIT_COMMITTER_DATE", logEntry.Date.FormatForGit()},
{"GIT_COMMITTER_NAME", logEntry.CommitterName ?? logEntry.AuthorName},
{"GIT_COMMITTER_EMAIL", logEntry.CommitterEmail ?? logEntry.AuthorEmail}
});
}
private void WithTemporaryIndex(Action action)
{
WithTemporaryEnvironment(() =>
{
Directory.CreateDirectory(Path.GetDirectoryName(IndexFile));
action();
}, new Dictionary<string, string> {{"GIT_INDEX_FILE", IndexFile}});
}
private void WithTemporaryEnvironment(Action action, IDictionary<string, string> newEnvironment)
{
var oldEnvironment = new Dictionary<string, string>();
PushEnvironment(newEnvironment, oldEnvironment);
try
{
action();
}
finally
{
PushEnvironment(oldEnvironment);
}
}
private void PushEnvironment(IDictionary<string, string> desiredEnvironment)
{
PushEnvironment(desiredEnvironment, new Dictionary<string, string>());
}
private void PushEnvironment(IDictionary<string, string> desiredEnvironment, IDictionary<string, string> oldEnvironment)
{
foreach(var key in desiredEnvironment.Keys)
{
oldEnvironment[key] = Environment.GetEnvironmentVariable(key);
Environment.SetEnvironmentVariable(key, desiredEnvironment[key]);
}
}
public void Shelve(string shelvesetName, string head, TfsChangesetInfo parentChangeset, bool evaluateCheckinPolicies)
{
Tfs.WithWorkspace(WorkingDirectory, this, parentChangeset,
workspace => Shelve(shelvesetName, head, parentChangeset, evaluateCheckinPolicies, workspace));
}
public bool HasShelveset(string shelvesetName)
{
return Tfs.HasShelveset(shelvesetName);
}
private void Shelve(string shelvesetName, string head, TfsChangesetInfo parentChangeset, bool evaluateCheckinPolicies, ITfsWorkspace workspace)
{
PendChangesToWorkspace(head, parentChangeset, workspace);
workspace.Shelve(shelvesetName, evaluateCheckinPolicies);
}
public long CheckinTool(string head, TfsChangesetInfo parentChangeset)
{
var changeset = 0L;
Tfs.WithWorkspace(WorkingDirectory, this, parentChangeset,
workspace => changeset = CheckinTool(head, parentChangeset, workspace));
return changeset;
}
private long CheckinTool(string head, TfsChangesetInfo parentChangeset, ITfsWorkspace workspace)
{
PendChangesToWorkspace(head, parentChangeset, workspace);
return workspace.CheckinTool();
}
private void PendChangesToWorkspace(string head, TfsChangesetInfo parentChangeset, ITfsWorkspace workspace)
{
foreach (var change in Repository.GetChangedFiles(parentChangeset.GitCommit, head))
{
change.Apply(workspace);
}
}
public long Checkin(string head, TfsChangesetInfo parentChangeset)
{
var changeset = 0L;
Tfs.WithWorkspace(WorkingDirectory, this, parentChangeset,
workspace => changeset = Checkin(head, parentChangeset, workspace));
return changeset;
}
private long Checkin(string head, TfsChangesetInfo parentChangeset, ITfsWorkspace workspace)
{
PendChangesToWorkspace(head, parentChangeset, workspace);
return workspace.Checkin();
}
}
}
+33 -33
View File
@@ -1,34 +1,34 @@
using System.Collections.Generic;
using Sep.Git.Tfs.Core.TfsInterop;
namespace Sep.Git.Tfs.Core
{
public interface IGitTfsRemote
{
string Id { get; set; }
string TfsRepositoryPath { get; set; }
string IgnoreRegexExpression { get; set; }
IGitRepository Repository { get; set; }
ITfsHelper Tfs { get; set; }
long MaxChangesetId { get; set; }
string MaxCommitHash { get; set; }
string RemoteRef { get; }
bool ShouldSkip(string path);
string GetPathInGitRepo(string tfsPath);
void Fetch(Dictionary<long, string> mergeInfo);
void QuickFetch();
void Shelve(string shelvesetName, string treeish, TfsChangesetInfo parentChangeset, bool evaluateCheckinPolicies);
bool HasShelveset(string shelvesetName);
long CheckinTool(string head, TfsChangesetInfo parentChangeset);
long Checkin(string treeish, TfsChangesetInfo parentChangeset);
void CleanupWorkspace();
}
public static partial class Ext
{
public static void Fetch(this IGitTfsRemote remote)
{
remote.Fetch(new Dictionary<long, string>());
}
}
using System.Collections.Generic;
using Sep.Git.Tfs.Core.TfsInterop;
namespace Sep.Git.Tfs.Core
{
public interface IGitTfsRemote
{
string Id { get; set; }
string TfsRepositoryPath { get; set; }
string IgnoreRegexExpression { get; set; }
IGitRepository Repository { get; set; }
ITfsHelper Tfs { get; set; }
long MaxChangesetId { get; set; }
string MaxCommitHash { get; set; }
string RemoteRef { get; }
bool ShouldSkip(string path);
string GetPathInGitRepo(string tfsPath);
void Fetch(Dictionary<long, string> mergeInfo);
void QuickFetch();
void Shelve(string shelvesetName, string treeish, TfsChangesetInfo parentChangeset, bool evaluateCheckinPolicies);
bool HasShelveset(string shelvesetName);
long CheckinTool(string head, TfsChangesetInfo parentChangeset);
long Checkin(string treeish, TfsChangesetInfo parentChangeset);
void CleanupWorkspace();
}
public static partial class Ext
{
public static void Fetch(this IGitTfsRemote remote)
{
remote.Fetch(new Dictionary<long, string>());
}
}
}
+9 -9
View File
@@ -1,9 +1,9 @@
namespace Sep.Git.Tfs.Core
{
public interface ITfsChangeset
{
TfsChangesetInfo Summary { get; }
LogEntry Apply(string lastCommit, GitIndexInfo index);
LogEntry CopyTree(GitIndexInfo index);
}
}
namespace Sep.Git.Tfs.Core
{
public interface ITfsChangeset
{
TfsChangesetInfo Summary { get; }
LogEntry Apply(string lastCommit, GitIndexInfo index);
LogEntry CopyTree(GitIndexInfo index);
}
}
+2 -2
View File
@@ -15,7 +15,7 @@ namespace Sep.Git.Tfs.Core
void Add(string path);
void Edit(string path);
void Delete(string path);
void Rename(string pathFrom, string pathTo, string score);
long CheckinTool();
void Rename(string pathFrom, string pathTo, string score);
long CheckinTool();
}
}
+13 -13
View File
@@ -83,16 +83,16 @@ namespace Sep.Git.Tfs.Core
private string GetPathBeforeRename(IItem item)
{
var previousChangeset = item.ChangesetId - 1;
var oldItem = item.VersionControlServer.GetItem(item.ItemId, previousChangeset);
if (null == oldItem)
{
var history = item.VersionControlServer.QueryHistory(item.ServerItem, item.ChangesetId, 0,
TfsRecursionType.None, null, 1, previousChangeset,
1, true, false, false);
var previousChange = history.First();
oldItem = previousChange.Changes[0].Item;
}
var previousChangeset = item.ChangesetId - 1;
var oldItem = item.VersionControlServer.GetItem(item.ItemId, previousChangeset);
if (null == oldItem)
{
var history = item.VersionControlServer.QueryHistory(item.ServerItem, item.ChangesetId, 0,
TfsRecursionType.None, null, 1, previousChangeset,
1, true, false, false);
var previousChange = history.First();
oldItem = previousChange.Changes[0].Item;
}
return oldItem.ServerItem;
}
@@ -193,10 +193,10 @@ namespace Sep.Git.Tfs.Core
}
private LogEntry MakeNewLogEntry(IChangeset changesetToLog)
{
{
var log = new LogEntry();
var identity = tfs.GetIdentity(changesetToLog.Committer);
log.CommitterName = log.AuthorName = null != identity ? identity.DisplayName ?? "Unknown TFS user" : changesetToLog.Committer ?? "Unknown TFS user";
var identity = tfs.GetIdentity(changesetToLog.Committer);
log.CommitterName = log.AuthorName = null != identity ? identity.DisplayName ?? "Unknown TFS user" : changesetToLog.Committer ?? "Unknown TFS user";
log.CommitterEmail = log.AuthorEmail = null != identity ? identity.MailAddress ?? changesetToLog.Committer : changesetToLog.Committer;
log.Date = changesetToLog.CreationDate;
log.Log = changesetToLog.Comment + Environment.NewLine;
+1 -1
View File
@@ -8,7 +8,7 @@ namespace Sep.Git.Tfs.Core.TfsInterop
string Committer { get; }
DateTime CreationDate { get; }
string Comment { get; }
int ChangesetId { get; }
int ChangesetId { get; }
IVersionControlServer VersionControlServer { get; }
}
}
+9 -9
View File
@@ -6,20 +6,20 @@ namespace Sep.Git.Tfs.Core.TfsInterop
public interface ITfsHelper
{
string TfsClientLibraryVersion { get; }
string Url { get; set; }
string[] LegacyUrls { get; set; }
string Url { get; set; }
string[] LegacyUrls { get; set; }
IEnumerable<ITfsChangeset> GetChangesets(string path, long startVersion, GitTfsRemote remote);
void WithWorkspace(string directory, IGitTfsRemote remote, TfsChangesetInfo versionToFetch, Action<ITfsWorkspace> action);
IShelveset CreateShelveset(IWorkspace workspace, string shelvesetName);
IEnumerable<IWorkItemCheckinInfo> GetWorkItemInfos(IEnumerable<string> workItems, TfsWorkItemCheckinAction checkinAction);
IEnumerable<IWorkItemCheckinInfo> GetWorkItemInfos(IEnumerable<string> workItems, TfsWorkItemCheckinAction checkinAction);
IEnumerable<IWorkItemCheckedInfo> GetWorkItemCheckedInfos(IEnumerable<string> workItems, TfsWorkItemCheckinAction checkinAction);
IIdentity GetIdentity(string username);
ITfsChangeset GetLatestChangeset(GitTfsRemote remote);
IChangeset GetChangeset(int changesetId);
bool MatchesUrl(string tfsUrl);
bool HasShelveset(string shelvesetName);
bool CanShowCheckinDialog { get; }
long ShowCheckinDialog(IWorkspace workspace, IPendingChange[] pendingChanges, IEnumerable<IWorkItemCheckedInfo> checkedInfos, string checkinComment);
void CleanupWorkspaces(string workingDirectory);
IChangeset GetChangeset(int changesetId);
bool MatchesUrl(string tfsUrl);
bool HasShelveset(string shelvesetName);
bool CanShowCheckinDialog { get; }
long ShowCheckinDialog(IWorkspace workspace, IPendingChange[] pendingChanges, IEnumerable<IWorkItemCheckedInfo> checkedInfos, string checkinComment);
void CleanupWorkspaces(string workingDirectory);
}
}
+13 -13
View File
@@ -1,13 +1,13 @@
using System.Collections.Generic;
namespace Sep.Git.Tfs.Core.TfsInterop
{
public interface IVersionControlServer
{
IItem GetItem(int itemId, int changesetNumber);
IItem GetItem(string itemPath, int changesetNumber);
IItem[] GetItems(string itemPath, int changesetNumber, TfsRecursionType recursionType);
IEnumerable<IChangeset> QueryHistory(string path, int version, int deletionId, TfsRecursionType recursion,
string user, int versionFrom, int versionTo, int maxCount, bool includeChanges, bool slotMode,
bool includeDownloadInfo);
}
}
using System.Collections.Generic;
namespace Sep.Git.Tfs.Core.TfsInterop
{
public interface IVersionControlServer
{
IItem GetItem(int itemId, int changesetNumber);
IItem GetItem(string itemPath, int changesetNumber);
IItem[] GetItems(string itemPath, int changesetNumber, TfsRecursionType recursionType);
IEnumerable<IChangeset> QueryHistory(string path, int version, int deletionId, TfsRecursionType recursion,
string user, int versionFrom, int versionTo, int maxCount, bool includeChanges, bool slotMode,
bool includeDownloadInfo);
}
}
@@ -1,6 +1,6 @@
namespace Sep.Git.Tfs.Core.TfsInterop
{
public interface IWorkItemCheckedInfo
{
}
}
namespace Sep.Git.Tfs.Core.TfsInterop
{
public interface IWorkItemCheckedInfo
{
}
}
+9 -9
View File
@@ -1,9 +1,9 @@
namespace Sep.Git.Tfs.Core.TfsInterop
{
public enum TfsRecursionType
{
None,
OneLevel,
Full
}
}
namespace Sep.Git.Tfs.Core.TfsInterop
{
public enum TfsRecursionType
{
None,
OneLevel,
Full
}
}
+157 -157
View File
@@ -1,157 +1,157 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Sep.Git.Tfs.Commands;
using Sep.Git.Tfs.Core.TfsInterop;
namespace Sep.Git.Tfs.Core
{
public class TfsWorkspace : ITfsWorkspace
{
private readonly IWorkspace _workspace;
private readonly string _localDirectory;
private readonly TextWriter _stdout;
private readonly TfsChangesetInfo _contextVersion;
private readonly IGitTfsRemote _remote;
private readonly CheckinOptions _checkinOptions;
private readonly ITfsHelper _tfsHelper;
private readonly CheckinPolicyEvaluator _policyEvaluator;
public TfsWorkspace(IWorkspace workspace, string localDirectory, TextWriter stdout, TfsChangesetInfo contextVersion, IGitTfsRemote remote, CheckinOptions checkinOptions, ITfsHelper tfsHelper, CheckinPolicyEvaluator policyEvaluator)
{
_workspace = workspace;
_policyEvaluator = policyEvaluator;
_contextVersion = contextVersion;
_remote = remote;
_checkinOptions = checkinOptions;
_tfsHelper = tfsHelper;
_localDirectory = localDirectory;
_stdout = stdout;
}
public void Shelve(string shelvesetName, bool evaluateCheckinPolicies)
{
var pendingChanges = _workspace.GetPendingChanges();
if (pendingChanges.IsEmpty())
throw new GitTfsException("Nothing to shelve!");
var shelveset = _tfsHelper.CreateShelveset(_workspace, shelvesetName);
shelveset.Comment = _checkinOptions.CheckinComment;
shelveset.WorkItemInfo = GetWorkItemInfos().ToArray();
if(evaluateCheckinPolicies)
{
foreach(var message in _policyEvaluator.EvaluateCheckin(_workspace, pendingChanges, shelveset.Comment, shelveset.WorkItemInfo))
{
_stdout.WriteLine("[Checkin Policy] " + message);
}
}
_workspace.Shelve(shelveset, pendingChanges, _checkinOptions.Force ? TfsShelvingOptions.Replace : TfsShelvingOptions.None);
}
public long CheckinTool()
{
var pendingChanges = _workspace.GetPendingChanges();
if (pendingChanges.IsEmpty())
throw new GitTfsException("Nothing to checkin!");
var newChangesetId = _tfsHelper.ShowCheckinDialog(_workspace, pendingChanges, GetWorkItemCheckedInfos(),
_checkinOptions.CheckinComment);
if(newChangesetId == 0)
throw new GitTfsException("Checkin cancelled!");
return newChangesetId;
}
public long Checkin()
{
var pendingChanges = _workspace.GetPendingChanges();
if(pendingChanges.IsEmpty())
throw new GitTfsException("Nothing to checkin!");
var workItemInfos = GetWorkItemInfos();
var checkinProblems = _policyEvaluator.EvaluateCheckin(_workspace, pendingChanges, _checkinOptions.CheckinComment, workItemInfos);
if(checkinProblems.Any())
{
foreach (var message in checkinProblems)
{
_stdout.WriteLine("[ERROR] " + message);
}
throw new GitTfsException("No changes checked in.");
}
else
{
var newChangeset = _workspace.Checkin(pendingChanges, _checkinOptions.CheckinComment, null, workItemInfos);
if(newChangeset == 0)
{
throw new GitTfsException("Checkin failed!");
}
else
{
return newChangeset;
}
}
}
public string GetLocalPath(string path)
{
return Path.Combine(_localDirectory, path);
}
public void Add(string path)
{
_stdout.WriteLine(" add " + path);
var added = _workspace.PendAdd(GetLocalPath(path));
if (added != 1) throw new Exception("One item should have been added, but actually added " + added + " items.");
}
public void Edit(string path)
{
_stdout.WriteLine(" edit " + path);
GetFromTfs(path);
var edited = _workspace.PendEdit(GetLocalPath(path));
if(edited != 1) throw new Exception("One item should have been edited, but actually edited " + edited + " items.");
}
public void Delete(string path)
{
_stdout.WriteLine(" delete " + path);
GetFromTfs(path);
var deleted = _workspace.PendDelete(GetLocalPath(path));
if (deleted != 1) throw new Exception("One item should have been deleted, but actually deleted " + deleted + " items.");
}
public void Rename(string pathFrom, string pathTo, string score)
{
_stdout.WriteLine(" rename " + pathFrom + " to " + pathTo + " (score: " + score + ")");
GetFromTfs(pathFrom);
var result = _workspace.PendRename(GetLocalPath(pathFrom), GetLocalPath(pathTo));
if (result != 1) throw new ApplicationException("Unable to rename item from " + pathFrom + " to " + pathTo);
}
private void GetFromTfs(string path)
{
_workspace.ForceGetFile(_remote.TfsRepositoryPath + "/" + path, (int) _contextVersion.ChangesetId);
}
private IEnumerable<IWorkItemCheckinInfo> GetWorkItemInfos()
{
return GetWorkItemInfosHelper<IWorkItemCheckinInfo>(_tfsHelper.GetWorkItemInfos);
}
private IEnumerable<IWorkItemCheckedInfo> GetWorkItemCheckedInfos()
{
return GetWorkItemInfosHelper<IWorkItemCheckedInfo>(_tfsHelper.GetWorkItemCheckedInfos);
}
private IEnumerable<T> GetWorkItemInfosHelper<T>(Func<IEnumerable<string>, TfsWorkItemCheckinAction, IEnumerable<T>> func)
{
var workItemInfos = func(_checkinOptions.WorkItemsToAssociate, TfsWorkItemCheckinAction.Associate);
workItemInfos = workItemInfos.Append(
func(_checkinOptions.WorkItemsToResolve, TfsWorkItemCheckinAction.Resolve));
return workItemInfos;
}
}
}
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Sep.Git.Tfs.Commands;
using Sep.Git.Tfs.Core.TfsInterop;
namespace Sep.Git.Tfs.Core
{
public class TfsWorkspace : ITfsWorkspace
{
private readonly IWorkspace _workspace;
private readonly string _localDirectory;
private readonly TextWriter _stdout;
private readonly TfsChangesetInfo _contextVersion;
private readonly IGitTfsRemote _remote;
private readonly CheckinOptions _checkinOptions;
private readonly ITfsHelper _tfsHelper;
private readonly CheckinPolicyEvaluator _policyEvaluator;
public TfsWorkspace(IWorkspace workspace, string localDirectory, TextWriter stdout, TfsChangesetInfo contextVersion, IGitTfsRemote remote, CheckinOptions checkinOptions, ITfsHelper tfsHelper, CheckinPolicyEvaluator policyEvaluator)
{
_workspace = workspace;
_policyEvaluator = policyEvaluator;
_contextVersion = contextVersion;
_remote = remote;
_checkinOptions = checkinOptions;
_tfsHelper = tfsHelper;
_localDirectory = localDirectory;
_stdout = stdout;
}
public void Shelve(string shelvesetName, bool evaluateCheckinPolicies)
{
var pendingChanges = _workspace.GetPendingChanges();
if (pendingChanges.IsEmpty())
throw new GitTfsException("Nothing to shelve!");
var shelveset = _tfsHelper.CreateShelveset(_workspace, shelvesetName);
shelveset.Comment = _checkinOptions.CheckinComment;
shelveset.WorkItemInfo = GetWorkItemInfos().ToArray();
if(evaluateCheckinPolicies)
{
foreach(var message in _policyEvaluator.EvaluateCheckin(_workspace, pendingChanges, shelveset.Comment, shelveset.WorkItemInfo))
{
_stdout.WriteLine("[Checkin Policy] " + message);
}
}
_workspace.Shelve(shelveset, pendingChanges, _checkinOptions.Force ? TfsShelvingOptions.Replace : TfsShelvingOptions.None);
}
public long CheckinTool()
{
var pendingChanges = _workspace.GetPendingChanges();
if (pendingChanges.IsEmpty())
throw new GitTfsException("Nothing to checkin!");
var newChangesetId = _tfsHelper.ShowCheckinDialog(_workspace, pendingChanges, GetWorkItemCheckedInfos(),
_checkinOptions.CheckinComment);
if(newChangesetId == 0)
throw new GitTfsException("Checkin cancelled!");
return newChangesetId;
}
public long Checkin()
{
var pendingChanges = _workspace.GetPendingChanges();
if(pendingChanges.IsEmpty())
throw new GitTfsException("Nothing to checkin!");
var workItemInfos = GetWorkItemInfos();
var checkinProblems = _policyEvaluator.EvaluateCheckin(_workspace, pendingChanges, _checkinOptions.CheckinComment, workItemInfos);
if(checkinProblems.Any())
{
foreach (var message in checkinProblems)
{
_stdout.WriteLine("[ERROR] " + message);
}
throw new GitTfsException("No changes checked in.");
}
else
{
var newChangeset = _workspace.Checkin(pendingChanges, _checkinOptions.CheckinComment, null, workItemInfos);
if(newChangeset == 0)
{
throw new GitTfsException("Checkin failed!");
}
else
{
return newChangeset;
}
}
}
public string GetLocalPath(string path)
{
return Path.Combine(_localDirectory, path);
}
public void Add(string path)
{
_stdout.WriteLine(" add " + path);
var added = _workspace.PendAdd(GetLocalPath(path));
if (added != 1) throw new Exception("One item should have been added, but actually added " + added + " items.");
}
public void Edit(string path)
{
_stdout.WriteLine(" edit " + path);
GetFromTfs(path);
var edited = _workspace.PendEdit(GetLocalPath(path));
if(edited != 1) throw new Exception("One item should have been edited, but actually edited " + edited + " items.");
}
public void Delete(string path)
{
_stdout.WriteLine(" delete " + path);
GetFromTfs(path);
var deleted = _workspace.PendDelete(GetLocalPath(path));
if (deleted != 1) throw new Exception("One item should have been deleted, but actually deleted " + deleted + " items.");
}
public void Rename(string pathFrom, string pathTo, string score)
{
_stdout.WriteLine(" rename " + pathFrom + " to " + pathTo + " (score: " + score + ")");
GetFromTfs(pathFrom);
var result = _workspace.PendRename(GetLocalPath(pathFrom), GetLocalPath(pathTo));
if (result != 1) throw new ApplicationException("Unable to rename item from " + pathFrom + " to " + pathTo);
}
private void GetFromTfs(string path)
{
_workspace.ForceGetFile(_remote.TfsRepositoryPath + "/" + path, (int) _contextVersion.ChangesetId);
}
private IEnumerable<IWorkItemCheckinInfo> GetWorkItemInfos()
{
return GetWorkItemInfosHelper<IWorkItemCheckinInfo>(_tfsHelper.GetWorkItemInfos);
}
private IEnumerable<IWorkItemCheckedInfo> GetWorkItemCheckedInfos()
{
return GetWorkItemInfosHelper<IWorkItemCheckedInfo>(_tfsHelper.GetWorkItemCheckedInfos);
}
private IEnumerable<T> GetWorkItemInfosHelper<T>(Func<IEnumerable<string>, TfsWorkItemCheckinAction, IEnumerable<T>> func)
{
var workItemInfos = func(_checkinOptions.WorkItemsToAssociate, TfsWorkItemCheckinAction.Associate);
workItemInfos = workItemInfos.Append(
func(_checkinOptions.WorkItemsToResolve, TfsWorkItemCheckinAction.Resolve));
return workItemInfos;
}
}
}
+22 -22
View File
@@ -7,27 +7,27 @@ using System.Text.RegularExpressions;
using CommandLine.OptParse;
using Sep.Git.Tfs.Commands;
using Sep.Git.Tfs.Core;
using Sep.Git.Tfs.Core.TfsInterop;
using Sep.Git.Tfs.Util;
using Sep.Git.Tfs.Core.TfsInterop;
using Sep.Git.Tfs.Util;
using StructureMap;
namespace Sep.Git.Tfs
{
public class GitTfs
{
private ITfsHelper tfsHelper;
private GitTfsCommandFactory commandFactory;
private readonly IHelpHelper _help;
private readonly IContainer _container;
private readonly GitTfsCommandRunner _runner;
private ITfsHelper tfsHelper;
private GitTfsCommandFactory commandFactory;
private readonly IHelpHelper _help;
private readonly IContainer _container;
private readonly GitTfsCommandRunner _runner;
public GitTfs(ITfsHelper tfsHelper, GitTfsCommandFactory commandFactory, IHelpHelper help, IContainer container, GitTfsCommandRunner runner)
{
this.tfsHelper = tfsHelper;
this.commandFactory = commandFactory;
_help = help;
_container = container;
_runner = runner;
this.tfsHelper = tfsHelper;
this.commandFactory = commandFactory;
_help = help;
_container = container;
_runner = runner;
}
public void Run(IList<string> args)
@@ -47,7 +47,7 @@ namespace Sep.Git.Tfs
Environment.ExitCode = _help.ShowHelp(command);
}
else if(globals.ShowVersion)
{
{
_container.GetInstance<TextWriter>().WriteLine(MakeVersionString());
Environment.ExitCode = GitTfsExitCodes.OK;
}
@@ -101,8 +101,8 @@ namespace Sep.Git.Tfs
}
public void InitializeGlobals()
{
var git = _container.GetInstance<IGitHelpers>();
{
var git = _container.GetInstance<IGitHelpers>();
var globals = _container.GetInstance<Globals>();
try
{
@@ -124,8 +124,8 @@ namespace Sep.Git.Tfs
}
public void AssertValidGitRepository()
{
var globals = _container.GetInstance<Globals>();
{
var globals = _container.GetInstance<Globals>();
var git = _container.GetInstance<IGitHelpers>();
if (!Directory.Exists(globals.GitDir))
{
@@ -159,20 +159,20 @@ namespace Sep.Git.Tfs
public GitTfsCommand ExtractCommand(IList<string> args)
{
for (int i = 0; i < args.Count; i++)
{
for (int i = 0; i < args.Count; i++)
{
var command = commandFactory.GetCommand(args[i]);
if (command != null)
{
args.RemoveAt(i);
return command;
}
}
}
return _container.GetInstance<Help>();
}
public IList<string> ParseOptions(GitTfsCommand command, IList<string> args)
{
{
foreach (var parseHelper in command.GetOptionParseHelpers(_container))
{
var parser = new Parser(parseHelper);
+213 -213
View File
@@ -1,214 +1,214 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{55C169E0-93CC-488C-9885-1D4EAF4EA236}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Sep.Git.Tfs</RootNamespace>
<AssemblyName>git-tfs</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="CSharpOptParse, Version=1.0.1.0, Culture=neutral, PublicKeyToken=fc987de5fe9f6e83">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\CSharpOptParse\CSharpOptParse.dll</HintPath>
</Reference>
<Reference Include="GitSharp.Core, Version=0.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\GitSharp-0.3\GitSharp.Core.dll</HintPath>
</Reference>
<Reference Include="StructureMap, Version=2.5.3.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\StructureMap\StructureMap.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\Version.cs">
<Link>Properties\Version.cs</Link>
</Compile>
<Compile Include="Commands\Checkin.cs" />
<Compile Include="Commands\CheckinTool.cs" />
<Compile Include="Commands\CheckinOptions.cs" />
<Compile Include="Commands\CheckinBase.cs" />
<Compile Include="Commands\Cleanup.cs" />
<Compile Include="Commands\CleanupOptions.cs" />
<Compile Include="Commands\CleanupWorkspaces.cs" />
<Compile Include="Commands\Clone.cs" />
<Compile Include="Commands\CommitOptions.cs" />
<Compile Include="Commands\Diagnostics.cs" />
<Compile Include="Commands\FcOptions.cs" />
<Compile Include="Commands\Fetch.cs" />
<Compile Include="Commands\Help.cs" />
<Compile Include="Commands\Helpers.cs" />
<Compile Include="Commands\Init.cs" />
<Compile Include="Commands\InitOptions.cs" />
<Compile Include="Commands\Pull.cs" />
<Compile Include="Commands\QuickClone.cs" />
<Compile Include="Commands\QuickFetch.cs" />
<Compile Include="Commands\RemoteOptions.cs" />
<Compile Include="Commands\Shelve.cs" />
<Compile Include="Core\Changes\Git\Add.cs" />
<Compile Include="Core\Changes\Git\Delete.cs" />
<Compile Include="Core\Changes\Git\Modify.cs" />
<Compile Include="Core\Changes\Git\RenameEdit.cs" />
<Compile Include="Core\CheckinPolicyEvaluator.cs" />
<Compile Include="Core\GitChangeInfo.cs" />
<Compile Include="Core\GitObject.cs" />
<Compile Include="Core\IGitChangedFile.cs" />
<Compile Include="Core\IGitTfsRemote.cs" />
<Compile Include="Core\ITfsWorkspace.cs" />
<Compile Include="Core\Mode.cs" />
<Compile Include="Core\TfsInterop\ICheckinEvaluationResult.cs" />
<Compile Include="Core\TfsInterop\ICheckinNote.cs" />
<Compile Include="Core\TfsInterop\IVersionControlServer.cs" />
<Compile Include="Core\TfsInterop\IWorkItemCheckedInfo.cs" />
<Compile Include="Core\TfsInterop\TfsChangeType.cs" />
<Compile Include="Core\TfsInterop\TfsCheckinEvaluationOptions.cs" />
<Compile Include="Core\TfsInterop\TfsExt.cs" />
<Compile Include="Core\TfsInterop\TfsItemType.cs" />
<Compile Include="Core\TfsInterop\TfsPlugin.cs" />
<Compile Include="Core\TfsInterop\TfsRecursionType.cs" />
<Compile Include="Core\TfsInterop\TfsShelvingOptions.cs" />
<Compile Include="Core\TfsInterop\TfsWorkItemCheckinAction.cs" />
<Compile Include="Core\TfsInterop\WrapperFor.cs" />
<Compile Include="Core\TfsInterop\IChange.cs" />
<Compile Include="Core\TfsInterop\IIdentity.cs" />
<Compile Include="Core\TfsInterop\IItem.cs" />
<Compile Include="Core\TfsInterop\IPendingChange.cs" />
<Compile Include="Core\TfsInterop\IShelveset.cs" />
<Compile Include="Core\TfsInterop\ITfsHelper.cs" />
<Compile Include="Core\TfsInterop\IWorkItemCheckinInfo.cs" />
<Compile Include="Core\TfsInterop\IWorkspace.cs" />
<Compile Include="Core\TfsInterop\NullIdentity.cs" />
<Compile Include="Core\TfsInterop\IChangeset.cs" />
<Compile Include="Core\TfsWorkspace.cs" />
<Compile Include="Core\TfsWriter.cs" />
<Compile Include="Core\GitTfsException.cs" />
<Compile Include="Util\GitTfsCommandFactory.cs" />
<Compile Include="Util\GitTfsCommandRunner.cs" />
<Compile Include="Util\WhenDynamicDoesntWork.cs" />
<Compile Include="Util\PluggableWithAliases.cs" />
<Compile Include="Util\ConfiguresStructureMap.cs" />
<Compile Include="Core\DelimitedReader.cs" />
<Compile Include="Core\Ext.cs" />
<Compile Include="Core\GitCommandException.cs" />
<Compile Include="Core\GitHelpers.cs" />
<Compile Include="Core\GitIndexInfo.cs" />
<Compile Include="Core\GitRepository.cs" />
<Compile Include="Core\GitTfsRemote.cs" />
<Compile Include="Core\IGitHelpers.cs" />
<Compile Include="Core\IGitRepository.cs" />
<Compile Include="Core\ITfsChangeset.cs" />
<Compile Include="Core\LogEntry.cs" />
<Compile Include="Core\RequiresValidGitRepositoryAttribute.cs" />
<Compile Include="Core\TfsChangeset.cs" />
<Compile Include="Core\TfsChangesetInfo.cs" />
<Compile Include="GitTfs.cs" />
<Compile Include="GitTfsCommand.cs" />
<Compile Include="GitTfsConstants.cs" />
<Compile Include="GitTfsExitCodes.cs" />
<Compile Include="Globals.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Util\InspectExtensions.cs" />
<Compile Include="Util\StructureMapSingletonAttribute.cs" />
<Compile Include="Util\TemporaryFile.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="GitVersionInfo" />
</ItemGroup>
<ItemGroup>
<None Include="Core\TfsInterop\README.txt" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{55C169E0-93CC-488C-9885-1D4EAF4EA236}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Sep.Git.Tfs</RootNamespace>
<AssemblyName>git-tfs</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="CSharpOptParse, Version=1.0.1.0, Culture=neutral, PublicKeyToken=fc987de5fe9f6e83">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\CSharpOptParse\CSharpOptParse.dll</HintPath>
</Reference>
<Reference Include="GitSharp.Core, Version=0.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\GitSharp-0.3\GitSharp.Core.dll</HintPath>
</Reference>
<Reference Include="StructureMap, Version=2.5.3.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\StructureMap\StructureMap.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
</Compile>
<Compile Include="..\Version.cs">
<Link>Properties\Version.cs</Link>
</Compile>
<Compile Include="Commands\Checkin.cs" />
<Compile Include="Commands\CheckinTool.cs" />
<Compile Include="Commands\CheckinOptions.cs" />
<Compile Include="Commands\CheckinBase.cs" />
<Compile Include="Commands\Cleanup.cs" />
<Compile Include="Commands\CleanupOptions.cs" />
<Compile Include="Commands\CleanupWorkspaces.cs" />
<Compile Include="Commands\Clone.cs" />
<Compile Include="Commands\CommitOptions.cs" />
<Compile Include="Commands\Diagnostics.cs" />
<Compile Include="Commands\FcOptions.cs" />
<Compile Include="Commands\Fetch.cs" />
<Compile Include="Commands\Help.cs" />
<Compile Include="Commands\Helpers.cs" />
<Compile Include="Commands\Init.cs" />
<Compile Include="Commands\InitOptions.cs" />
<Compile Include="Commands\Pull.cs" />
<Compile Include="Commands\QuickClone.cs" />
<Compile Include="Commands\QuickFetch.cs" />
<Compile Include="Commands\RemoteOptions.cs" />
<Compile Include="Commands\Shelve.cs" />
<Compile Include="Core\Changes\Git\Add.cs" />
<Compile Include="Core\Changes\Git\Delete.cs" />
<Compile Include="Core\Changes\Git\Modify.cs" />
<Compile Include="Core\Changes\Git\RenameEdit.cs" />
<Compile Include="Core\CheckinPolicyEvaluator.cs" />
<Compile Include="Core\GitChangeInfo.cs" />
<Compile Include="Core\GitObject.cs" />
<Compile Include="Core\IGitChangedFile.cs" />
<Compile Include="Core\IGitTfsRemote.cs" />
<Compile Include="Core\ITfsWorkspace.cs" />
<Compile Include="Core\Mode.cs" />
<Compile Include="Core\TfsInterop\ICheckinEvaluationResult.cs" />
<Compile Include="Core\TfsInterop\ICheckinNote.cs" />
<Compile Include="Core\TfsInterop\IVersionControlServer.cs" />
<Compile Include="Core\TfsInterop\IWorkItemCheckedInfo.cs" />
<Compile Include="Core\TfsInterop\TfsChangeType.cs" />
<Compile Include="Core\TfsInterop\TfsCheckinEvaluationOptions.cs" />
<Compile Include="Core\TfsInterop\TfsExt.cs" />
<Compile Include="Core\TfsInterop\TfsItemType.cs" />
<Compile Include="Core\TfsInterop\TfsPlugin.cs" />
<Compile Include="Core\TfsInterop\TfsRecursionType.cs" />
<Compile Include="Core\TfsInterop\TfsShelvingOptions.cs" />
<Compile Include="Core\TfsInterop\TfsWorkItemCheckinAction.cs" />
<Compile Include="Core\TfsInterop\WrapperFor.cs" />
<Compile Include="Core\TfsInterop\IChange.cs" />
<Compile Include="Core\TfsInterop\IIdentity.cs" />
<Compile Include="Core\TfsInterop\IItem.cs" />
<Compile Include="Core\TfsInterop\IPendingChange.cs" />
<Compile Include="Core\TfsInterop\IShelveset.cs" />
<Compile Include="Core\TfsInterop\ITfsHelper.cs" />
<Compile Include="Core\TfsInterop\IWorkItemCheckinInfo.cs" />
<Compile Include="Core\TfsInterop\IWorkspace.cs" />
<Compile Include="Core\TfsInterop\NullIdentity.cs" />
<Compile Include="Core\TfsInterop\IChangeset.cs" />
<Compile Include="Core\TfsWorkspace.cs" />
<Compile Include="Core\TfsWriter.cs" />
<Compile Include="Core\GitTfsException.cs" />
<Compile Include="Util\GitTfsCommandFactory.cs" />
<Compile Include="Util\GitTfsCommandRunner.cs" />
<Compile Include="Util\WhenDynamicDoesntWork.cs" />
<Compile Include="Util\PluggableWithAliases.cs" />
<Compile Include="Util\ConfiguresStructureMap.cs" />
<Compile Include="Core\DelimitedReader.cs" />
<Compile Include="Core\Ext.cs" />
<Compile Include="Core\GitCommandException.cs" />
<Compile Include="Core\GitHelpers.cs" />
<Compile Include="Core\GitIndexInfo.cs" />
<Compile Include="Core\GitRepository.cs" />
<Compile Include="Core\GitTfsRemote.cs" />
<Compile Include="Core\IGitHelpers.cs" />
<Compile Include="Core\IGitRepository.cs" />
<Compile Include="Core\ITfsChangeset.cs" />
<Compile Include="Core\LogEntry.cs" />
<Compile Include="Core\RequiresValidGitRepositoryAttribute.cs" />
<Compile Include="Core\TfsChangeset.cs" />
<Compile Include="Core\TfsChangesetInfo.cs" />
<Compile Include="GitTfs.cs" />
<Compile Include="GitTfsCommand.cs" />
<Compile Include="GitTfsConstants.cs" />
<Compile Include="GitTfsExitCodes.cs" />
<Compile Include="Globals.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Util\InspectExtensions.cs" />
<Compile Include="Util\StructureMapSingletonAttribute.cs" />
<Compile Include="Util\TemporaryFile.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="GitVersionInfo" />
</ItemGroup>
<ItemGroup>
<None Include="Core\TfsInterop\README.txt" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
</Project>
+61 -61
View File
@@ -1,61 +1,61 @@
using System.Collections.Generic;
using System.Linq;
using StructureMap;
namespace Sep.Git.Tfs.Util
{
[StructureMapSingleton]
public class GitTfsCommandFactory
{
private readonly IContainer container;
public GitTfsCommandFactory(IContainer container)
{
this.container = container;
}
private Dictionary<string, string> _aliasMap;
public Dictionary<string, string> AliasMap
{
get { return _aliasMap ?? (_aliasMap = CreateAliasMap()); }
}
private Dictionary<string, string> CreateAliasMap()
{
var aliasMap = new Dictionary<string, string>();
var commandPluginType = container.Model.PluginTypes.First(p => p.PluginType == typeof (GitTfsCommand));
foreach (var instance in commandPluginType.Instances)
{
var attribte = instance.ConcreteType.GetCustomAttributes(typeof (PluggableWithAliases), true)
.Cast<PluggableWithAliases>().FirstOrDefault();
if(attribte != null)
{
foreach (var alias in attribte.Aliases)
{
aliasMap[alias] = instance.Name;
}
}
}
return aliasMap;
}
public GitTfsCommand GetCommand(string name)
{
return container.TryGetInstance<GitTfsCommand>(GetCommandName(name));
}
private string GetCommandName(string name)
{
string commandName;
return AliasMap.TryGetValue(name, out commandName) ? commandName : name;
}
public IEnumerable<string> GetAliasesForCommandName(string name)
{
return AliasMap.Where(p => p.Value == name).Select(p => p.Key);
}
}
}
using System.Collections.Generic;
using System.Linq;
using StructureMap;
namespace Sep.Git.Tfs.Util
{
[StructureMapSingleton]
public class GitTfsCommandFactory
{
private readonly IContainer container;
public GitTfsCommandFactory(IContainer container)
{
this.container = container;
}
private Dictionary<string, string> _aliasMap;
public Dictionary<string, string> AliasMap
{
get { return _aliasMap ?? (_aliasMap = CreateAliasMap()); }
}
private Dictionary<string, string> CreateAliasMap()
{
var aliasMap = new Dictionary<string, string>();
var commandPluginType = container.Model.PluginTypes.First(p => p.PluginType == typeof (GitTfsCommand));
foreach (var instance in commandPluginType.Instances)
{
var attribte = instance.ConcreteType.GetCustomAttributes(typeof (PluggableWithAliases), true)
.Cast<PluggableWithAliases>().FirstOrDefault();
if(attribte != null)
{
foreach (var alias in attribte.Aliases)
{
aliasMap[alias] = instance.Name;
}
}
}
return aliasMap;
}
public GitTfsCommand GetCommand(string name)
{
return container.TryGetInstance<GitTfsCommand>(GetCommandName(name));
}
private string GetCommandName(string name)
{
string commandName;
return AliasMap.TryGetValue(name, out commandName) ? commandName : name;
}
public IEnumerable<string> GetAliasesForCommandName(string name)
{
return AliasMap.Where(p => p.Value == name).Select(p => p.Key);
}
}
}
+15 -15
View File
@@ -1,15 +1,15 @@
using StructureMap;
namespace Sep.Git.Tfs.Util
{
public class PluggableWithAliases : PluggableAttribute
{
public readonly string[] Aliases;
public PluggableWithAliases(string concreteKey, params string[] aliases)
: base(concreteKey)
{
Aliases = aliases;
}
}
}
using StructureMap;
namespace Sep.Git.Tfs.Util
{
public class PluggableWithAliases : PluggableAttribute
{
public readonly string[] Aliases;
public PluggableWithAliases(string concreteKey, params string[] aliases)
: base(concreteKey)
{
Aliases = aliases;
}
}
}
+109 -109
View File
@@ -1,116 +1,116 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{7C7FEA7A-24A1-4834-9815-1DF980C340F3}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Sep.Git.Tfs</RootNamespace>
<AssemblyName>GitTfsBenchmarks</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="GitSharp.Core, Version=0.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\GitSharp-0.3\GitSharp.Core.dll</HintPath>
</Reference>
<Reference Include="StructureMap, Version=2.6.1.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\StructureMap\StructureMap.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Benchmark.cs" />
<Compile Include="Benchmarks\HashAndInsertObject.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GitTfs\GitTfs.csproj">
<Project>{55C169E0-93CC-488C-9885-1D4EAF4EA236}</Project>
<Name>GitTfs</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{7C7FEA7A-24A1-4834-9815-1DF980C340F3}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Sep.Git.Tfs</RootNamespace>
<AssemblyName>GitTfsBenchmarks</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="GitSharp.Core, Version=0.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\GitSharp-0.3\GitSharp.Core.dll</HintPath>
</Reference>
<Reference Include="StructureMap, Version=2.6.1.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\StructureMap\StructureMap.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Benchmark.cs" />
<Compile Include="Benchmarks\HashAndInsertObject.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GitTfs\GitTfs.csproj">
<Project>{55C169E0-93CC-488C-9885-1D4EAF4EA236}</Project>
<Name>GitTfs</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
-->
</Project>
+114 -114
View File
@@ -1,121 +1,121 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{B2BF1C1C-BB58-4DEF-BFEF-DE0D2FE2E8F7}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>GitTfsTest.Vs2010</RootNamespace>
<AssemblyName>GitTfsTest.Vs2010</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.TeamFoundation.VersionControl.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Rhino.Mocks, Version=3.5.0.1337, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\StructureMap\Rhino.Mocks.dll</HintPath>
</Reference>
<Reference Include="StructureMap.AutoMocking, Version=2.5.3.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\StructureMap\StructureMap.AutoMocking.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="TfsApiBridgeTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GitTfs.Vs2010\GitTfs.Vs2010.csproj">
<Project>{C5A374D3-A2E1-407C-9D6D-541FDB53BD62}</Project>
<Name>GitTfs.Vs2010</Name>
</ProjectReference>
<ProjectReference Include="..\GitTfs\GitTfs.csproj">
<Project>{55C169E0-93CC-488C-9885-1D4EAF4EA236}</Project>
<Name>GitTfs</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{B2BF1C1C-BB58-4DEF-BFEF-DE0D2FE2E8F7}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>GitTfsTest.Vs2010</RootNamespace>
<AssemblyName>GitTfsTest.Vs2010</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.TeamFoundation.VersionControl.Client, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Rhino.Mocks, Version=3.5.0.1337, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\StructureMap\Rhino.Mocks.dll</HintPath>
</Reference>
<Reference Include="StructureMap.AutoMocking, Version=2.5.3.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\StructureMap\StructureMap.AutoMocking.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="TfsApiBridgeTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GitTfs.Vs2010\GitTfs.Vs2010.csproj">
<Project>{C5A374D3-A2E1-407C-9D6D-541FDB53BD62}</Project>
<Name>GitTfs.Vs2010</Name>
</ProjectReference>
<ProjectReference Include="..\GitTfs\GitTfs.csproj">
<Project>{55C169E0-93CC-488C-9885-1D4EAF4EA236}</Project>
<Name>GitTfs</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
-->
</Project>
+3 -3
View File
@@ -156,9 +156,9 @@ namespace Sep.Git.Tfs.Test.Commands
private TfsChangesetInfo ChangesetForRemote(string remoteId)
{
var mockRemote = mocks.AddAdditionalMockFor<IGitTfsRemote>();
mockRemote.Stub(x => x.Id).Return(remoteId);
return new TfsChangesetInfo() {Remote = mockRemote};
var mockRemote = mocks.AddAdditionalMockFor<IGitTfsRemote>();
mockRemote.Stub(x => x.Id).Return(remoteId);
return new TfsChangesetInfo() {Remote = mockRemote};
}
private void WireUpMockRemote()
+133 -133
View File
@@ -1,140 +1,140 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{DDFB4746-2BCE-4B34-8E45-056324CF140D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Sep.Git.Tfs.Test</RootNamespace>
<AssemblyName>GitTfsTest</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="CSharpOptParse, Version=1.0.1.0, Culture=neutral, PublicKeyToken=fc987de5fe9f6e83">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\CSharpOptParse\CSharpOptParse.dll</HintPath>
</Reference>
<Reference Include="GitSharp.Core, Version=0.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\GitSharp-0.3\GitSharp.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TeamFoundation, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation.VersionControl.Client, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.VersionControl.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Rhino.Mocks, Version=3.5.0.1337, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\StructureMap\Rhino.Mocks.dll</HintPath>
</Reference>
<Reference Include="StructureMap, Version=2.5.3.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\StructureMap\StructureMap.dll</HintPath>
</Reference>
<Reference Include="StructureMap.AutoMocking, Version=2.5.3.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\StructureMap\StructureMap.AutoMocking.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Commands\HelpTest.cs" />
<Compile Include="Commands\ShelveTest.cs" />
<Compile Include="Core\DelimitedReaderTests.cs" />
<Compile Include="Core\ExtTests.cs" />
<Compile Include="Core\GitChangeInfoTests.cs" />
<Compile Include="Core\GitTfsRemoteTests.cs" />
<Compile Include="Core\ModeTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestHelpers\ExtensionMethods.cs" />
<Compile Include="Util\GitTfsCommandRunnerTests.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GitTfs\GitTfs.csproj">
<Project>{55C169E0-93CC-488C-9885-1D4EAF4EA236}</Project>
<Name>GitTfs</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.0">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{DDFB4746-2BCE-4B34-8E45-056324CF140D}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Sep.Git.Tfs.Test</RootNamespace>
<AssemblyName>GitTfsTest</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="CSharpOptParse, Version=1.0.1.0, Culture=neutral, PublicKeyToken=fc987de5fe9f6e83">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\CSharpOptParse\CSharpOptParse.dll</HintPath>
</Reference>
<Reference Include="GitSharp.Core, Version=0.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\GitSharp-0.3\GitSharp.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.TeamFoundation, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.TeamFoundation.VersionControl.Client, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.VersionControl.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Rhino.Mocks, Version=3.5.0.1337, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\StructureMap\Rhino.Mocks.dll</HintPath>
</Reference>
<Reference Include="StructureMap, Version=2.5.3.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\StructureMap\StructureMap.dll</HintPath>
</Reference>
<Reference Include="StructureMap.AutoMocking, Version=2.5.3.0, Culture=neutral, PublicKeyToken=e60ad81abae3c223, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\StructureMap\StructureMap.AutoMocking.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Commands\HelpTest.cs" />
<Compile Include="Commands\ShelveTest.cs" />
<Compile Include="Core\DelimitedReaderTests.cs" />
<Compile Include="Core\ExtTests.cs" />
<Compile Include="Core\GitChangeInfoTests.cs" />
<Compile Include="Core\GitTfsRemoteTests.cs" />
<Compile Include="Core\ModeTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestHelpers\ExtensionMethods.cs" />
<Compile Include="Util\GitTfsCommandRunnerTests.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GitTfs\GitTfs.csproj">
<Project>{55C169E0-93CC-488C-9885-1D4EAF4EA236}</Project>
<Name>GitTfs</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.0">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
-->
</Project>
+4 -4
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<TestRunConfiguration name="Local Test Run" id="5655a60c-4b6a-4d38-b593-3d93e2d5c1a2" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description>This is a default test run configuration for a local test run.</Description>
<TestTypeSpecific />
<?xml version="1.0" encoding="utf-8"?>
<TestRunConfiguration name="Local Test Run" id="5655a60c-4b6a-4d38-b593-3d93e2d5c1a2" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description>This is a default test run configuration for a local test run.</Description>
<TestTypeSpecific />
</TestRunConfiguration>
+35 -35
View File
@@ -1,35 +1,35 @@
git-tfs is a two-way bridge between TFS and git, similar to git-svn.
To use, you need to get the source, build it, and then fetch from TFS to
git.
git-tfs was developed using .NET 3.5 and VS 2008. It uses the TFS 2008
client libraries. All other dependencies are stored in the repository.
From the root directory of the repository, you should be able to run this:
> msbuild GitTfs.sln
To fetch, you can do this:
# git init (optional)
# git tfs init http://tfs:8080 $/some_project
# git tfs fetch
If you do "git tfs clone" instead of "git tfs init", you won't need to do
the initial fetch.
If you do "git tfs quick-clone" instead of "git tfs clone", git-tfs won't
pull all the history from TFS. This is intended for developer private
branches. "git tfs fetch" should still work, but you won't want to
push/pull from other repositories that were independently cloned with
git-tfs.
The shelve command replicates your changes in a shelveset in TFS. By default,
it will shelve the current HEAD.
# git tfs shelve SOME_SHELVESET
# git tfs shelve SOME_SHELVESET some-treeish
Help is available on the command line. Use "-h" with any command to see a
description of the relevant options.
I've only tried it out with the TFS 2008 client libraries. I intend to
make this work transparently with TFS 2005 or the codeplex client libs at
some point.
git-tfs is a two-way bridge between TFS and git, similar to git-svn.
To use, you need to get the source, build it, and then fetch from TFS to
git.
git-tfs was developed using .NET 3.5 and VS 2008. It uses the TFS 2008
client libraries. All other dependencies are stored in the repository.
From the root directory of the repository, you should be able to run this:
> msbuild GitTfs.sln
To fetch, you can do this:
# git init (optional)
# git tfs init http://tfs:8080 $/some_project
# git tfs fetch
If you do "git tfs clone" instead of "git tfs init", you won't need to do
the initial fetch.
If you do "git tfs quick-clone" instead of "git tfs clone", git-tfs won't
pull all the history from TFS. This is intended for developer private
branches. "git tfs fetch" should still work, but you won't want to
push/pull from other repositories that were independently cloned with
git-tfs.
The shelve command replicates your changes in a shelveset in TFS. By default,
it will shelve the current HEAD.
# git tfs shelve SOME_SHELVESET
# git tfs shelve SOME_SHELVESET some-treeish
Help is available on the command line. Use "-h" with any command to see a
description of the relevant options.
I've only tried it out with the TFS 2008 client libraries. I intend to
make this work transparently with TFS 2005 or the codeplex client libs at
some point.