Beispiel #1
0
 private void buttonCheckModifications_Click(object sender, EventArgs e)
 {
     listView1.Items.Clear();
     SvnChangeSetMaker helper = new SvnChangeSetMaker();
     string localPath = @"";
     helper.getModifiedFilesAsync(localPath, cb_progress, cb_Completed);
 }
Beispiel #2
0
 private void buttonZip_Click(object sender, EventArgs e)
 {
     SvnChangeSetMaker helper = new SvnChangeSetMaker();
     string localPath = string.Empty;
     List<string> files = helper.getModifiedFiles(localPath);
     helper.createChangeList(files,localPath, @"C:\temp\cs");
     SvnChangeSetHelper.zipChangeSetDir(@"C:\temp\cs", @"C:\temp\cs\ChangeSet.zip");
 }
 public void getFileRevisionTest()
 {
     SvnChangeSetMaker target = new SvnChangeSetMaker();
     string fileWorkingCopyPath = string.Empty;
     string filePathToWrite = string.Empty;
     string localPath = "";
     List<string> files = target.getModifiedFiles(localPath);
 }
 public void getModifiedFilePathsTest()
 {
     SvnChangeSetMaker target = new SvnChangeSetMaker(); // TODO: Initialize to an appropriate value
     string localPath = "";
     List<string> expected = null;
     List<string> actual;
     actual = target.getModifiedFiles(localPath);
     Assert.AreNotEqual(expected, actual);
 }
        public void createChangeListTest()
        {
            SvnChangeSetMaker target = new SvnChangeSetMaker(); // TODO: Initialize to an appropriate value
            string localPath = "";
            List<string> modifiedFileList;
            modifiedFileList = target.getModifiedFiles(localPath);

            string dirPath = @"C:\temp\cstest";
            string localArchivePath = localPath;
            bool expected = true;
            bool actual;
            actual = target.createChangeList(modifiedFileList, localArchivePath, dirPath);
            Assert.AreEqual(expected, actual);
        }
