Example #1
0
        public bool Execute(string workingCopyBase,
                            Entities.Branch source,
                            Entities.Branch target,
                            List<Entities.RevisionRange> ranges)
        {
            Dictionary<string, string> settings = settingsBLL.Get();

            string userName = SettingsHelper.ValidateUsername(settings);
            string password = SettingsHelper.ValidatePassword(settings);

            string workingCopyPath = target.Path(workingCopyBase);

            using (SharpSvn.SvnClient client = BusinessLogic.VersionControl.Svn.ClientHelper.Default())
            {
                client.Authentication.DefaultCredentials = new System.Net.NetworkCredential(userName, password);

                SharpSvn.SvnUriTarget svnSource = new SharpSvn.SvnUriTarget(source.Url);
                checkoutBLL.Execute(target, workingCopyBase);
                revertBLL.Execute(target, workingCopyBase);
                updateBLL.Execute(target, workingCopyBase);

                client.Conflict += (object sender, SharpSvn.SvnConflictEventArgs e) =>
                {
                    this.successful = false;
                };

                List<Entities.RevisionRange> conflictedRanges = new List<RevisionRange>();

                SharpSvn.SvnMergeArgs args = new SharpSvn.SvnMergeArgs();

                foreach (var item in ranges.OrderBy(x => x.StartRevision))
                {
                    bool success = client.Merge(workingCopyPath, svnSource, new SharpSvn.SvnRevisionRange(Convert.ToInt64(item.StartRevision), Convert.ToInt64(item.EndRevision)), args);

                    if (!this.successful)
                    {
                        revertBLL.Execute(target, workingCopyBase);
                        break;
                    }
                }
            }

            return successful;
        }
Example #2
0
        public void Execute(string workingCopyBase, Entities.Branch branch, string logMessage)
        {
            Dictionary<string, string> settings = settingsBLL.Get();

            string userName = SettingsHelper.ValidateUsername(settings);
            string password = SettingsHelper.ValidatePassword(settings);

            string workingCopyPath = branch.Path(workingCopyBase);

            using (SharpSvn.SvnClient client = BusinessLogic.VersionControl.Svn.ClientHelper.Default())
            {
                client.Authentication.DefaultCredentials = new System.Net.NetworkCredential(userName, password);

                SharpSvn.SvnCommitArgs args = new SharpSvn.SvnCommitArgs();
                args.LogMessage = logMessage;

                client.Commit(workingCopyPath, args);
            }
        }
Example #3
0
        public void Execute(Entities.Branch branch, string workingCopyBase)
        {
            Dictionary<string, string> settings = settingsBLL.Get();

            string userName = SettingsHelper.ValidateUsername(settings);
            string password = SettingsHelper.ValidatePassword(settings);

            string workingCopyPath = branch.Path(workingCopyBase);

            if (!System.IO.Directory.Exists(workingCopyPath))
            {
                using (SharpSvn.SvnClient client = BusinessLogic.VersionControl.Svn.ClientHelper.Default())
                {
                    client.Authentication.DefaultCredentials = new System.Net.NetworkCredential(userName, password);

                    SharpSvn.SvnUriTarget repo = new SharpSvn.SvnUriTarget(branch.Url);

                    client.CheckOut(repo, workingCopyPath);
                }
            }
        }
Example #4
0
        public void Execute(Entities.Branch branch, string workingCopyBase)
        {
            Dictionary<string, string> settings = settingsBLL.Get();

            string userName = SettingsHelper.ValidateUsername(settings);
            string password = SettingsHelper.ValidatePassword(settings);

            string workingCopyPath = branch.Path(workingCopyBase);

            if (System.IO.Directory.Exists(workingCopyPath))
            {
                using (SharpSvn.SvnClient client = BusinessLogic.VersionControl.Svn.ClientHelper.Default())
                {
                    client.Authentication.DefaultCredentials = new System.Net.NetworkCredential(userName, password);

                    SharpSvn.SvnRevertArgs args = new SharpSvn.SvnRevertArgs();
                    args.Depth = SharpSvn.SvnDepth.Infinity;

                    client.Revert(workingCopyPath, args);
                }
            }
        }
Example #5
0
        public bool Execute(Entities.Branch branch, string workingCopyBase)
        {
            bool updated = false;

            Dictionary<string, string> settings = settingsBLL.Get();

            string userName = SettingsHelper.ValidateUsername(settings);
            string password = SettingsHelper.ValidatePassword(settings);

            string workingCopyPath = branch.Path(workingCopyBase);

            if (System.IO.Directory.Exists(workingCopyPath))
            {
                using (SharpSvn.SvnClient client = BusinessLogic.VersionControl.Svn.ClientHelper.Default())
                {
                    client.Authentication.DefaultCredentials = new System.Net.NetworkCredential(userName, password);

                    updated = client.Update(workingCopyPath);
                }
            }

            return updated;
        }