本文整理汇总了C#中GitCommands.RevisionGraph.Execute方法的典型用法代码示例。如果您正苦于以下问题:C# RevisionGraph.Execute方法的具体用法?C# RevisionGraph.Execute怎么用?C# RevisionGraph.Execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GitCommands.RevisionGraph
的用法示例。
在下文中一共展示了RevisionGraph.Execute方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InternalRefresh
private void InternalRefresh()
{
Error.Visible = false;
NoCommits.Visible = false;
NoGit.Visible = false;
Revisions.Visible = true;
if (!GitCommands.Settings.ValidWorkingDir())
{
Revisions.RowCount = 0;
Revisions.ScrollBars = ScrollBars.None;
Revisions.Visible = false;
NoCommits.Visible = true;
NoGit.Visible = true;
Loading.Visible = false;
return;
}
int numberOfVisibleRows = Revisions.DisplayedRowCount(true) + 1;
int firstVisibleRow = Revisions.FirstDisplayedScrollingRowIndex;
if (numberOfVisibleRows < 1)
numberOfVisibleRows = 20;
if (LastRevision >= Math.Min(Revisions.RowCount, firstVisibleRow + numberOfVisibleRows))
{
return;
}
LastRevision = Math.Min(Revisions.RowCount, Math.Max(LastScrollPos + numberOfVisibleRows, Math.Max(firstVisibleRow + numberOfVisibleRows, Math.Max(GitCommands.Settings.MaxCommits, LastRevision * 2))));
Revisions.Enabled = false;
Loading.Visible = true;
indexWatcher.Reset();
revisionGraphCommand = new RevisionGraph();
revisionGraphCommand.LogParam = LogParam + Filter;
revisionGraphCommand.Exited += new EventHandler(gitGetCommitsCommand_Exited);
revisionGraphCommand.LimitRevisions = LastRevision;
revisionGraphCommand.Execute();
}
示例2: ForceRefreshRevisions
public void ForceRefreshRevisions()
{
try
{
RevisionGraphDrawStyle = DvcsGraph.RevisionGraphDrawStyleEnum.DrawNonRelativesGray;
ApplyFilterFromRevisionFilterDialog();
_initialLoad = true;
LastScrollPos = Revisions.FirstDisplayedScrollingRowIndex;
DisposeRevisionGraphCommand();
var newCurrentCheckout = Module.GetCurrentCheckout();
var newSuperprojectCurrentCheckout = Module.GetSuperprojectCurrentCheckout();
// If the current checkout changed, don't get the currently selected rows, select the
// new current checkout instead.
if (newCurrentCheckout == CurrentCheckout)
{
LastSelectedRows = Revisions.SelectedIds;
}
else
{
// This is a new checkout, so ensure the variable is cleared out.
LastSelectedRows = null;
}
Revisions.ClearSelection();
CurrentCheckout = newCurrentCheckout;
SuperprojectCurrentCheckout = newSuperprojectCurrentCheckout;
Revisions.Clear();
Error.Visible = false;
if (!Module.ValidWorkingDir())
{
Revisions.Visible = false;
NoCommits.Visible = true;
Loading.Visible = false;
NoGit.Visible = true;
string dir = Module.WorkingDir;
if (String.IsNullOrEmpty(dir) || !Directory.Exists(dir) ||
Directory.GetDirectories(dir).Length == 0 &&
Directory.GetFiles(dir).Length == 0)
CloneRepository.Show();
else
CloneRepository.Hide();
NoGit.BringToFront();
return;
}
NoCommits.Visible = false;
NoGit.Visible = false;
Revisions.Visible = true;
Revisions.BringToFront();
Revisions.Enabled = false;
Loading.Visible = true;
Loading.BringToFront();
_isLoading = true;
base.Refresh();
IndexWatcher.Reset();
if (!Settings.ShowGitNotes && !LogParam.Contains(" --not --glob=notes --not"))
LogParam = LogParam + " --not --glob=notes --not";
if (Settings.ShowGitNotes && LogParam.Contains(" --not --glob=notes --not"))
LogParam = LogParam.Replace(" --not --glob=notes --not", string.Empty);
RevisionGridInMemFilter revisionFilterIMF = RevisionGridInMemFilter.CreateIfNeeded(_revisionFilter.GetInMemAuthorFilter(),
_revisionFilter.GetInMemCommitterFilter(),
_revisionFilter.GetInMemMessageFilter(),
_revisionFilter.GetIgnoreCase());
RevisionGridInMemFilter filterBarIMF = RevisionGridInMemFilter.CreateIfNeeded(InMemAuthorFilter,
InMemCommitterFilter,
InMemMessageFilter,
InMemFilterIgnoreCase);
RevisionGraphInMemFilter revGraphIMF;
if (revisionFilterIMF != null && filterBarIMF != null)
revGraphIMF = new RevisionGraphInMemFilterOr(revisionFilterIMF, filterBarIMF);
else if (revisionFilterIMF != null)
revGraphIMF = revisionFilterIMF;
else
revGraphIMF = filterBarIMF;
_revisionGraphCommand = new RevisionGraph(Module) { BranchFilter = BranchFilter, LogParam = LogParam + _revisionFilter.GetFilter() + Filter + FixedFilter };
_revisionGraphCommand.Updated += GitGetCommitsCommandUpdated;
_revisionGraphCommand.Exited += GitGetCommitsCommandExited;
_revisionGraphCommand.Error += _revisionGraphCommand_Error;
_revisionGraphCommand.InMemFilter = revGraphIMF;
//_revisionGraphCommand.BeginUpdate += ((s, e) => Revisions.Invoke((Action) (() => Revisions.Clear())));
_revisionGraphCommand.Execute();
LoadRevisions();
SetRevisionsLayout();
}
catch (Exception exception)
{
Error.Visible = true;
Error.BringToFront();
//.........这里部分代码省略.........
示例3: ForceRefreshRevisions
//.........这里部分代码省略.........
Task.Factory.StartNew(() => Module.GetStagedFiles().Any());
// If the current checkout changed, don't get the currently selected rows, select the
// new current checkout instead.
if (newCurrentCheckout == CurrentCheckout)
{
LastSelectedRows = Revisions.SelectedIds;
}
else
{
// This is a new checkout, so ensure the variable is cleared out.
LastSelectedRows = null;
}
Revisions.ClearSelection();
CurrentCheckout = newCurrentCheckout;
_filtredCurrentCheckout = null;
_currentCheckoutParents = null;
SuperprojectCurrentCheckout = newSuperPrjectInfo;
UnstagedChanges = unstagedChanges;
StagedChanges = stagedChanges;
Revisions.Clear();
Error.Visible = false;
if (!Module.IsValidGitWorkingDir())
{
Revisions.Visible = false;
NoCommits.Visible = true;
Loading.Visible = false;
NoGit.Visible = true;
string dir = Module.WorkingDir;
if (String.IsNullOrEmpty(dir) || !Directory.Exists(dir) ||
Directory.GetDirectories(dir).Length == 0 &&
Directory.GetFiles(dir).Length == 0)
CloneRepository.Show();
else
CloneRepository.Hide();
NoGit.BringToFront();
return;
}
NoCommits.Visible = false;
NoGit.Visible = false;
Revisions.Visible = true;
Revisions.BringToFront();
Revisions.Enabled = false;
Loading.Visible = true;
Loading.BringToFront();
_isLoading = true;
base.Refresh();
IndexWatcher.Reset();
if (!AppSettings.ShowGitNotes && (_refsOptions & (RefsFiltringOptions.All | RefsFiltringOptions.Boundary)) == (RefsFiltringOptions.All | RefsFiltringOptions.Boundary))
_refsOptions |= RefsFiltringOptions.ShowGitNotes;
if (AppSettings.ShowGitNotes)
_refsOptions &= ~RefsFiltringOptions.ShowGitNotes;
if (!AppSettings.ShowMergeCommits)
_refsOptions |= RefsFiltringOptions.NoMerges;
RevisionGridInMemFilter revisionFilterIMF = RevisionGridInMemFilter.CreateIfNeeded(_revisionFilter.GetInMemAuthorFilter(),
_revisionFilter.GetInMemCommitterFilter(),
_revisionFilter.GetInMemMessageFilter(),
_revisionFilter.GetIgnoreCase());
RevisionGridInMemFilter filterBarIMF = RevisionGridInMemFilter.CreateIfNeeded(InMemAuthorFilter,
InMemCommitterFilter,
InMemMessageFilter,
InMemFilterIgnoreCase);
RevisionGraphInMemFilter revGraphIMF;
if (revisionFilterIMF != null && filterBarIMF != null)
revGraphIMF = new RevisionGraphInMemFilterOr(revisionFilterIMF, filterBarIMF);
else if (revisionFilterIMF != null)
revGraphIMF = revisionFilterIMF;
else
revGraphIMF = filterBarIMF;
_revisionGraphCommand = new RevisionGraph(Module) {
BranchFilter = BranchFilter,
RefsOptions = _refsOptions,
RevisionFilter = _revisionFilter.GetRevisionFilter() + QuickRevisionFilter + FixedRevisionFilter,
PathFilter = _revisionFilter.GetPathFilter() + FixedPathFilter,
};
_revisionGraphCommand.Updated += GitGetCommitsCommandUpdated;
_revisionGraphCommand.Exited += GitGetCommitsCommandExited;
_revisionGraphCommand.Error += _revisionGraphCommand_Error;
_revisionGraphCommand.InMemFilter = revGraphIMF;
_revisionGraphCommand.Execute();
LoadRevisions();
SetRevisionsLayout();
ResetNavigationHistory();
}
catch (Exception)
{
Error.Visible = true;
Error.BringToFront();
throw;
}
}
示例4: ForceRefreshRevisions
public void ForceRefreshRevisions()
{
try
{
_initialLoad = true;
LastScrollPos = Revisions.FirstDisplayedScrollingRowIndex;
//Hide graph column when there it is disabled OR when a filter is active
//allowing for special case when history of a single file is being displayed
if (!Settings.ShowRevisionGraph || (FilterIsApplied(false) && !AllowGraphWithFilter))
{
Revisions.ShowHideRevisionGraph(false);
}
else
{
Revisions.ShowHideRevisionGraph(true);
}
DisposeRevisionGraphCommand();
var newCurrentCheckout = GitCommandHelpers.GetCurrentCheckout();
// If the current checkout changed, don't get the currently selected rows, select the
// new current checkout instead.
if (newCurrentCheckout == CurrentCheckout)
{
LastSelectedRows = Revisions.SelectedIds;
}
Revisions.ClearSelection();
CurrentCheckout = newCurrentCheckout;
Error.Visible = false;
NoCommits.Visible = false;
NoGit.Visible = false;
Revisions.Visible = true;
Loading.Visible = true;
Revisions.Clear();
if (!Settings.ValidWorkingDir())
{
Revisions.Visible = false;
NoCommits.Visible = false;
NoGit.Visible = true;
Loading.Visible = false;
return;
}
Revisions.Enabled = false;
Loading.Visible = true;
_indexWatcher.Reset();
_revisionGraphCommand = new RevisionGraph { BranchFilter = BranchFilter, LogParam = LogParam + Filter };
_revisionGraphCommand.Updated += GitGetCommitsCommandUpdated;
_revisionGraphCommand.Exited += GitGetCommitsCommandExited;
_revisionGraphCommand.Error += _revisionGraphCommand_Error;
if (!(string.IsNullOrEmpty(InMemAuthorFilter) &&
string.IsNullOrEmpty(InMemCommitterFilter) &&
string.IsNullOrEmpty(InMemMessageFilter)))
_revisionGraphCommand.InMemFilter = new RevisionGridInMemFilter(InMemAuthorFilter,
InMemCommitterFilter,
InMemMessageFilter,
InMemFilterIgnoreCase);
_revisionGraphCommand.Execute();
LoadRevisions();
}
catch (Exception exception)
{
Error.Visible = true;
MessageBox.Show(exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
示例5: ForceRefreshRevisions
public void ForceRefreshRevisions()
{
try
{
_initialLoad = true;
LastScrollPos = Revisions.FirstDisplayedScrollingRowIndex;
//Hide graph column when there it is disabled OR when a filter is active
if (!Settings.ShowRevisionGraph || !string.IsNullOrEmpty(Filter))
{
Revisions.ShowHideRevisionGraph(false);
}
else
{
Revisions.ShowHideRevisionGraph(true);
}
if (_revisionGraphCommand != null)
{
_revisionGraphCommand.Kill();
}
var newCurrentCheckout = GitCommands.GitCommands.GetCurrentCheckout();
// If the current checkout changed, don't get the currently selected rows, select the
// new current checkout instead.
if (newCurrentCheckout == CurrentCheckout)
{
LastSelectedRows = Revisions.SelectedIds;
}
Revisions.ClearSelection();
CurrentCheckout = newCurrentCheckout;
Error.Visible = false;
NoCommits.Visible = false;
NoGit.Visible = false;
Revisions.Visible = true;
Loading.Visible = true;
Revisions.Clear();
if (!Settings.ValidWorkingDir())
{
Revisions.Visible = false;
NoCommits.Visible = false;
NoGit.Visible = true;
Loading.Visible = false;
return;
}
Revisions.Enabled = false;
Loading.Visible = true;
_indexWatcher.Reset();
_revisionGraphCommand = new RevisionGraph {BranchFilter = BranchFilter, LogParam = LogParam + Filter};
_revisionGraphCommand.Updated += GitGetCommitsCommandUpdated;
_revisionGraphCommand.Exited += GitGetCommitsCommandExited;
_revisionGraphCommand.Execute();
LoadRevisions();
}
catch (Exception exception)
{
Error.Visible = true;
MessageBox.Show(exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
示例6: ForceRefreshRevisions
public void ForceRefreshRevisions()
{
try
{
RevisionGraphDrawStyle = RevisionGraphDrawStyleEnum.DrawNonRelativesGray;
ApplyFilterFromRevisionFilterDialog();
_initialLoad = true;
DisposeRevisionGraphCommand();
var newCurrentCheckout = Module.GetCurrentCheckout();
Task<string[]> newSuperprojectCurrentCheckout =
Task.Factory.StartNew(() => GetSuperprojectCheckout());
newSuperprojectCurrentCheckout.ContinueWith((task) => Refresh(),
TaskScheduler.FromCurrentSynchronizationContext());
// If the current checkout changed, don't get the currently selected rows, select the
// new current checkout instead.
if (newCurrentCheckout == CurrentCheckout)
{
LastSelectedRows = Revisions.SelectedIds;
}
else
{
// This is a new checkout, so ensure the variable is cleared out.
LastSelectedRows = null;
}
Revisions.ClearSelection();
CurrentCheckout = newCurrentCheckout;
FiltredCurrentCheckout = CurrentCheckout;
SuperprojectCurrentCheckout = newSuperprojectCurrentCheckout;
Revisions.Clear();
Error.Visible = false;
if (!Module.IsValidGitWorkingDir())
{
Revisions.Visible = false;
NoCommits.Visible = true;
Loading.Visible = false;
NoGit.Visible = true;
string dir = Module.WorkingDir;
if (String.IsNullOrEmpty(dir) || !Directory.Exists(dir) ||
Directory.GetDirectories(dir).Length == 0 &&
Directory.GetFiles(dir).Length == 0)
CloneRepository.Show();
else
CloneRepository.Hide();
NoGit.BringToFront();
return;
}
NoCommits.Visible = false;
NoGit.Visible = false;
Revisions.Visible = true;
Revisions.BringToFront();
Revisions.Enabled = false;
Loading.Visible = true;
Loading.BringToFront();
_isLoading = true;
base.Refresh();
IndexWatcher.Reset();
if (!AppSettings.ShowGitNotes && (_refsOptions & (RefsFiltringOptions.All | RefsFiltringOptions.Boundary)) == (RefsFiltringOptions.All | RefsFiltringOptions.Boundary))
_refsOptions |= RefsFiltringOptions.ShowGitNotes;
if (AppSettings.ShowGitNotes)
_refsOptions &= ~RefsFiltringOptions.ShowGitNotes;
if (!AppSettings.ShowMergeCommits)
_refsOptions |= RefsFiltringOptions.NoMerges;
RevisionGridInMemFilter revisionFilterIMF = RevisionGridInMemFilter.CreateIfNeeded(_revisionFilter.GetInMemAuthorFilter(),
_revisionFilter.GetInMemCommitterFilter(),
_revisionFilter.GetInMemMessageFilter(),
_revisionFilter.GetIgnoreCase());
RevisionGridInMemFilter filterBarIMF = RevisionGridInMemFilter.CreateIfNeeded(InMemAuthorFilter,
InMemCommitterFilter,
InMemMessageFilter,
InMemFilterIgnoreCase);
RevisionGraphInMemFilter revGraphIMF;
if (revisionFilterIMF != null && filterBarIMF != null)
revGraphIMF = new RevisionGraphInMemFilterOr(revisionFilterIMF, filterBarIMF);
else if (revisionFilterIMF != null)
revGraphIMF = revisionFilterIMF;
else
revGraphIMF = filterBarIMF;
_revisionGraphCommand = new RevisionGraph(Module) { BranchFilter = BranchFilter, RefsOptions = _refsOptions, Filter = _revisionFilter.GetFilter() + Filter + FixedFilter };
_revisionGraphCommand.Updated += GitGetCommitsCommandUpdated;
_revisionGraphCommand.Exited += GitGetCommitsCommandExited;
_revisionGraphCommand.Error += _revisionGraphCommand_Error;
_revisionGraphCommand.InMemFilter = revGraphIMF;
_revisionGraphCommand.Execute();
LoadRevisions();
SetRevisionsLayout();
}
//.........这里部分代码省略.........
示例7: ForceRefreshRevisions
public void ForceRefreshRevisions()
{
try
{
ApplyFilterFromRevisionFilterDialog();
_initialLoad = true;
LastScrollPos = Revisions.FirstDisplayedScrollingRowIndex;
DisposeRevisionGraphCommand();
var newCurrentCheckout = GitCommandHelpers.GetCurrentCheckout();
// If the current checkout changed, don't get the currently selected rows, select the
// new current checkout instead.
if (newCurrentCheckout == CurrentCheckout)
{
LastSelectedRows = Revisions.SelectedIds;
}
Revisions.ClearSelection();
CurrentCheckout = newCurrentCheckout;
Revisions.Clear();
Error.Visible = false;
if (!Settings.ValidWorkingDir())
{
Revisions.Visible = false;
NoCommits.Visible = true;
Loading.Visible = false;
NoGit.Visible = true;
NoGit.BringToFront();
return;
}
NoCommits.Visible = false;
NoGit.Visible = false;
Revisions.Visible = true;
Revisions.BringToFront();
Revisions.Enabled = false;
Loading.Visible = true;
Loading.BringToFront();
_isLoading = true;
base.Refresh();
IndexWatcher.Reset();
if (!Settings.ShowGitNotes && !LogParam.Contains(" --not --glob=notes --not"))
LogParam = LogParam + " --not --glob=notes --not";
if (Settings.ShowGitNotes && LogParam.Contains(" --not --glob=notes --not"))
LogParam = LogParam.Replace(" --not --glob=notes --not", string.Empty);
_revisionGraphCommand = new RevisionGraph { BranchFilter = BranchFilter, LogParam = LogParam + Filter + _revisionFilter.GetFilter() };
_revisionGraphCommand.Updated += GitGetCommitsCommandUpdated;
_revisionGraphCommand.Exited += GitGetCommitsCommandExited;
_revisionGraphCommand.Error += _revisionGraphCommand_Error;
//_revisionGraphCommand.BeginUpdate += ((s, e) => Revisions.Invoke((Action) (() => Revisions.Clear())));
if (!(string.IsNullOrEmpty(InMemAuthorFilter) &&
string.IsNullOrEmpty(InMemCommitterFilter) &&
string.IsNullOrEmpty(InMemMessageFilter)))
_revisionGraphCommand.InMemFilter = new RevisionGridInMemFilter(InMemAuthorFilter,
InMemCommitterFilter,
InMemMessageFilter,
InMemFilterIgnoreCase);
_revisionGraphCommand.Execute();
LoadRevisions();
SetRevisionsLayout();
}
catch (Exception exception)
{
Error.Visible = true;
Error.BringToFront();
MessageBox.Show(exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
示例8: RevisionGrid_Form1
public void RevisionGrid_Form1()
{
app = new ApplicationContext();
Form = new FormRevisionGrid();
RevisionGrid = Form.Grid;
Revisions = RevisionGrid.RevisionsGraph;
app.MainForm = Form;
var currentDir = Directory.GetCurrentDirectory();
string[] args = new string[] { "", "", currentDir }; // GitExtensionsTest\bin\Debug
if (args[2].EndsWith(@"bin\Debug"))
args[2] = Path.GetFullPath(currentDir + @"\..\..\..");
var dir = GetWorkingDir(args);
Directory.SetCurrentDirectory(dir);
GitUICommands uCommands = new GitUICommands(dir);
var browseForm = TestStatic.StartBrowseForm(uCommands, Form);
Form.LoadModule(browseForm.Module);
RevisionGrid.UICommandsSource = Form;
var _revisionGraphCommand = new RevisionGraph(browseForm.Module)
{
BranchFilter = null
};
_revisionGraphCommand.Updated += _revisionGraphCommand_Updated;
_revisionGraphCommand.Error += _revisionGraphCommand_Error;
//_revisionGraphCommand.InMemFilter = revGraphIMF;
_revisionGraphCommand.Exited += _revisionGraphCommand_Exited;
RevisionGrid.RevisionsGraph.Columns[1].Visible = false;
RevisionGrid.RevisionsGraph.RemovePainting();
Form.Show();
_revisionGraphCommand.Execute();
Application.Run(app);
}