Beispiel #6
0
        private void getModifiedFileList()
        {
            RepoInfo selectedItem = (RepoInfo)listViewRepos.SelectedItem;

            if (selectedItem != null && this.selectedRepoPath == selectedItem.Path)
            {
                return;
            }
            else
            {
                if (this.modifiedFileInfo != null)
                {
                    this.modifiedFileInfo.Clear();
                }
                else
                {
                    this.modifiedFileInfo = new List <ChangedFilesInfo>();
                }

                listViewChanges.ItemsSource = this.modifiedFileInfo;
                try
                {
                    showMessage(string.Empty, true);
                    LibSvnChangeSet.SvnChangeSetMaker changeset = new LibSvnChangeSet.SvnChangeSetMaker();
                    this.selectedRepoPath     = selectedItem.Path;
                    selectedItem.ShowProgress = System.Windows.Visibility.Visible;
                    changeset.getModifiedFilesAsync(
                        selectedItem.Path,
                        new EventHandler <ProgressEventArgs>(modifiedListProgress),
                        new EventHandler <CompletedEventArgs>(modifiedListCompleted));
                }
                catch (Exception ex)
                {
                    showMessage("Error finding modifications for the selected archive", true);
                    this.selectedRepoPath = string.Empty;
                }
                listViewRepos.Items.Refresh();
            }
        }
        private void buttonSaveChangeList_Click(object sender, RoutedEventArgs e)
        {
            string dirPathToSave = this.selectedRepoPath;
            string tempDirPath = dirPathToSave;
            if(false == checkboxSaveUnderArchivePath.IsChecked)
            {
                System.Windows.Forms.FolderBrowserDialog folderBrowser = new System.Windows.Forms.FolderBrowserDialog();
                if( folderBrowser.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    dirPathToSave = folderBrowser.SelectedPath;
                else
                    return;
            }

            if (!string.IsNullOrEmpty(dirPathToSave))
            {
                // Choose only selected items
                List<string> filetoSave = (from change in this.modifiedFileInfo
                                           where change.Selected
                                           select change.Path).ToList();

                if (filetoSave.Count > 0)
                {

                    List<string> filesToDelete = new List<string>();

                    if (checkboxSaveUnderArchivePath.IsChecked == true)
                    {
                        tempDirPath = dirPathToSave + "\\svncm_temp";
                    }

                    LibSvnChangeSet.SvnChangeSetMaker changeset = new LibSvnChangeSet.SvnChangeSetMaker();
                    changeset.createChangeList(filetoSave, selectedRepoPath, tempDirPath);
                    if (checkboxSaveInZip.IsChecked == true)
                    {
                        filesToDelete.Add(tempDirPath);
                        filesToDelete.Add(tempDirPath + "\\old");
                        filesToDelete.Add(tempDirPath + "\\new");
                        filesToDelete.Add(tempDirPath + "\\changeset.txt");
                        if (SvnChangeSetHelper.zipChangeSetDir(tempDirPath, dirPathToSave + "\\" + textboxZipFileName.Text))
                            MessageBox.Show("Saved changes set to " + dirPathToSave);
                        else
                            MessageBox.Show("Failed to create zip file at - " + dirPathToSave);

                        foreach (var path in filesToDelete)
                            SvnChangeSetHelper.deletePath(path);
                    }
                    else
                        MessageBox.Show("Saved changes set to " + tempDirPath);

                }
            }
        }
        private void getModifiedFileList()
        {
            RepoInfo selectedItem = (RepoInfo)listViewRepos.SelectedItem;
            if (selectedItem != null && this.selectedRepoPath == selectedItem.Path)
                return;
            else
            {
                if (this.modifiedFileInfo != null)
                    this.modifiedFileInfo.Clear();
                else
                    this.modifiedFileInfo = new List<ChangedFilesInfo>();

                listViewChanges.ItemsSource = this.modifiedFileInfo;
                try
                {
                    showMessage(string.Empty, true);
                    LibSvnChangeSet.SvnChangeSetMaker changeset = new LibSvnChangeSet.SvnChangeSetMaker();
                    this.selectedRepoPath = selectedItem.Path;
                    selectedItem.ShowProgress = System.Windows.Visibility.Visible;
                    changeset.getModifiedFilesAsync(
                        selectedItem.Path,
                        new EventHandler<ProgressEventArgs>(modifiedListProgress),
                        new EventHandler<CompletedEventArgs>(modifiedListCompleted));
                }
                catch (Exception ex)
                {
                    showMessage("Error finding modifications for the selected archive", true);
                    this.selectedRepoPath = string.Empty;
                }
                listViewRepos.Items.Refresh();
            }
        }
Beispiel #9
0
        private void buttonSaveChangeList_Click(object sender, RoutedEventArgs e)
        {
            string dirPathToSave = this.selectedRepoPath;
            string tempDirPath   = dirPathToSave;

            if (false == checkboxSaveUnderArchivePath.IsChecked)
            {
                System.Windows.Forms.FolderBrowserDialog folderBrowser = new System.Windows.Forms.FolderBrowserDialog();
                if (folderBrowser.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    dirPathToSave = folderBrowser.SelectedPath;
                }
                else
                {
                    return;
                }
            }

            if (!string.IsNullOrEmpty(dirPathToSave))
            {
                // Choose only selected items
                List <string> filetoSave = (from change in this.modifiedFileInfo
                                            where change.Selected
                                            select change.Path).ToList();

                if (filetoSave.Count > 0)
                {
                    List <string> filesToDelete = new List <string>();

                    if (checkboxSaveUnderArchivePath.IsChecked == true)
                    {
                        tempDirPath = dirPathToSave + "\\svncm_temp";
                    }

                    LibSvnChangeSet.SvnChangeSetMaker changeset = new LibSvnChangeSet.SvnChangeSetMaker();
                    changeset.createChangeList(filetoSave, selectedRepoPath, tempDirPath);
                    if (checkboxSaveInZip.IsChecked == true)
                    {
                        filesToDelete.Add(tempDirPath);
                        filesToDelete.Add(tempDirPath + "\\old");
                        filesToDelete.Add(tempDirPath + "\\new");
                        filesToDelete.Add(tempDirPath + "\\changeset.txt");
                        if (SvnChangeSetHelper.zipChangeSetDir(tempDirPath, dirPathToSave + "\\" + textboxZipFileName.Text))
                        {
                            MessageBox.Show("Saved changes set to " + dirPathToSave);
                        }
                        else
                        {
                            MessageBox.Show("Failed to create zip file at - " + dirPathToSave);
                        }

                        foreach (var path in filesToDelete)
                        {
                            SvnChangeSetHelper.deletePath(path);
                        }
                    }
                    else
                    {
                        MessageBox.Show("Saved changes set to " + tempDirPath);
                    }
                }
            }
        }