Exemplo n.º 1
0
 public StatusForm(GitModuleInfo module)
 {
     _module = module;
     InitializeComponent();
     gridFiles.AutoGenerateColumns = false;
     Init();
 }
Exemplo n.º 2
0
 public void FetchAndRefreshAfterPush(GitModuleInfo moduleInfo)
 {
     foreach (var module in GetModulesByUrl(moduleInfo.RemoteUrl).Where(m => m != moduleInfo))
     {
         module.Fetch();
         module.RefreshStatus();
     }
 }
Exemplo n.º 3
0
        private CommonResult CreateBranch(GitModuleInfo module, CreateBranchInfo createBranchInfo)
        {
            if (CurrentProjectIsEmpty()) return new CommonResult("Current project is empty");
            //module.Refresh();

            if (module.BranchExists(createBranchInfo.BranchName))
            {
                return new CommonResult("Branch " + createBranchInfo.BranchName + " already exists");
            }

            if (!module.CreateLocalBranch(createBranchInfo.BranchName, createBranchInfo.ParentName))
            {
                return new CommonResult("Error during local branch creation. Please see logs");
            }

            //module.RefreshBranches();
            //module.RefreshStatus();

            //if (createBranchInfo.CreateRemoteBranch)
            //{
            //    var createRemoteResult = module.CreateRemoteBranch(createBranchInfo.BranchName);
            //    if (createRemoteResult != GitPushResult.Success)
            //    {
            //        return new CommonResult("Error during remote branch creation. Please see logs");
            //    }
            //}
            return new CommonResult();
        }
Exemplo n.º 4
0
 public void SwitchModuleToBranch(GitModuleInfo module, string branchName)
 {
     if (module == null) return;
     module.SwitchToBranch(branchName);
 }
Exemplo n.º 5
0
 public GitPushResult Push(GitModuleInfo module)
 {
     if (CurrentProjectIsEmpty()) return GitPushResult.Unknown;
     var result = module.Push();
     if (result == GitPushResult.Success)
         CurrentGitProjectList.FetchAndRefreshAfterPush(module);
     return result;
 }
Exemplo n.º 6
0
 public bool DeleteRemoteBranch(GitModuleInfo module, string branchName)
 {
     _logInfo("Deleting remote branch " + branchName + "...");
     if (CurrentProjectIsEmpty()) return false;
     var result = module.DeleteRemoteBranch(branchName);
     if (result) CurrentGitProjectList.RefreshModulesByUrl(module.RemoteUrl);
     return result;
 }
Exemplo n.º 7
0
 public void DeleteLocalBranch(GitModuleInfo module)
 {
     if (CurrentProjectIsEmpty()) return;
     module.DeleteLocalBranch(module.Branch);
 }
Exemplo n.º 8
0
 public static void Show(GitModuleInfo module)
 {
     var form = new StatusForm(module);
     form.ShowDialog();
 }