Ejemplo n.º 1
0
        private void Bgw_DoPush(object sender, DoWorkEventArgs e)
        {
            Destination = metroFromTextBox.Text;
            Parameters parameters;

            parameters = new Parameters()
            {
                Cleanup           = true,
                Command           = Command.CompleteSync,
                DeleteUnversioned = true,
                Message           = "Adding new directory for my project",
                Mkdir             = true,
                Password          = metroPasswordTextBox.Text != "" ? metroPasswordTextBox.Text : null,
                Path                     = Destination,
                Revert                   = false,
                TrustServerCert          = true,
                UpdateBeforeCompleteSync = false,
                Url      = metroLabelRepoUrl.Text,
                Username = metroUserNameTextBox.Text == "" ? null : metroUserNameTextBox.Text,
                Verbose  = true,
            };
            try
            {
                SvnUtils.CompleteSync(parameters);
            }
            catch (Exception ex) {
                MessageBox.Show("SVNerro\n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            //Temp temp = new Temp();
            //string d = temp.GetTemporaryDirectory();
            //parameters = new Parameters()
            //{
            //    Cleanup = true,
            //    Command = Command.CompleteSync,
            //    DeleteUnversioned = true,
            //    Message = "Adding new directory for my project",
            //    Mkdir = true,
            //    Password = metroPasswordTextBox.Text != "" ? metroPasswordTextBox.Text : null,
            //    Path = Destination,
            //    Revert = true,
            //    TrustServerCert = true,
            //    UpdateBeforeCompleteSync = true,
            //    Url = metroLabelRepoUrl.Text,
            //    Username = metroUserNameTextBox.Text == "" ? null : metroUserNameTextBox.Text,
            //    Verbose = true,

            //};
            //SvnUtils.CompleteSync(parameters);
            //CloneDirectory(Path.Combine(d, ".svn"), Path.Combine(Destination, ".svn"));

            ////Temp.CloneDirectory(d + "/.svn", Destination + "/.svn");

            //parameters.Path = Destination;
            //parameters.Command = Command.CompleteSync;
            //SvnUtils.CompleteSync(parameters);
            //DeleteDirectory(d);
        }
Ejemplo n.º 2
0
        private void Bgw_DoClone(object sender, DoWorkEventArgs e)
        {
            Destination = Path.Combine(metroDestinationTextBox.Text);
            Temp       temp       = new();
            string     d          = temp.GetTemporaryDirectory();
            Parameters parameters = new()
            {
                Cleanup           = true,
                Command           = Command.CheckoutUpdate,
                DeleteUnversioned = true,
                Message           = "Adding new directory for my project",
                Mkdir             = true,
                Password          = metroPasswordTextBox.Text != "" ? metroPasswordTextBox.Text : null,
                Path                     = d,
                Revert                   = true,
                TrustServerCert          = true,
                UpdateBeforeCompleteSync = true,
                Url      = metroLabelRepoUrl.Text,
                Username = metroUserNameTextBox.Text == "" ? null : metroUserNameTextBox.Text,
                Verbose  = true,
            };

            try
            {
                SvnUtils.CheckoutUpdate(parameters);
                CloneDirectory(Path.Combine(d, ".svn"), Path.Combine(Destination, ".svn"));
                File.SetAttributes(Path.Combine(Destination, ".svn"), File.GetAttributes(Path.Combine(Destination, ".svn")) | FileAttributes.Hidden);

                parameters.Path    = Destination;
                parameters.Command = Command.CompleteSync;
                SvnUtils.CompleteSync(parameters);
                DeleteDirectory(d);
            }
            catch (Exception ex) {
                MessageBox.Show("SVNerro\n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }