예제 #1
1
 public GitTfsRemote(RemoteOptions remoteOptions, Globals globals, ITfsHelper tfsHelper, TextWriter stdout)
 {
     this.remoteOptions = remoteOptions;
     this.globals = globals;
     this.stdout = stdout;
     Tfs = tfsHelper;
 }
예제 #2
0
 public Bootstrap(RemoteOptions remoteOptions, Globals globals, TextWriter stdout, Bootstrapper bootstrapper)
 {
     _remoteOptions = remoteOptions;
     _globals = globals;
     _stdout = stdout;
     _bootstrapper = bootstrapper;
 }
예제 #3
0
파일: Subtree.cs 프로젝트: pmiossec/git-tfs
 public Subtree(Fetch fetch, QuickFetch quickFetch, Globals globals, RemoteOptions remoteOptions)
 {
     _fetch = fetch;
     _quickFetch = quickFetch;
     _globals = globals;
     _remoteOptions = remoteOptions;
 }
예제 #4
0
파일: Fetch.cs 프로젝트: runt18/git-tfs
 public Fetch(Globals globals, RemoteOptions remoteOptions, AuthorsFile authors, Labels labels)
 {
     this.remoteOptions = remoteOptions;
     this.globals = globals;
     this.authors = authors;
     this.labels = labels;
 }
예제 #5
0
파일: Create.cs 프로젝트: patthoyts/git-tfs
 public Create(ITfsHelper tfsHelper, Clone clone, RemoteOptions remoteOptions, TextWriter stdout)
 {
     _stdout = stdout;
     _tfsHelper = tfsHelper;
     _clone = clone;
     _remoteOptions = remoteOptions;
 }
예제 #6
0
 public ListRemoteBranches(Globals globals, TextWriter stdout, ITfsHelper tfsHelper, RemoteOptions remoteOptions)
 {
     this.globals = globals;
     this.stdout = stdout;
     this.tfsHelper = tfsHelper;
     this.remoteOptions = remoteOptions;
 }
예제 #7
0
 public GitTfsRemote(RemoteOptions remoteOptions, Globals globals, ITfsHelper tfsHelper, TextWriter stdout)
 {
     this.remoteOptions = remoteOptions;
     this.globals = globals;
     this.stdout = stdout;
     Tfs = tfsHelper;
     _failTracker = new TfsFailTracker();
 }
예제 #8
0
파일: Init.cs 프로젝트: jsmale/git-tfs
 public Init(RemoteOptions remoteOptions, InitOptions initOptions, Globals globals, TextWriter output, IGitHelpers gitHelper)
 {
     this.remoteOptions = remoteOptions;
     this.gitHelper = gitHelper;
     this.output = output;
     this.globals = globals;
     this.initOptions = initOptions;
 }
예제 #9
0
 public Fetch(Globals globals, TextWriter stdout, RemoteOptions remoteOptions, AuthorsFile authors, Labels labels)
 {
     this.globals = globals;
     this.stdout = stdout;
     this.remoteOptions = remoteOptions;
     this.authors = authors;
     this.labels = labels;
 }
예제 #10
0
파일: Subtree.cs 프로젝트: Galilyou/git-tfs
 public Subtree(TextWriter stdout, Fetch fetch, QuickFetch quickFetch, Globals globals, RemoteOptions remoteOptions)
 {
     this._stdout = stdout;
     this._fetch = fetch;
     this._quickFetch = quickFetch;
     this._globals = globals;
     this._remoteOptions = remoteOptions;
 }
예제 #11
0
파일: Fetch.cs 프로젝트: pmiossec/git-tfs
 public Fetch(Globals globals, ConfigProperties properties, RemoteOptions remoteOptions, Labels labels)
 {
     _globals = globals;
     _properties = properties;
     _remoteOptions = remoteOptions;
     _labels = labels;
     upToChangeSet = -1;
     BranchStrategy = BranchStrategy = BranchStrategy.Auto;
 }
