Esempio n. 1
0
        public async void OnRevertCommand(object parameter)
        {
            if (_gitRepository.TryGetTarget(out IGitRepository gitRepository) == false)
            {
                return;
            }
            List <string> file_list = new List <string>();
            string        msg       = "Revert below:\n\n";

            foreach (var item in SelectedModifiedFilePathList)
            {
                file_list.Add(item);
                msg += string.Format("{0}\n", item);
            }
            if (file_list.Count == 0)
            {
                return;
            }
            if (UIService.ConfirmMsg(msg, "Revert") == System.Windows.MessageBoxResult.Cancel)
            {
                return;
            }
            foreach (var item in file_list)
            {
                gitRepository.AddLog("Revert: " + item);
                gitRepository.GetGitWrapper().P4Revert(item);
            }
            await gitRepository.Refresh();
        }