Exemple #1
0
 public RevisionFileTree()
 {
     InitializeComponent();
     Translate();
     _fullPathResolver          = new FullPathResolver(() => Module.WorkingDir);
     _findFilePredicateProvider = new FindFilePredicateProvider();
 }
 public RevisionDiff()
 {
     InitializeComponent();
     Translate();
     this.HotkeysEnabled        = true;
     _fullPathResolver          = new FullPathResolver(() => Module.WorkingDir);
     _findFilePredicateProvider = new FindFilePredicateProvider();
 }
 public RevisionFileTree()
 {
     InitializeComponent();
     Translate();
     _fullPathResolver           = new FullPathResolver(() => Module.WorkingDir);
     _findFilePredicateProvider  = new FindFilePredicateProvider();
     _revisionFileTreeController = new RevisionFileTreeController(() => Module.WorkingDir,
                                                                  new GitRevisionInfoProvider(() => Module),
                                                                  new FileAssociatedIconProvider());
 }
Exemple #4
0
        public FormDiff(
            GitUICommands commands, bool firstParentIsValid,
            ObjectId baseId, ObjectId headId,
            string baseCommitDisplayStr, string headCommitDisplayStr)
            : base(commands)
        {
            _baseCommitDisplayStr = baseCommitDisplayStr;
            _headCommitDisplayStr = headCommitDisplayStr;
            _firstParentIsValid   = firstParentIsValid;

            InitializeComponent();

            btnSwap.AdaptImageLightness();

            InitializeComplete();

            _toolTipControl.SetToolTip(btnAnotherBaseBranch, _anotherBranchTooltip.Text);
            _toolTipControl.SetToolTip(btnAnotherHeadBranch, _anotherBranchTooltip.Text);
            _toolTipControl.SetToolTip(btnAnotherBaseCommit, _anotherCommitTooltip.Text);
            _toolTipControl.SetToolTip(btnAnotherHeadCommit, _anotherCommitTooltip.Text);
            _toolTipControl.SetToolTip(btnSwap, _btnSwapTooltip.Text);

            _baseRevision = new GitRevision(baseId);
            _headRevision = new GitRevision(headId);

            ObjectId mergeBase;

            if (_baseRevision.ObjectId.IsArtificial || _headRevision.ObjectId.IsArtificial)
            {
                mergeBase = null;
            }
            else
            {
                mergeBase = Module.GetMergeBase(_baseRevision.ObjectId, _headRevision.ObjectId);
            }

            _mergeBase = mergeBase != null ? new GitRevision(mergeBase) : null;
            ckCompareToMergeBase.Text    = $"{_ckCompareToMergeBase} ({_mergeBase?.ObjectId.ToShortString()})";
            ckCompareToMergeBase.Enabled = _mergeBase != null;

            _fullPathResolver                  = new FullPathResolver(() => Module.WorkingDir);
            _findFilePredicateProvider         = new FindFilePredicateProvider();
            _revisionTester                    = new GitRevisionTester(_fullPathResolver);
            _revisionDiffContextMenuController = new FileStatusListContextMenuController();

            lblBaseCommit.BackColor = AppColor.DiffRemoved.GetThemeColor();
            lblHeadCommit.BackColor = AppColor.DiffAdded.GetThemeColor();

            DiffFiles.ContextMenuStrip          = DiffContextMenu;
            DiffFiles.SelectedIndexChanged     += delegate { ShowSelectedFileDiff(); };
            DiffText.ExtraDiffArgumentsChanged += delegate { ShowSelectedFileDiff(); };
            DiffText.TopScrollReached          += FileViewer_TopScrollReached;
            DiffText.BottomScrollReached       += FileViewer_BottomScrollReached;
            Load += delegate { PopulateDiffFiles(); };
        }
 public RevisionDiff()
 {
     InitializeComponent();
     DiffFiles.AlwaysRevisionGroups = true;
     Translate();
     HotkeysEnabled                     = true;
     _fullPathResolver                  = new FullPathResolver(() => Module.WorkingDir);
     _findFilePredicateProvider         = new FindFilePredicateProvider();
     _gitRevisionTester                 = new GitRevisionTester(_fullPathResolver);
     _revisionDiffContextMenuController = new FileStatusListContextMenuController();
 }
 public RevisionDiffControl()
 {
     InitializeComponent();
     DiffFiles.GroupByRevision = true;
     InitializeComplete();
     HotkeysEnabled                     = true;
     _fullPathResolver                  = new FullPathResolver(() => Module.WorkingDir);
     _findFilePredicateProvider         = new FindFilePredicateProvider();
     _gitRevisionTester                 = new GitRevisionTester(_fullPathResolver);
     _revisionDiffContextMenuController = new FileStatusListContextMenuController();
     DiffText.TopScrollReached         += FileViewer_TopScrollReached;
     DiffText.BottomScrollReached      += FileViewer_BottomScrollReached;
 }