예제 #12
0
 public Fetch(Globals globals, ConfigProperties properties, TextWriter stdout, RemoteOptions remoteOptions, AuthorsFile authors, Labels labels)
 {
     this.globals = globals;
     this.properties = properties;
     this.stdout = stdout;
     this.remoteOptions = remoteOptions;
     this.authors = authors;
     this.labels = labels;
     this.upToChangeSet = -1;
 }
예제 #13
0
        public GitTfsRemote(RemoteInfo info, IGitRepository repository, RemoteOptions remoteOptions, Globals globals, ITfsHelper tfsHelper, TextWriter stdout)
        {
            this.remoteOptions = remoteOptions;
            this.globals = globals;
            this.stdout = stdout;
            Tfs = tfsHelper;
            Repository = repository;

            Id = info.Id;
            TfsUrl = info.Url;
            TfsRepositoryPath = info.Repository;
            TfsUsername = info.Username;
            TfsPassword = info.Password;
            Aliases = (info.Aliases ?? Enumerable.Empty<string>()).ToArray();
            IgnoreRegexExpression = info.IgnoreRegex;
            Autotag = info.Autotag;
        }
예제 #14
0
        public void CreateTfsRemote(string remoteId, string tfsUrl, string tfsRepositoryPath, RemoteOptions remoteOptions)
        {
            if (HasRemote(remoteId))
                throw new GitTfsException("A remote with id \"" + remoteId + "\" already exists.");

            SetTfsConfig(remoteId, "url", tfsUrl);
            SetTfsConfig(remoteId, "repository", tfsRepositoryPath);
            SetTfsConfig(remoteId, "fetch", "refs/remotes/" + remoteId + "/master");
            if (remoteOptions != null)
            {
                if (remoteOptions.NoMetaData) SetTfsConfig(remoteId, "no-meta-data", 1);
                if (remoteOptions.IgnoreRegex != null) SetTfsConfig(remoteId, "ignore-paths", remoteOptions.IgnoreRegex);
            }

            Directory.CreateDirectory(Path.Combine(this.GitDir, "tfs"));
            _cachedRemotes = null;
        }
예제 #15
0
        public GitTfsRemote(RemoteInfo info, IGitRepository repository, RemoteOptions remoteOptions, Globals globals,
            ITfsHelper tfsHelper, ConfigProperties properties)
        {
            _remoteOptions = remoteOptions;
            _globals = globals;
            _properties = properties;
            Tfs = tfsHelper;
            Repository = repository;

            RemoteInfo = info;
            Id = info.Id;
            TfsUrl = info.Url;
            TfsRepositoryPath = info.Repository;
            TfsUsername = info.Username;
            TfsPassword = info.Password;
            Aliases = (info.Aliases ?? Enumerable.Empty<string>()).ToArray();
            IgnoreRegexExpression = info.IgnoreRegex;
            IgnoreExceptRegexExpression = info.IgnoreExceptRegex;

            Autotag = info.Autotag;

            IsSubtree = CheckSubtree();
        }
예제 #16
0
 public QuickFetch(Globals globals, TextWriter stdout, RemoteOptions remoteOptions, AuthorsFile authors)
     : base(globals, stdout, remoteOptions, authors, null)
 {
 }
예제 #17
0
 public ListRemoteBranches(ITfsHelper tfsHelper, RemoteOptions remoteOptions)
 {
     _tfsHelper = tfsHelper;
     _remoteOptions = remoteOptions;
 }
