Skip to content

Commit

Permalink
修改readme;增加日志记录;
Browse files Browse the repository at this point in the history
  • Loading branch information
zc910704 committed Mar 5, 2023
1 parent 8a20cd8 commit b5b8cb5
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 18 deletions.
Binary file added Images/diff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Images/main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@

- ����ѡ����svn��ϲ��鿴�ύ��¼
- ��������ѡ���û���ͳ���ύ��Ϣ
- ������vscode �鿴svn�ύ��¼
- ������vscode �鿴����svn�ύ��¼, Ҳ���Խ��ύ��¼���ص����ؽ������߲鿴

- Requirement

- .Net6
- ��vs code���õ�����������
- svn��װ�����й���
- ��װ[.Net6���л���](https://dotnet.microsoft.com/en-us/download/dotnet/6.0)
- ��vs code���õ�����������(����vscode��·�����ӵ�path��)
- svn (tortoise����)��Ҫ��װ�����й���

- �����ͼ

![��ͼ](./Images/main.png)
![��ͼ1](./Images/main.png)

![��ͼ2](./Images/diff.png)

- ʹ��˵��

Expand All @@ -28,8 +30,10 @@

4. ���������, ������svn diff���ܻ�ȡÿ���ύ�ı������

5. ѡ����Ҫ������ļ�, ������浽���ؽ��в鿴

- ��Դ����

+ �� [dingguotu/SVNTool](https://github.com/dingguotu/SVNTool) ��Ŀ������ʹ���˲��ִ��룩�� ʹ��wpf, CommunityToolkit.mvvm, Behavior.wpf ʵ�ֵ��첽���̰߳汾
+ �� [dingguotu/SVNTool](https://github.com/dingguotu/SVNTool) ��Ŀ������ʹ���˲��ִ��룩�� ʹ��wpf, CommunityToolkit.mvvm, Behavior.wpf , nlogʵ�ֵĶ�svn��/�첽/���̰߳汾

+ chatgpt�ṩ��һЩʾ��
13 changes: 7 additions & 6 deletions SvnSummaryTool/Utils/CommandTools.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.Linq;
using System.Diagnostics;
using System.Text;
using System.Threading.Tasks;

Expand All @@ -17,6 +13,7 @@ public static class CommandTools
/// <returns></returns>
public static string ExecuteCommand(string command)
{
LogHelper.Debug($"CommandTools::ExecuteCommand |cmd = {command}");
Process pro = new Process();
pro.StartInfo.FileName = "cmd.exe";
pro.StartInfo.UseShellExecute = false;
Expand All @@ -34,13 +31,15 @@ public static string ExecuteCommand(string command)
pro.Close();
return output.Substring(output.IndexOf("& exit") + 8);
}

/// <summary>
/// 异步执行CMD命令,并返回结果
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
public static async Task<string> ExecuteCommandAsync(string command)
{
LogHelper.Debug($"CommandTools::ExecuteCommandAsync |cmd = {command}");
var process = new Process
{
StartInfo = new ProcessStartInfo
Expand All @@ -66,7 +65,9 @@ void outputHandler(object sender, DataReceivedEventArgs args)
else
{
process.OutputDataReceived -= outputHandler;
taskCompletionSource.TrySetResult(strbuild.ToString());
var result = strbuild.ToString();
LogHelper.Debug($"CommandTools::ExecuteCommandAsync |Result = {result}");
taskCompletionSource.TrySetResult(result);
}
}

Expand Down
14 changes: 8 additions & 6 deletions SvnSummaryTool/Utils/SvnTools.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
using SvnSummaryTool.Model;
using Microsoft.VisualBasic;
using SvnSummaryTool.Model;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using System.Windows;
using System.Xml;

namespace SvnSummaryTool.Utils
Expand Down Expand Up @@ -53,7 +50,12 @@ public static async Task DownloadFile(string fileUrl, string saveDir, int revisi
// 成功:A DiffCache\a.42CCE7919597553FFF8D72E3E629D478.r4.cs Export complete.
if (!response.Contains("A"))
{
using (var ts = File.CreateText(saveFilePath)) { }
await Task.Delay(100);
if (!File.Exists(saveFilePath))
{
LogHelper.Info($"SvnTools::DownloadFile |failed for {saveFilePath}");
using (var ts = File.CreateText(saveFilePath)) { }
}
}
}
}
Expand Down

0 comments on commit b5b8cb5

Please sign in to comment.