Skip to content

Commit 55a11c7

Browse files
committed
UpgradeVerb: write deprecation notice
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
1 parent 22d187f commit 55a11c7

2 files changed

Lines changed: 1 addition & 120 deletions

File tree

GVFS/GVFS.UnitTests/Windows/Mock/MockProcessLauncher.cs

Lines changed: 0 additions & 44 deletions
This file was deleted.
Lines changed: 1 addition & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,15 @@
11
using CommandLine;
2-
using GVFS.Common;
3-
using GVFS.Common.FileSystem;
4-
using GVFS.Common.Tracing;
52
using System;
6-
using System.Diagnostics;
7-
using System.IO;
83

94
namespace GVFS.CommandLine
105
{
116
[Verb(UpgradeVerbName, HelpText = "Checks for new GVFS release, downloads and installs it when available.")]
127
public class UpgradeVerb : GVFSVerb.ForNoEnlistment
138
{
149
private const string UpgradeVerbName = "upgrade";
15-
private const string DryRunOption = "--dry-run";
16-
private const string NoVerifyOption = "--no-verify";
17-
private const string ConfirmOption = "--confirm";
18-
19-
private ITracer tracer;
20-
private PhysicalFileSystem fileSystem;
21-
private ProcessLauncher processLauncher;
22-
23-
public UpgradeVerb(
24-
ITracer tracer,
25-
PhysicalFileSystem fileSystem,
26-
ProcessLauncher processWrapper,
27-
TextWriter output)
28-
{
29-
this.tracer = tracer;
30-
this.fileSystem = fileSystem;
31-
this.processLauncher = processWrapper;
32-
this.Output = output;
33-
}
3410

3511
public UpgradeVerb()
3612
{
37-
this.fileSystem = new PhysicalFileSystem();
38-
this.processLauncher = new ProcessLauncher();
3913
this.Output = Console.Out;
4014
}
4115

@@ -67,56 +41,7 @@ protected override string VerbName
6741

6842
public override void Execute()
6943
{
70-
this.ReportErrorAndExit(this.tracer, ReturnCode.GenericError, "failed to upgrade");
71-
}
72-
73-
public class ProcessLauncher
74-
{
75-
public ProcessLauncher()
76-
{
77-
this.Process = new Process();
78-
}
79-
80-
public Process Process { get; private set; }
81-
82-
public virtual bool HasExited
83-
{
84-
get { return this.Process.HasExited; }
85-
}
86-
87-
public virtual int ExitCode
88-
{
89-
get { return this.Process.ExitCode; }
90-
}
91-
92-
public virtual void WaitForExit()
93-
{
94-
this.Process.WaitForExit();
95-
}
96-
97-
public virtual bool TryStart(string path, string args, bool useShellExecute, out Exception exception)
98-
{
99-
this.Process.StartInfo = new ProcessStartInfo(path)
100-
{
101-
UseShellExecute = useShellExecute,
102-
WorkingDirectory = Environment.SystemDirectory,
103-
WindowStyle = ProcessWindowStyle.Normal,
104-
Arguments = args
105-
};
106-
107-
exception = null;
108-
109-
try
110-
{
111-
return this.Process.Start();
112-
}
113-
catch (Exception ex)
114-
{
115-
exception = ex;
116-
}
117-
118-
return false;
119-
}
44+
Console.Error.WriteLine("'gvfs upgrade' is no longer supported. Visit https://github.com/microsoft/vfsforgit for the latest install/upgrade instructions.");
12045
}
12146
}
12247
}

0 commit comments

Comments
 (0)