예제 #18
0
        private IGitTfsRemote InitTfsBranch(RemoteOptions remoteOptions, string tfsRepositoryPath, int rootChangesetId = -1, bool fetchParentBranch = false, string gitBranchNameExpected = null, IRenameResult renameResult = null)
        {
            Trace.WriteLine("Begin process of creating branch for remote :" + tfsRepositoryPath);
            // TFS string representations of repository paths do not end in trailing slashes
            tfsRepositoryPath = (tfsRepositoryPath ?? string.Empty).TrimEnd('/');

            string gitBranchName = ExtractGitBranchNameFromTfsRepositoryPath(
                string.IsNullOrWhiteSpace(gitBranchNameExpected) ? tfsRepositoryPath : gitBranchNameExpected);
            if (string.IsNullOrWhiteSpace(gitBranchName))
                throw new GitTfsException("error: The Git branch name '" + gitBranchName + "' is not valid...\n");
            Trace.WriteLine("Git local branch will be :" + gitBranchName);

            string sha1RootCommit = null;
            if (rootChangesetId != -1)
            {
                sha1RootCommit = Repository.FindCommitHashByChangesetId(rootChangesetId);
                if (fetchParentBranch && string.IsNullOrWhiteSpace(sha1RootCommit))
                    sha1RootCommit = FindRootRemoteAndFetch(rootChangesetId, renameResult);
                if (string.IsNullOrWhiteSpace(sha1RootCommit))
                    return null;

                Trace.WriteLine("Found commit " + sha1RootCommit + " for changeset :" + rootChangesetId);
            }

            IGitTfsRemote tfsRemote;
            if (Repository.HasRemote(gitBranchName))
            {
                Trace.WriteLine("Remote already exist");
                tfsRemote = Repository.ReadTfsRemote(gitBranchName);
                if (tfsRemote.TfsUrl != TfsUrl)
                    Trace.WriteLine("warning: Url is different");
                if (tfsRemote.TfsRepositoryPath != tfsRepositoryPath)
                    Trace.WriteLine("warning: TFS repository path is different");
            }
            else
            {
                Trace.WriteLine("Try creating remote...");
                tfsRemote = Repository.CreateTfsRemote(new RemoteInfo
                {
                    Id = gitBranchName,
                    Url = TfsUrl,
                    Repository = tfsRepositoryPath,
                    RemoteOptions = remoteOptions
                }, string.Empty);
            }
            if (sha1RootCommit != null && !Repository.HasRef(tfsRemote.RemoteRef))
            {
                if (!Repository.CreateBranch(tfsRemote.RemoteRef, sha1RootCommit))
                    throw new GitTfsException("error: Fail to create remote branch ref file!");
            }
            Trace.WriteLine("Remote created!");
            return tfsRemote;
        }
예제 #19
0
 public ListRemoteBranches(ITfsHelper tfsHelper, RemoteOptions remoteOptions)
 {
     _tfsHelper     = tfsHelper;
     _remoteOptions = remoteOptions;
 }
예제 #20
0
 public QuickFetch(Globals globals, RemoteOptions remoteOptions, AuthorsFile authors) : base(globals, remoteOptions, authors, null)
 {
 }
예제 #21
0
 public IGitTfsRemote InitBranch(RemoteOptions remoteOptions, string tfsRepositoryPath, int shaRootChangesetId, bool fetchParentBranch, string gitBranchNameExpected = null, IRenameResult renameResult = null)
 {
     throw new NotImplementedException();
 }
예제 #22
0
 public Bootstrap(RemoteOptions remoteOptions, Globals globals, TextWriter stdout)
 {
     _remoteOptions = remoteOptions;
     _globals = globals;
     _stdout = stdout;
 }
예제 #23
0
파일: Bootstrap.cs 프로젝트: upzone/git-tfs
 public Bootstrap(RemoteOptions remoteOptions, Globals globals, Bootstrapper bootstrapper)
 {
     _remoteOptions = remoteOptions;
     _globals       = globals;
     _bootstrapper  = bootstrapper;
 }
예제 #24
0
파일: Init.cs 프로젝트: pmiossec/git-tfs
 public Init(RemoteOptions remoteOptions, InitOptions initOptions, Globals globals, IGitHelpers gitHelper)
 {
     _remoteOptions = remoteOptions;
     _gitHelper = gitHelper;
     _globals = globals;
     _initOptions = initOptions;
 }
예제 #25
0
 public ListRemoteBranches(Globals globals, TextWriter stdout, ITfsHelper tfsHelper, RemoteOptions remoteOptions)
 {
     this.globals       = globals;
     this.stdout        = stdout;
     this.tfsHelper     = tfsHelper;
     this.remoteOptions = remoteOptions;
 }
