Skip to content

Commit

Permalink
Revert whitespace changes so I can focus on what actually changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
spraints committed Feb 1, 2013
1 parent e4f3026 commit 5461cb8
Showing 1 changed file with 15 additions and 34 deletions.
49 changes: 15 additions & 34 deletions GitTfs.VsCommon/TfsHelper.PostVs2010.Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,27 @@ namespace Sep.Git.Tfs.VsCommon
{
public abstract class TfsHelperVs2010Base : TfsHelperBase
{
private TfsApiBridge _bridge;
TfsApiBridge _bridge;

public TfsHelperVs2010Base(TextWriter stdout, TfsApiBridge bridge, IContainer container)
: base(stdout, bridge, container)
{
_bridge = bridge;
}

public override bool CanGetBranchInformation
{
get { return true; }
}
public override bool CanGetBranchInformation { get { return true; } }

public override IEnumerable<string> GetAllTfsRootBranchesOrderedByCreation()
{
return VersionControl.QueryRootBranchObjects(RecursionType.Full)
.Where(b => b.Properties.ParentBranch == null)
.Select(b => b.Properties.RootItem.Item);
.Where(b => b.Properties.ParentBranch == null)
.Select(b => b.Properties.RootItem.Item);
}

public override IEnumerable<IBranchObject> GetBranches()
{
var branches = VersionControl.QueryRootBranchObjects(RecursionType.Full)
.Where(b => b.Properties.RootItem.IsDeleted == false);
.Where(b => b.Properties.RootItem.IsDeleted == false);
return _bridge.Wrap<WrapperForBranchObject, BranchObject>(branches);
}

Expand All @@ -55,35 +52,20 @@ public override int GetRootChangesetForBranch(string tfsPathBranchToCreate, stri
tfsPathParentBranch = tfsBranchToCreate.Properties.ParentBranch.Item;
Trace.WriteLine("Found parent branch : " + tfsPathParentBranch);

int firstChangesetIdOfParentBranch =
((ChangesetVersionSpec) tfsBranchToCreate.Properties.ParentBranch.Version).ChangesetId;

var firstChangesetInBranchToCreate = VersionControl.QueryHistory(
tfsPathBranchToCreate,
VersionSpec.Latest,
0,
RecursionType.Full,
null,
null,
null,
int.MaxValue,
true,
false,
false)
.Cast<Changeset>()
.LastOrDefault();
int firstChangesetIdOfParentBranch = ((ChangesetVersionSpec)tfsBranchToCreate.Properties.ParentBranch.Version).ChangesetId;

var firstChangesetInBranchToCreate = VersionControl.QueryHistory(tfsPathBranchToCreate, VersionSpec.Latest, 0, RecursionType.Full,
null, null, null, int.MaxValue, true, false, false).Cast<Changeset>().LastOrDefault();

if (firstChangesetInBranchToCreate == null)
{
throw new GitTfsException(
"An unexpected error occured when trying to find the root changeset.\nFailed to find first changeset for " +
tfsPathBranchToCreate);
throw new GitTfsException("An unexpected error occured when trying to find the root changeset.\nFailed to find first changeset for " + tfsPathBranchToCreate);
}

var mergedItemsToFirstChangesetInBranchToCreate = VersionControl.TrackMerges(
new int[] {firstChangesetInBranchToCreate.ChangesetId},
var mergedItemsToFirstChangesetInBranchToCreate = VersionControl
.TrackMerges(new int[] {firstChangesetInBranchToCreate.ChangesetId},
new ItemIdentifier(tfsPathBranchToCreate),
new ItemIdentifier[] {new ItemIdentifier(tfsPathParentBranch)},
new ItemIdentifier[] {new ItemIdentifier(tfsPathParentBranch),},
null)
.OrderBy(x => x.SourceChangeset.ChangesetId);

Expand Down Expand Up @@ -115,9 +97,7 @@ private static ChangesetSummary GetRelevantChangesetBasedOnChangeType(IEnumerabl

if (merge == null)
{
throw new GitTfsException(
"An unexpected error occured when trying to find the root changeset.\nFailed to find root changeset for " +
tfsPathBranchToCreate + " branch in " + tfsPathParentBranch + " branch");
throw new GitTfsException("An unexpected error occured when trying to find the root changeset.\nFailed to find root changeset for " + tfsPathBranchToCreate + " branch in " + tfsPathParentBranch + " branch");
}

switch (merge.SourceItem.ChangeType)
Expand All @@ -141,4 +121,5 @@ private static ChangesetSummary GetRelevantChangesetBasedOnChangeType(IEnumerabl
}
}
}

}

0 comments on commit 5461cb8

Please sign in to comment.