Пример #1
0
        public async Task DeleteFilesAsync(FilePath[] localPaths, bool force, ProgressMonitor monitor, bool keepLocal = true)
        {
            FileUpdateEventArgs args = new FileUpdateEventArgs();
            var metadata             = new DeleteMetadata(VersionControlSystem)
            {
                PathsCount = localPaths.Length, Force = force, KeepLocal = keepLocal
            };

            using (var tracker = Instrumentation.DeleteCounter.BeginTiming(metadata, monitor.CancellationToken)) {
                try {
                    await OnDeleteFilesAsync(localPaths, force, monitor, keepLocal);

                    foreach (var path in localPaths)
                    {
                        args.Add(new FileUpdateEventInfo(this, path, false));
                    }
                } catch (Exception e) {
                    LoggingService.LogError("Failed to delete file", e);
                    metadata.SetFailure();
                    if (!keepLocal)
                    {
                        foreach (var path in localPaths)
                        {
                            File.Delete(path);
                        }
                    }
                }
            }
            ClearCachedVersionInfo(localPaths);
            if (args.Any())
            {
                VersionControlService.NotifyFileStatusChanged(args);
            }
        }
			protected override void Finished ()
			{
				dlg.EndCommit (success);
				dlg.Destroy ();
				FileUpdateEventArgs args = new FileUpdateEventArgs ();
				foreach (ChangeSetItem it in changeSet.Items)
					args.Add (new FileUpdateEventInfo (vc, it.LocalPath, it.IsDirectory));

				if (args.Count > 0)
					VersionControlService.NotifyFileStatusChanged (args);

				VersionControlService.NotifyAfterCommit (vc, changeSet, success);
			}
Пример #3
0
            protected override void Finished()
            {
                dlg.EndCommit(success);
                dlg.Dispose();
                VersionControlService.NotifyAfterCommit(vc, changeSet, success);
                ArrayList dirs  = new ArrayList();
                ArrayList files = new ArrayList();

                foreach (ChangeSetItem it in changeSet.Items)
                {
                    if (it.IsDirectory)
                    {
                        dirs.Add(it.LocalPath);
                    }
                    else
                    {
                        files.Add(it.LocalPath);
                    }
                }

                FileUpdateEventArgs args = new FileUpdateEventArgs();

                foreach (FilePath path in dirs)
                {
                    args.Add(new FileUpdateEventInfo(vc, path, true));
                }
                foreach (FilePath path in files)
                {
                    args.Add(new FileUpdateEventInfo(vc, path, false));
                }

                if (args.Count > 0)
                {
                    VersionControlService.NotifyFileStatusChanged(args);
                }
            }
Пример #4
0
        public override void NotifyFilesChanged(IEnumerable <FilePath> files)
        {
            FileUpdateEventArgs args = new FileUpdateEventArgs();

            foreach (var file in files)
            {
                var rep = GetRepository(file);
                if (rep != null && !rep.IsDisposed)
                {
                    rep.ClearCachedVersionInfo(file);
                    args.Add(new FileUpdateEventInfo(rep, file, false));
                }
            }
            VersionControlService.NotifyFileStatusChanged(args);
        }
Пример #5
0
            protected override void Finished()
            {
                dlg.EndCommit(success);
                dlg.Destroy();
                FileUpdateEventArgs args = new FileUpdateEventArgs();

                foreach (ChangeSetItem it in changeSet.Items)
                {
                    args.Add(new FileUpdateEventInfo(vc, it.LocalPath, it.IsDirectory));
                }

                if (args.Count > 0)
                {
                    VersionControlService.NotifyFileStatusChanged(args);
                }

                VersionControlService.NotifyAfterCommit(vc, changeSet, success);
            }
        public override void NotifyFilesChanged(IEnumerable <FilePath> files)
        {
            FileUpdateEventArgs args = new FileUpdateEventArgs();

            foreach (var file in files)
            {
                var rep = GetRepository(file);
                // FIXME: Remove workaround https://devdiv.visualstudio.com/DevDiv/_workitems/edit/982818
                if (rep != null && !rep.IsDisposed && File.Exists(file))
                {
                    rep.ClearCachedVersionInfo(file);
                    if (rep.TryGetFileUpdateEventInfo(rep, file, out var eventInfo))
                    {
                        args.Add(eventInfo);
                    }
                }
            }
            if (args.Count > 0)
            {
                VersionControlService.NotifyFileStatusChanged(args);
            }
        }
Пример #7
0
			protected override void Finished ()
			{
				dlg.EndCommit (success);
				dlg.Dispose ();
				VersionControlService.NotifyAfterCommit (vc, changeSet, success);
				ArrayList dirs = new ArrayList ();
				ArrayList files = new ArrayList ();
				foreach (ChangeSetItem it in changeSet.Items)
					if (it.IsDirectory) dirs.Add (it.LocalPath);
					else files.Add (it.LocalPath);
				
				FileUpdateEventArgs args = new FileUpdateEventArgs ();
				
				foreach (FilePath path in dirs)
					args.Add (new FileUpdateEventInfo (vc, path, true));
				foreach (FilePath path in files)
					args.Add (new FileUpdateEventInfo (vc, path, false));
				
				if (args.Count > 0)
					VersionControlService.NotifyFileStatusChanged (args);
			}
		public override void NotifyFilesChanged (IEnumerable<FilePath> files)
		{
			FileUpdateEventArgs args = new FileUpdateEventArgs ();
			foreach (var file in files) {
				var rep = GetRepository (file);
				if (rep != null) {
					rep.ClearCachedVersionInfo (file);
					args.Add (new FileUpdateEventInfo (rep, file, false));
				}
			}
			VersionControlService.NotifyFileStatusChanged (args);
		}