Beispiel #1
0
        public static void ArcLand()
        {
            ExecuteCommand.ExecuteArc("arc land");
            ArrayList lines = new ArrayList();

            lines.Add("Executing Arc Land");
            GxConsoleHandler.GitConsoleWriter(lines, "KBCodeReview - Execute Arc land", true);
        }
Beispiel #2
0
        public static void GitCommit()
        {
            string result = ExecuteCommand.Execute("git add .");

            GxConsoleHandler.GitConsoleWriter(result, "KBCodeReviewer - Execute Git add .");
            string gitcommit = "git commit -m " + '"' + "default message" + '"';

            result = ExecuteCommand.Execute(gitcommit);
            GxConsoleHandler.GitConsoleWriter(result, "KBCodeReviewer - Execute Git commit");
        }
Beispiel #3
0
        private static bool GitExecute(string commandName, out string result)
        {
            bool success;

            ExecuteCommand.Execute(commandName, out result, out success);
            ArrayList lines = new ArrayList();

            lines.Add(result);
            GxConsoleHandler.GitConsoleWriter(lines, "[" + Resources.AppName + "]: - Execute " + commandName, true);

            return(success);
        }
Beispiel #4
0
        public static void GitClone()
        {
            string path = KBCodeReviewHelper.GetKBCodeReviewDirectory();

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }

            string gitUser   = GetGitUser();
            string gitPwd    = GetGitPassword();
            string gitServer = PropertyAccessor.GetValueString(UIServices.KB.CurrentModel, "Git remote server");
            string user2     = PropertyAccessor.GetValueString(UIServices.KB.CurrentModel, "Git UserName");
            string url       = "https://" + gitUser + ":" + gitPwd.ToString() + "@" + gitServer;
            //string result2;
            //ArrayList debug = new ArrayList();
            //result2 = "User: "******"Password: "******"GitServer: " + GitServer.ToString();
            //debug.Add(result2);
            //result2 = "GitUrl: " + url.ToString();
            //debug.Add(result2);
            //result2 = "User2: " + user2.ToString();
            //debug.Add(result2);


            bool success = false;

            if (gitServer != "")
            {
                if ((gitUser != "") && (gitPwd != ""))
                {
                    success = GitHelper.GitClone(url);
                }
                else
                {
                    GxConsoleHandler.WriteOutput("Configure Git user and password");
                }
            }
            else
            {
                GxConsoleHandler.WriteOutput("Git remote server can not be null");
            }

            if (success)
            {
                success = GitHelper.SetNotepadAsEditor();
            }
        }
Beispiel #5
0
        //--------------------------------GIT-----------------------------------------------------------------------------

        private static bool GitInit()
        {
            string path = KBCodeReviewHelper.GetKBCodeReviewDirectory() + "/.git";

            if (!Directory.Exists(path))
            {
                return(GitHelper.GitInit());
            }
            else
            {
                GxConsoleHandler.WriteOutput("Git was already initialized");
                return(true);
            }
        }
Beispiel #6
0
        //--------------------------------GIT-----------------------------------------------------------------------------
        public static void GitInit()
        {
            string path = KBCodeReviewHelper.GetKBCodeReviewDirectory() + "/.git";

            if (!Directory.Exists(path))
            {
                string result = ExecuteCommand.Execute("git init");
                GxConsoleHandler.GitConsoleWriter(result, "KBCodeReviewer - Execute Git Init");
            }
            else
            {
                GxConsoleHandler.GitConsoleWriter("Git was already initialized", "KBCodeReviewer - Execute Git Init");
            }
        }
Beispiel #7
0
        public static void RequestCodeReview()
        {
            string branchName = LocalBranchName();
            bool   resultOk;

            //First check if we can truly start a new process
            if (!GitHelper.HasPendingMerge(branchName))
            {
                resultOk = ResetEnvironment(branchName);
                if (resultOk)
                {
                    resultOk = GenerateCodeForReview(branchName);
                    if (resultOk)    //commit to local repository in <user>_reviewBranch
                    {
                        SendReview(branchName);
                    }
                }
            }
            else
            {
                GxConsoleHandler.WriteOutput("Cannot start a new Code-Review process until you complete the existing one.");
            }
        }
Beispiel #8
0
 public static void ArcLand()
 {
     ExecuteCommand.ExecuteArc("arc land");
     GxConsoleHandler.GitConsoleWriter("Executing Arc Land", "KBCodeReviewer - Execute Arc land");
 }