예제 #1
0
 private void LoadRepoSettings()
 {
     Invoke((MethodInvoker) delegate
     {
         IVcsWrapper vcsWrapper = outDirTextBox.Text.Length > 0 ? CreateVcsWrapper(Encoding.Default) : null;
         backgroundQueue.AddLast(delegate
         {
             continueAfter = vcsWrapper != null ? vcsWrapper.GetLastCommit() : null;
             Invoke((MethodInvoker) delegate
             {
                 if (continueAfter == null)
                 {
                     if (continueSyncCheckBox.Checked)
                     {
                         resetRepoCheckBox.Checked = true;
                     }
                     continueSyncCheckBox.Enabled = continueSyncCheckBox.Checked = false;
                 }
                 else
                 {
                     resetRepoCheckBox.Checked    = false;
                     continueSyncCheckBox.Enabled = true;
                     continueSyncCheckBox.Checked = true;
                     continueSyncCheckBox.Text    = "Continue sync from " + continueAfter;
                 }
             });
         });
     });
 }
예제 #2
0
        private void DumpUsers()
        {
            var        df   = new VssDatabaseFactory(vssDirTextBox.Text);
            var        db   = df.Open();
            var        path = vssProjectTextBox.Text;
            VssProject project;

            try
            {
                project = db.GetItem(path) as VssProject;
            }
            catch (VssPathException ex)
            {
                MessageBox.Show(ex.Message, "Invalid project path",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (project == null)
            {
                MessageBox.Show(path + " is not a project", "Invalid project path",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            var emailDictionary = ReadDictionaryFile("e-mail dictionary", db.BasePath, emailPropertiesFileName);

            AdvancedTaskbar.EnableItermediate();
            this.statusTimer.Enabled = true;
            this.emailMap.Enabled    = false;
            this.goButton.Enabled    = false;
            this.cancelButton.Text   = "Cancel";
            revisionAnalyzer         = new RevisionAnalyzer(workQueue, logger, db);
            if (!string.IsNullOrEmpty(excludeTextBox.Text))
            {
                revisionAnalyzer.ExcludeFiles = excludeTextBox.Text;
            }
            revisionAnalyzer.AddItem(project);
            workQueue.AddLast(delegate(object work)
            {
                foreach (var dateEntry in revisionAnalyzer.SortedRevisions)
                {
                    foreach (Revision revision in dateEntry.Value)
                    {
                        var user = revision.User.ToLower();
                        if (emailDictionary.ContainsKey(user))
                        {
                            continue;
                        }
                        emailDictionary.Add(user, "");
                    }
                }
                string propsPath = Path.Combine(db.BasePath, emailPropertiesFileName);
                WriteDictionaryFile(emailDictionary, propsPath);
                this.BeginInvoke((MethodInvoker) delegate
                {
                    MessageBox.Show(this, string.Format(emailUserNamesListMessage, propsPath),
                                    emailUserNamesListCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
                });
            });
        }
예제 #3
0
        private void DumpUsers()
        {
            var        df   = new VssDatabaseFactory(vssDirTextBox.Text);
            var        db   = df.Open();
            var        path = vssProjectTextBox.Text;
            VssProject project;

            try
            {
                project = db.GetItem(path) as VssProject;
            }
            catch (VssPathException ex)
            {
                MessageBox.Show(ex.Message, "Invalid project path",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (project == null)
            {
                MessageBox.Show(path + " is not a project", "Invalid project path",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            var emailDictionary = ReadDictionaryFile("e-mail dictionary", db.BasePath, "emails.properties");

            revisionAnalyzer = new RevisionAnalyzer(workQueue, logger, db);
            if (!string.IsNullOrEmpty(excludeTextBox.Text))
            {
                revisionAnalyzer.ExcludeFiles = excludeTextBox.Text;
            }
            revisionAnalyzer.AddItem(project);
            workQueue.AddLast(delegate(object work)
            {
                foreach (var dateEntry in revisionAnalyzer.SortedRevisions)
                {
                    foreach (Revision revision in dateEntry.Value)
                    {
                        var user = revision.User.ToLower();
                        if (emailDictionary.ContainsKey(user))
                        {
                            continue;
                        }
                        emailDictionary.Add(user, "");
                    }
                }
                string propsPath = db.BasePath + Path.DirectorySeparatorChar + "emails.properties";
                WriteDictionaryFile(emailDictionary, propsPath);
                MessageBox.Show("The list of usernames is written to:\n\n"
                                + propsPath + "\n\n"
                                + "Please edit it and fill in email addresses in the form:\n\n"
                                + "username = Full Name <e-mail>\n\nor\n\nusername = e-mail", "User-email mapping",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
            });
        }