Created tests for comparing the tfs url, legacy urls and
the repository path with mixed case when calling git tfs fetch or
git tfs pull. Used libgit2sharp to count the commits before and after.
Added support for running commands from the project directory (git
tfs clone is called from outside the project directory).
Moving logic from TfsHelper.Common and GitRepository into GitTfsRemote.
Easier to test as TfsHelper is tightly connected to Tfs and GitRepository is
difficult to test directly. Added tests for GitTfsRemote.
Compiled for TFS Server 2008, 2010, 2012 and tested with TFS Server 2010, 2012
!! This command need that the clone of the TFS repository was made from the trunk (and not on the whole repository) and with history (not a quick-clone).
Usage for TFS 2010 and 2012 :
-------------------------------
* to clone one branch
git tfs init-branch $/Repository/path <git-branch-name-wished>
ex :
git tfs init-branch $/Repository/ProjectBranch
git tfs init-branch $/Repository/ProjectBranch myNewBranch
* to clone all branches
git tfs init-branch --all
Usage for TFS 2008 :
---------------------
* to clone one branch
git tfs init-branch--parent-branch=$/Repository/ProjectParentBranch $/Repository/path <git-branch-name-wished>
ex :
git tfs init-branch --parent-branch=$/Repository/ProjectParentBranch $/Repository/ProjectBranch
git tfs init-branch --parent-branch=$/Repository/ProjectParentBranch $/Repository/ProjectBranch myNewBranch
--AuthorsFile parameter added to the Fetch command and is registered as a singleton.
--Unit tests test the regex of the line parsing.
Updated logic around parsing the original changeset owner. This was needed to properly identify a user who had been deleted from TFS without the need for an AuthorsFile.
FindTfsCommits failed in detecting Tfs commits when parsing a
revert commit.
For instance when parsing following git log report the Tfs commit finder
failed when parsing commit 027a14b24280ca3ba24e4c1e52411de35b944442.
Failure occurred when parsing the line
This reverts commit e096daaf57d937fef3c0c639c3a59232310c6a20.
Old Regex("commit (" + GitTfsConstants.Sha1 + ")") failed by parsing this
as a start of a new commit.
Commit regex is tightened to Regex("^commit (" + Sha1 + ")\\s*$")
Added tests prove that the new Regex handles both commit topic lines
and revert commit subjects.
==================== Example git log report ====================
$ git log --no-color --pretty=medium HEAD
commit 8c7350acc9a1feffa9882badecc625129c9b8943
Merge: 027a14b fe03e90
Author: Tuomas J<C3><A4>rvensivu <tuomas.jarvensivu@reaktor.fi>
Date: Sun Sep 11 22:16:46 2011 +0300
Merge commit 'fe03e9009e46c4eb1b961578b201553eb59b11ed'
commit fe03e9009e46c4eb1b961578b201553eb59b11ed
Author: Tuomas J<C3><A4>rvensivu <tuomas.jarvensivu@reaktor.fi>
Date: Sun Sep 11 22:02:48 2011 +0300
Change on top of reverted commit
commit 027a14b24280ca3ba24e4c1e52411de35b944442
Merge: 2b9fe0c f3b25d8
Author: Administrator <WIN-R5AMS97DB6H\Administrator>
Date: Sun Sep 11 18:50:31 2011 +0000
Subject: Revert "This commit will be reverted."
Author: Tuomas J<C7><CF>rvensivu tuomas.jarvensivu@reaktor.fi
Date: Sun, 11 Sep 2011 21:45:01 +0300
Git commit hash: d5e949694e8d1442921250e0df4fb38d314dce53
This reverts commit e096daaf57d937fef3c0c639c3a59232310c6a20.
git-tfs-id: [http://localhost:8888/tfs/GitTfsTestCollection]$/GitTfsTest;C9
==================== Example git log report ====================
Signed-off-by: Tuomas Järvensivu <tuomas.jarvensivu@reaktor.fi>