コード例 #1
0
        private void OpenSettingsFile(string fileName)
        {
            if (string.IsNullOrEmpty(fileName))
            {
                openSettingsFileDialog.InitialDirectory = AppDomain.CurrentDomain.BaseDirectory;
                if (openSettingsFileDialog.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                {
                    fileName = openSettingsFileDialog.FileName;
                }
            }

            if (!string.IsNullOrEmpty(fileName))
            {
                try
                {
                    _migration        = VssMigration.OpenSettingsFile(fileName);
                    _settingsFileName = fileName;
                    this.BindEvents();
                    this.RefreshMigrationSettings();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(string.Format("Failed to open settings file. {0}", ex.Message), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
コード例 #2
0
        public SelectVssProjectsDialog(VssMigration migrationSettings)
            : this()
        {
            if (migrationSettings == null)
            {
                throw new ArgumentNullException("migrationSettings");
            }

            this.MigrationSettings = migrationSettings;

            _database = VssUtilities.OpenDatabase(migrationSettings.VssConnectionSettings);
            this.AddProjectNode(null, _database.get_VSSItem("$/"));
        }
コード例 #3
0
        // Icon still life terminal icon (http://www.iconfinder.com/icondetails/22281/128/)
        static void Main(string[] args)
        {
            CommandLineParser commandLine;

            // example command line
            //    /vssdb=C:\SourceSafe\cyotek /vssproject=$/ /svnrepo=https://HADES:8443/svn/test2/trunk/ /temppath=C:\temp\_migrate

            commandLine = new CommandLineParser();
            if (commandLine.AsBoolean("help") || commandLine.AsBoolean("h") || commandLine.AsBoolean("?"))
            {
                Console.WriteLine("SourceSafe to Subversion Migration\n");
                Console.WriteLine("Usage:");
                Console.WriteLine("vsssvn [[settingsfilename] | [options]]\n");
                Console.WriteLine("Options:");
                Console.WriteLine("vssdb\t\tVisual SourceSafe database");
                Console.WriteLine("vssuser\t\tSourceSafe login username");
                Console.WriteLine("vsspassword\tSourceSafe login password");
                Console.WriteLine("svnrepo\t\tSubversion repository URI");
                Console.WriteLine("svnuser\t\tSubversion login username");
                Console.WriteLine("svnpassword\tSubversion login password");
                Console.WriteLine("svnfolder\tSubversion repository local folder");
                Console.WriteLine("svnproject\tRoot project to import into");
                Console.WriteLine("vssproject\tSourceSafe project to import. May be specified multiple times.");
                Console.WriteLine("\t\tautomatically included in the import.");
                Console.WriteLine("nosub\tPut VSS project contents directly under root.");
                Console.WriteLine("revprops\tSpecifies if Subversion revision properties should be modified");
                Console.WriteLine("preview\t\tPreviews actions without performing an actual migration");
                Console.WriteLine("temppath\tFolder where the working copy is created");
            }
            else
            {
                VssMigration migration;

                migration      = VssMigration.LoadFromCommandLine();
                migration.Log += migration_Log;

                if (commandLine.AsBoolean("preview"))
                {
                    migration.Preview();
                }
                else
                {
                    migration.Migrate();
                }
            }

#if DEBUG
            Console.ReadKey(true);
#endif
        }
コード例 #4
0
        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);

            //disable theming for progress bar otherwise it's not displaying progress properly (1 bar behind)
            SetWindowTheme(progressBar.Handle, "", "");

            statusLabel.Text = string.Empty;

            _migration = new VssMigration();
            load_app_settings();

            if (_migration.AutoMigrate)
            {
                migrateButton.PerformClick();
            }
        }
コード例 #5
0
        public static VssMigration LoadFromCommandLine()
        {
            CommandLineParser args;
            VssMigration      settings;

            args = new CommandLineParser();

            if (args.ContainsKey(""))
            {
                settings = VssMigration.OpenSettingsFile(args.AsString(""));
            }
            else
            {
                settings = new VssMigration();
            }

            if (args.ContainsKey("vssdb"))
            {
                settings.VssConnectionSettings.Database = args.AsString("vssdb");
            }

            if (args.ContainsKey("vssuser"))
            {
                settings.VssConnectionSettings.UserName = args.AsString("vssuser");
            }

            if (args.ContainsKey("vsspassword"))
            {
                settings.VssConnectionSettings.Database = args.AsString("vsspassword");
            }

            if (args.ContainsKey("svnrepo"))
            {
                settings.SvnConnectionSettings.RepositoryUri = args.AsString("svnrepo");
            }

            if (args.ContainsKey("svnuser"))
            {
                settings.SvnConnectionSettings.UserName = args.AsString("svnuser");
            }

            if (args.ContainsKey("svnpassword"))
            {
                settings.SvnConnectionSettings.Password = args.AsString("svnpassword");
            }

            if (args.ContainsKey("svnproject"))
            {
                settings.RootSubversionProject = args.AsString("svnproject");
            }

            if (args.ContainsKey("vssproject"))
            {
                settings.SourceSafeProjects = new List <string>(args.AsStringList("vssproject"));
            }

            if (args.ContainsKey("nosub"))
            {
                settings.NoSubfolderForSingleProj = args.AsBoolean("nosub");
            }

            if (args.ContainsKey("temppath"))
            {
                settings.TempPath = args.AsString("temppath");
            }

            return(settings);
        }