예제 #26
0
 public Bootstrapper(Globals globals, RemoteOptions remoteOptions)
 {
     _globals = globals;
     _remoteOptions = remoteOptions;
 }
예제 #27
0
 public QuickFetch(Globals globals, TextWriter stdout, RemoteOptions remoteOptions, AuthorsFile authors)
     : base(globals, stdout, remoteOptions, authors, null)
 {
 }
예제 #28
0
파일: Fetch.cs 프로젝트: qnrckd/git-tfs
 public Fetch(Globals globals, ConfigProperties properties, TextWriter stdout, RemoteOptions remoteOptions, AuthorsFile authors, Labels labels)
 {
     this.globals       = globals;
     this.properties    = properties;
     this.stdout        = stdout;
     this.remoteOptions = remoteOptions;
     this.authors       = authors;
     this.labels        = labels;
 }
예제 #29
0
 public QuickFetch(Globals globals, ConfigProperties properties, RemoteOptions remoteOptions, AuthorsFile authors)
     : base(globals, properties, remoteOptions, authors, null)
 {
     _properties = properties;
 }
예제 #30
0
 public Subtree(TextWriter stdout, Fetch fetch, QuickFetch quickFetch, Globals globals, RemoteOptions remoteOptions)
 {
     this._stdout        = stdout;
     this._fetch         = fetch;
     this._quickFetch    = quickFetch;
     this._globals       = globals;
     this._remoteOptions = remoteOptions;
 }
예제 #31
0
 public void CreateTfsRemote(string remoteId, TfsChangesetInfo tfsHead, RemoteOptions remoteOptions)
 {
     CreateTfsRemote(remoteId, tfsHead.Remote.TfsUrl, tfsHead.Remote.TfsRepositoryPath, remoteOptions);
     ReadTfsRemote(remoteId).UpdateRef(tfsHead.GitCommit, tfsHead.ChangesetId);
 }
예제 #32
0
        private IGitTfsRemote InitFromDefaultRemote()
        {
            IGitTfsRemote defaultRemote;
            if (_globals.Repository.HasRemote(GitTfsConstants.DefaultRepositoryId))
                defaultRemote = _globals.Repository.ReadTfsRemote(GitTfsConstants.DefaultRepositoryId);
            else
                defaultRemote = _globals.Repository.ReadAllTfsRemotes()
                    .Where(x => x != null && x.RemoteInfo != null && !string.IsNullOrEmpty(x.RemoteInfo.Url))
                    .OrderBy(x => x.RemoteInfo.Url.Length).FirstOrDefault();
            if (defaultRemote == null)
                throw new GitTfsException("error: No git-tfs repository found. Please try to clone first...\n");

            _remoteOptions = new RemoteOptions();
            if (!string.IsNullOrWhiteSpace(TfsUsername))
            {
                _remoteOptions.Username = TfsUsername;
                _remoteOptions.Password = TfsPassword;
            }
            else
            {
                _remoteOptions.Username = defaultRemote.TfsUsername;
                _remoteOptions.Password = defaultRemote.TfsPassword;
            }

            if (IgnoreRegex != null)
                _remoteOptions.IgnoreRegex = IgnoreRegex;
            else
                _remoteOptions.IgnoreRegex = defaultRemote.IgnoreRegexExpression;

            if (ExceptRegex != null)
                _remoteOptions.ExceptRegex = ExceptRegex;
            else
                _remoteOptions.ExceptRegex = defaultRemote.IgnoreExceptRegexExpression;

            return defaultRemote;
        }
예제 #33
0
 public Bootstrap(RemoteOptions remoteOptions, Globals globals, TextWriter stdout)
 {
     _remoteOptions = remoteOptions;
     _globals       = globals;
     _stdout        = stdout;
 }
