Ejemplo n.º 1
0
        /// <summary>
        /// Recurcively get the elements full path list.
        /// Used to commit from the tree elements.
        /// </summary>
        /// <param name="list">The list of full paths.</param>
        /// <param name="root">The tree root</param>
        public static void GetElements(ref List <string> list, CommitTreeElement root)
        {
            if (!root.hasChildren)
            {
                if (!String.IsNullOrEmpty(root.fullPath) && root.enabled)
                {
                    list.Add(root.fullPath);
                }
                return;
            }

            foreach (CommitTreeElement elt in root.children)
            {
                if (elt.enabled)
                {
                    GetElements(ref list, elt);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Commit the stagged files.
        /// </summary>
        private void Commit()
        {
            CommitTreeElement root = commitTreeView.treeModel.root;

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

            // Get all the checked files
            WindowHelper.GetElements(ref fileList, root);

            foreach (string file in fileList)
            {
                RepositoryManager.Stage(file);
            }

            SettingsTab settingsTab = editorWindow.GetSettingsTab();

            RepositoryManager.Commit(settingsTab.GetUserUsername(), settingsTab.GetUserEmail(), currentCommitMessage);

            editorWindow.GetHistoryTab().RefreshHistory();
            currentCommitMessage = "";
            ReloadTree();
        }