Exemple #7
0
        public FormDiff(
            GitUICommands commands, bool firstParentIsValid,
            ObjectId baseId, ObjectId headId,
            string baseCommitDisplayStr, string headCommitDisplayStr)
            : base(commands)
        {
            _baseCommitDisplayStr = baseCommitDisplayStr;
            _headCommitDisplayStr = headCommitDisplayStr;
            _firstParentIsValid   = firstParentIsValid;

            InitializeComponent();
            InitializeComplete();

            _toolTipControl.SetToolTip(btnAnotherBaseBranch, _anotherBranchTooltip.Text);
            _toolTipControl.SetToolTip(btnAnotherHeadBranch, _anotherBranchTooltip.Text);
            _toolTipControl.SetToolTip(btnAnotherBaseCommit, _anotherCommitTooltip.Text);
            _toolTipControl.SetToolTip(btnAnotherHeadCommit, _anotherCommitTooltip.Text);
            _toolTipControl.SetToolTip(btnSwap, _btnSwapTooltip.Text);

            if (!IsUICommandsInitialized)
            {
                // UICommands is not initialized in translation unit test.
                return;
            }

            _baseRevision                      = new GitRevision(baseId);
            _headRevision                      = new GitRevision(headId);
            _mergeBase                         = new GitRevision(Module.GetMergeBase(_baseRevision.ObjectId, _headRevision.ObjectId));
            ckCompareToMergeBase.Text         += $" ({_mergeBase?.ObjectId.ToShortString()})";
            _fullPathResolver                  = new FullPathResolver(() => Module.WorkingDir);
            _findFilePredicateProvider         = new FindFilePredicateProvider();
            _revisionTester                    = new GitRevisionTester(_fullPathResolver);
            _revisionDiffContextMenuController = new FileStatusListContextMenuController();

            lblBaseCommit.BackColor = AppSettings.DiffRemovedColor;
            lblHeadCommit.BackColor = AppSettings.DiffAddedColor;

            DiffFiles.ContextMenuStrip          = DiffContextMenu;
            DiffFiles.SelectedIndexChanged     += delegate { ShowSelectedFileDiff(); };
            DiffText.ExtraDiffArgumentsChanged += delegate { ShowSelectedFileDiff(); };
            Load += delegate { PopulateDiffFiles(); };
        }
Exemple #8
0
        public FormDiff(GitUICommands commands, RevisionGrid revisionGrid, string baseCommitSha,
                        string headCommitSha, string baseCommitDisplayStr, string headCommitDisplayStr) : base(commands)
        {
            _revisionGrid         = revisionGrid;
            _baseCommitDisplayStr = baseCommitDisplayStr;
            _headCommitDisplayStr = headCommitDisplayStr;

            InitializeComponent();
            Translate();

            _toolTipControl.SetToolTip(btnAnotherBaseBranch, _anotherBranchTooltip.Text);
            _toolTipControl.SetToolTip(btnAnotherHeadBranch, _anotherBranchTooltip.Text);
            _toolTipControl.SetToolTip(btnAnotherBaseCommit, _anotherCommitTooltip.Text);
            _toolTipControl.SetToolTip(btnAnotherHeadCommit, _anotherCommitTooltip.Text);
            _toolTipControl.SetToolTip(btnSwap, _btnSwapTooltip.Text);

            if (!IsUICommandsInitialized)
            {
                // UICommands is not initialized in translation unit test.
                return;
            }

            _baseRevision                      = new GitRevision(baseCommitSha);
            _headRevision                      = new GitRevision(headCommitSha);
            _mergeBase                         = new GitRevision(Module.GetMergeBase(_baseRevision.Guid, _headRevision.Guid));
            _fullPathResolver                  = new FullPathResolver(() => Module.WorkingDir);
            _findFilePredicateProvider         = new FindFilePredicateProvider();
            _revisionTester                    = new GitRevisionTester(_fullPathResolver);
            _revisionDiffContextMenuController = new FileStatusListContextMenuController();

            lblBaseCommit.BackColor = AppSettings.DiffRemovedColor;
            lblHeadCommit.BackColor = AppSettings.DiffAddedColor;

            DiffFiles.SelectedIndexChanged += DiffFiles_SelectedIndexChanged;

            DiffFiles.ContextMenuStrip = DiffContextMenu;

            Load += (sender, args) => PopulateDiffFiles();
            DiffText.ExtraDiffArgumentsChanged += DiffTextOnExtraDiffArgumentsChanged;
        }
Exemple #9
0
 public void Init()
 {
     provider = new FindFilePredicateProvider();
 }