本文整理汇总了C#中MonoDevelop.VersionControl.Repository.GetVersionInfo方法的典型用法代码示例。如果您正苦于以下问题:C# Repository.GetVersionInfo方法的具体用法?C# Repository.GetVersionInfo怎么用?C# Repository.GetVersionInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoDevelop.VersionControl.Repository
的用法示例。
在下文中一共展示了Repository.GetVersionInfo方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RevertRevisions
private static bool RevertRevisions (Repository vc, string path, Revision revision, bool test, bool toRevision)
{
try {
if (test) {
return (vc.GetVersionInfo (path).CanRevert);
}
string question = GettextCatalog.GetString (
"Are you sure you want to revert the selected resources to the revision specified (all local changes will be discarded)?");
if (!toRevision)
question = GettextCatalog.GetString (
"Are you sure you want to revert the changes from the revision selected on these resources?");
if (MessageService.AskQuestion (question,
GettextCatalog.GetString ("Note: The reversion will occur in your working copy, so you will still need to perform a commit to complete it."),
AlertButton.Cancel, AlertButton.Revert) != AlertButton.Revert)
return false;
new RevertWorker(vc, path, revision, toRevision).Start();
return true;
}
catch (Exception ex) {
if (test)
LoggingService.LogError (ex.ToString ());
else
MessageService.ShowException (ex, GettextCatalog.GetString ("Version control command failed."));
return false;
}
}
示例2: Commit
public static void Commit (Repository vc, ChangeSet changeSet)
{
try {
if (vc.GetVersionInfo (changeSet.BaseLocalPath).CanCommit) {
if (!VersionControlService.NotifyPrepareCommit (vc, changeSet))
return;
CommitDialog dlg = new CommitDialog (changeSet);
try {
if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) {
if (VersionControlService.NotifyBeforeCommit (vc, changeSet)) {
new CommitWorker (vc, changeSet, dlg).Start();
return;
}
}
dlg.EndCommit (false);
} finally {
dlg.Destroy ();
}
VersionControlService.NotifyAfterCommit (vc, changeSet, false);
}
}
catch (Exception ex) {
MessageService.ShowException (ex, GettextCatalog.GetString ("Version control command failed."));
}
}
示例3: CanPublish
public static bool CanPublish (Repository vc, string path, bool isDir) {
if (!VersionControlService.CheckVersionControlInstalled ())
return false;
if (!vc.GetVersionInfo (path).IsVersioned && isDir)
return true;
return false;
}
示例4: AddFolderOverlay
void AddFolderOverlay (Repository rep, string folder, ref Gdk.Pixbuf icon, ref Gdk.Pixbuf closedIcon)
{
Gdk.Pixbuf overlay = null;
VersionInfo vinfo = rep.GetVersionInfo (folder, false);
if (vinfo == null || !vinfo.IsVersioned) {
overlay = VersionControlService.LoadOverlayIconForStatus (VersionStatus.Unversioned);
} else if (vinfo.IsVersioned && !vinfo.HasLocalChanges) {
overlay = VersionControlService.overlay_controled;
} else {
overlay = VersionControlService.LoadOverlayIconForStatus (vinfo.Status);
}
if (overlay != null) {
AddOverlay (ref icon, overlay);
if (closedIcon != null)
AddOverlay (ref closedIcon, overlay);
}
}
示例5: Commit
public static bool Commit (Repository vc, ChangeSet changeSet, bool test)
{
try {
if (changeSet.IsEmpty) {
if (!test)
MessageService.ShowMessage (GettextCatalog.GetString ("There are no changes to be committed."));
return false;
}
if (vc.GetVersionInfo (changeSet.BaseLocalPath).CanCommit) {
if (test)
return true;
if (!VersionControlService.NotifyPrepareCommit (vc, changeSet))
return false;
CommitDialog dlg = new CommitDialog (changeSet);
try {
if (MessageService.RunCustomDialog (dlg) == (int) Gtk.ResponseType.Ok) {
if (VersionControlService.NotifyBeforeCommit (vc, changeSet)) {
new CommitWorker (vc, changeSet, dlg).Start();
return true;
}
}
dlg.EndCommit (false);
} finally {
dlg.Destroy ();
}
VersionControlService.NotifyAfterCommit (vc, changeSet, false);
}
return false;
}
catch (Exception ex) {
if (test)
LoggingService.LogError (ex.ToString ());
else
MessageService.ShowException (ex, GettextCatalog.GetString ("Version control command failed."));
return false;
}
}
示例6: UpdateIsDone
public virtual void UpdateIsDone()
{
AddFile ("testfile", null, true, true);
PostCommit (Repo);
// Checkout a second repository.
FilePath second = new FilePath (FileService.CreateTempDirectory () + Path.DirectorySeparatorChar);
Checkout (second, RemoteUrl);
Repo2 = GetRepo (second, RemoteUrl);
ModifyPath (Repo2, ref second);
string added = second + "testfile2";
File.Create (added).Close ();
Repo2.Add (added, false, new NullProgressMonitor ());
ChangeSet changes = Repo2.CreateChangeSet (Repo2.RootPath);
changes.AddFile (Repo2.GetVersionInfo (added, VersionInfoQueryFlags.IgnoreCache));
changes.GlobalComment = "test2";
Repo2.Commit (changes, new NullProgressMonitor ());
PostCommit (Repo2);
Repo.Update (Repo.RootPath, true, new NullProgressMonitor ());
Assert.True (File.Exists (LocalPath + "testfile2"));
Repo2.Dispose ();
DeleteDirectory (second);
}
示例7: GetVersionInfo
VersionInfo GetVersionInfo (Repository vc, FilePath filepath)
{
FilePath dir = filepath;
dir = dir.ParentDirectory.CanonicalPath;
DirData data;
if (filePaths.TryGetValue (dir, out data)) {
if (data.FileData == null) {
data.FileData = new Dictionary<FilePath, VersionInfo> ();
foreach (VersionInfo vin in vc.GetDirectoryVersionInfo (dir, false, false))
data.FileData [vin.LocalPath.CanonicalPath] = vin;
data.Timestamp = DateTime.Now;
}
VersionInfo vi;
if (data.FileData.TryGetValue (filepath.CanonicalPath, out vi))
return vi;
}
VersionInfo node = vc.GetVersionInfo (filepath, false);
if (node != null) {
if (data != null)
data.FileData [filepath] = node;
return node;
}
return VersionInfo.CreateUnversioned (filepath, false);
}
示例8: if
/* public override void PrepareChildNodes (object dataObject)
{
if (dataObject is IWorkspaceObject) {
IWorkspaceObject ce = (IWorkspaceObject) dataObject;
Repository rep = VersionControlService.GetRepository (ce);
if (rep != null)
rep.GetDirectoryVersionInfo (ce.BaseDirectory, false, false);
} else if (dataObject is ProjectFolder) {
ProjectFolder ce = (ProjectFolder) dataObject;
if (ce.ParentWorkspaceObject != null) {
Repository rep = VersionControlService.GetRepository (ce.ParentWorkspaceObject);
if (rep != null)
rep.GetDirectoryVersionInfo (ce.Path, false, false);
}
}
base.PrepareChildNodes (dataObject);
}
*/
static void AddFolderOverlay (Repository rep, string folder, NodeInfo nodeInfo, bool skipVersionedOverlay)
{
Xwt.Drawing.Image overlay = null;
VersionInfo vinfo = rep.GetVersionInfo (folder);
if (vinfo == null || !vinfo.IsVersioned) {
overlay = VersionControlService.LoadOverlayIconForStatus (VersionStatus.Unversioned);
} else if (vinfo.IsVersioned && !vinfo.HasLocalChanges) {
if (!skipVersionedOverlay)
overlay = VersionControlService.overlay_controled;
} else {
overlay = VersionControlService.LoadOverlayIconForStatus (vinfo.Status);
}
nodeInfo.OverlayBottomRight = overlay;
}
示例9: CanPublish
public static bool CanPublish (Repository vc, string path, bool isDir) {
if (!vc.GetVersionInfo (path).IsVersioned && isDir)
return true;
return false;
}
示例10: GetVersionInfo
VersionStatus GetVersionInfo (Repository vc, string filepath)
{
VersionInfo node = vc.GetVersionInfo (filepath, false);
if (node != null)
return node.Status;
return VersionStatus.Unversioned;
}
示例11: GetVersionInfo
VersionInfo GetVersionInfo (Repository vc, FilePath filepath, object dataObject, bool allowCacheMiss = true)
{
FilePath dir = filepath;
dir = dir.ParentDirectory.CanonicalPath;
DirData data;
if (filePaths.TryGetValue (dir, out data)) {
var fileData = data.FileData;
if (fileData == null && allowCacheMiss) {
fileData = new Dictionary<FilePath, VersionInfo> ();
foreach (VersionInfo vin in vc.GetDirectoryVersionInfo (dir, false, false)) {
// Console.WriteLine ("Storing {0} for {1}", vin.Status, vin.LocalPath.CanonicalPath);
fileData [vin.LocalPath.CanonicalPath] = vin;
}
data.Timestamp = DateTime.Now;
DispatchService.GuiDispatch(() => data.FileData = fileData);
}
VersionInfo vi;
if (data.FileData != null && data.FileData.TryGetValue (filepath.CanonicalPath, out vi))
return vi;
}
if (allowCacheMiss) {
VersionInfo node = vc.GetVersionInfo (filepath, false);
if (node != null) {
if (data == null) {
data = new DirData ();
data.Object = dataObject;
data.FileData = new Dictionary<FilePath, VersionInfo> ();
DispatchService.GuiDispatch (() => filePaths[dir] = data);
}
// Console.WriteLine ("Storing {0} for {1}", node.Status, filepath.CanonicalPath);
data.Timestamp = DateTime.Now;
DispatchService.GuiDispatch (() => { if (data.FileData != null) data.FileData [filepath.CanonicalPath] = node; });
return node;
}
}
return null;
}