예제 #34
0
 public Fetch(Globals globals, RemoteOptions remoteOptions, FcOptions fcOptions)
 {
     this.fcOptions     = fcOptions;
     this.remoteOptions = remoteOptions;
     this.globals       = globals;
 }
예제 #35
0
 public QuickFetch(Globals globals, RemoteOptions remoteOptions, AuthorsFile authors) : base(globals, remoteOptions, authors, null)
 {
 }
예제 #36
0
 public Bootstrapper(Globals globals, TextWriter stdout, RemoteOptions remoteOptions)
 {
     _globals = globals;
     _stdout = stdout;
     _remoteOptions = remoteOptions;
 }
예제 #37
0
파일: Create.cs 프로젝트: upzone/git-tfs
 public Create(ITfsHelper tfsHelper, Clone clone, RemoteOptions remoteOptions)
 {
     _tfsHelper     = tfsHelper;
     _clone         = clone;
     _remoteOptions = remoteOptions;
 }
예제 #38
0
 public Fetch(Globals globals, RemoteOptions remoteOptions, FcOptions fcOptions)
 {
     this.fcOptions = fcOptions;
     this.remoteOptions = remoteOptions;
     this.globals = globals;
 }
예제 #39
0
 public IGitTfsRemote InitBranch(RemoteOptions remoteOptions, string tfsRepositoryPath, int rootChangesetId, bool fetchParentBranch, string gitBranchNameExpected = null, IRenameResult renameResult = null)
 {
     return InitTfsBranch(remoteOptions, tfsRepositoryPath, rootChangesetId, fetchParentBranch, gitBranchNameExpected, renameResult);
 }
예제 #40
0
 public QuickFetch(Globals globals, RemoteOptions remoteOptions, FcOptions fcOptions) : base(globals, remoteOptions, fcOptions)
 {
 }
예제 #41
0
 public ListRemoteBranches(Globals globals, ITfsHelper tfsHelper, RemoteOptions remoteOptions)
 {
     this.globals       = globals;
     this.tfsHelper     = tfsHelper;
     this.remoteOptions = remoteOptions;
 }
예제 #42
0
 public Bootstrap(RemoteOptions remoteOptions, Globals globals, Bootstrapper bootstrapper)
 {
     _remoteOptions = remoteOptions;
     _globals = globals;
     _bootstrapper = bootstrapper;
 }
예제 #43
0
        private IGitTfsRemote InitFromDefaultRemote()
        {
            var defaultRemote = _globals.Repository.ReadTfsRemote(GitTfsConstants.DefaultRepositoryId);
            if (defaultRemote == null)
                throw new GitTfsException("error: No git-tfs repository found. Please try to clone first...\n");

            _remoteOptions = new RemoteOptions();
            if (!string.IsNullOrWhiteSpace(TfsUsername))
            {
                _remoteOptions.Username = TfsUsername;
                _remoteOptions.Password = TfsPassword;
            }
            else
            {
                _remoteOptions.Username = defaultRemote.TfsUsername;
                _remoteOptions.Password = defaultRemote.TfsPassword;
            }

            if (IgnoreRegex != null)
                _remoteOptions.IgnoreRegex = IgnoreRegex;
            else
                _remoteOptions.IgnoreRegex = defaultRemote.IgnoreRegexExpression;

            if (ExceptRegex != null)
                _remoteOptions.ExceptRegex = ExceptRegex;
            else
                _remoteOptions.ExceptRegex = defaultRemote.IgnoreExceptRegexExpression;

            _authors.Parse(AuthorsFilePath, _globals.GitDir);

            return defaultRemote;
        }
예제 #44
0
 public Fetch(Globals globals, ConfigProperties properties, TextWriter stdout, RemoteOptions remoteOptions, AuthorsFile authors, Labels labels)
 {
     this.globals       = globals;
     this.properties    = properties;
     this.stdout        = stdout;
     this.remoteOptions = remoteOptions;
     this.authors       = authors;
     this.labels        = labels;
     this.upToChangeSet = -1;
     BranchStrategy     = BranchStrategy = BranchStrategy.Auto;
 }