From f57e535f081881689b4244e74d80de2332ab0f4f Mon Sep 17 00:00:00 2001
From: lwray-renesas <82612797+lwray-renesas@users.noreply.github.com>
Date: Thu, 17 Apr 2025 17:09:02 +0100
Subject: [PATCH 1/2] Implemented conflict-popup
As per https://github.com/sourcegit-scm/sourcegit/issues/1210.
Included conflict popup + switched focus for immediate conflict handling.
---
src/Resources/Locales/de_DE.axaml | 2 ++
src/Resources/Locales/en_US.axaml | 2 ++
src/Resources/Locales/es_ES.axaml | 2 ++
src/Resources/Locales/fr_FR.axaml | 2 ++
src/Resources/Locales/it_IT.axaml | 2 ++
src/Resources/Locales/ja_JP.axaml | 2 ++
src/Resources/Locales/pt_BR.axaml | 2 ++
src/Resources/Locales/ru_RU.axaml | 2 ++
src/Resources/Locales/ta_IN.axaml | 2 ++
src/Resources/Locales/uk_UA.axaml | 2 ++
src/Resources/Locales/zh_CN.axaml | 2 ++
src/Resources/Locales/zh_TW.axaml | 2 ++
src/ViewModels/WorkingCopy.cs | 13 +++++++-
src/Views/ConflictDialog.axaml | 54 +++++++++++++++++++++++++++++++
src/Views/ConflictDialog.axaml.cs | 18 +++++++++++
15 files changed, 108 insertions(+), 1 deletion(-)
create mode 100644 src/Views/ConflictDialog.axaml
create mode 100644 src/Views/ConflictDialog.axaml.cs
diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml
index 7a3da294..c1d6dd1a 100644
--- a/src/Resources/Locales/de_DE.axaml
+++ b/src/Resources/Locales/de_DE.axaml
@@ -178,6 +178,8 @@
Farbe
Name
Zuletzt geöffnete Tabs beim Starten wiederherstellen
+ Nicht aufgelöste Konflikte
+ In Ihrer Arbeitskopie befinden sich nicht aufgelöste Konflikte!
Konventionelle Commit-Hilfe
Breaking Change:
Geschlossenes Ticket:
diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml
index 20a70f22..5e867a12 100644
--- a/src/Resources/Locales/en_US.axaml
+++ b/src/Resources/Locales/en_US.axaml
@@ -186,6 +186,8 @@
Empty commit detected! Do you want to continue (--allow-empty)?
STAGE ALL & COMMIT
Empty commit detected! Do you want to continue (--allow-empty) or stage all then commit?
+ Unresolved Conflicts
+ There are unresolved conflicts in your working copy!
Conventional Commit Helper
Breaking Change:
Closed Issue:
diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml
index 204cfc1a..6f133eca 100644
--- a/src/Resources/Locales/es_ES.axaml
+++ b/src/Resources/Locales/es_ES.axaml
@@ -187,6 +187,8 @@
¡Commit vacío detectado! ¿Quieres continuar (--allow-empty)?
HACER STAGE A TODO & COMMIT
¡Commit vacío detectado! ¿Quieres continuar (--allow-empty) o hacer stage a todo y después commit?
+ Conflictos sin resolver
+ ¡Hay conflictos sin resolver en tu copia de trabajo!
Asistente de Commit Convencional
Cambio Importante:
Incidencia Cerrada:
diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml
index f45a83d9..e1b56424 100644
--- a/src/Resources/Locales/fr_FR.axaml
+++ b/src/Resources/Locales/fr_FR.axaml
@@ -181,6 +181,8 @@
Couleur
Nom
Restaurer les onglets au démarrage
+ Conflits non résolus
+ Il y a des conflits non résolus dans votre copie de travail !
Assistant Commits Conventionnels
Changement Radical :
Incident Clos :
diff --git a/src/Resources/Locales/it_IT.axaml b/src/Resources/Locales/it_IT.axaml
index b7d2568a..9e4b23c8 100644
--- a/src/Resources/Locales/it_IT.axaml
+++ b/src/Resources/Locales/it_IT.axaml
@@ -181,6 +181,8 @@
Colore
Nome
Ripristina schede all'avvio
+ Conflitti non risolti
+ Ci sono conflitti non risolti nella tua copia di lavoro!
Guida Commit Convenzionali
Modifica Sostanziale:
Issue Chiusa:
diff --git a/src/Resources/Locales/ja_JP.axaml b/src/Resources/Locales/ja_JP.axaml
index c50504e1..e64eebc6 100644
--- a/src/Resources/Locales/ja_JP.axaml
+++ b/src/Resources/Locales/ja_JP.axaml
@@ -181,6 +181,8 @@
色
名前
起動時にタブを復元
+ 未解決の競合
+ 作業コピーに未解決の競合があります!
Conventional Commitヘルパー
破壊的変更:
閉じたIssue:
diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml
index a4e9d883..c5eda07a 100644
--- a/src/Resources/Locales/pt_BR.axaml
+++ b/src/Resources/Locales/pt_BR.axaml
@@ -163,6 +163,8 @@
Cor
Nome
Restaurar abas ao inicializar
+ Conflitos não resolvidos
+ Há conflitos não resolvidos na sua cópia de trabalho!
Assistente de Conventional Commit
Breaking Change:
Ticket encerrado:
diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml
index b8c86415..507a2b7b 100644
--- a/src/Resources/Locales/ru_RU.axaml
+++ b/src/Resources/Locales/ru_RU.axaml
@@ -186,6 +186,8 @@
Обнаружена пустая ревизия! Вы хотите продолжить (--allow-empty)?
Подготовить все и зафиксировать ревизию
Обнаружена пустая ревизия! Вы хотите продолжить (--allow-empty) или отложить все, затем зафиксировать ревизию?
+ Неразрешённые конфликты
+ В вашей рабочей копии есть неразрешённые конфликты!
Общепринятый помощник по ревизии
Кардинальные изменения:
Закрытая тема:
diff --git a/src/Resources/Locales/ta_IN.axaml b/src/Resources/Locales/ta_IN.axaml
index b4e4d939..8de9237a 100644
--- a/src/Resources/Locales/ta_IN.axaml
+++ b/src/Resources/Locales/ta_IN.axaml
@@ -181,6 +181,8 @@
நிறம்
பெயர்
தாவல்களை மீட்டமை
+ தீர்க்கப்படாத மோதல்கள்
+ உங்கள் வேலை நகலில் தீர்க்கப்படாத மோதல்கள் உள்ளன!
வழக்கமான உறுதிமொழி உதவியாளர்
உடைக்கும் மாற்றம்:
மூடப்பட்ட வெளியீடு சிக்கல்:
diff --git a/src/Resources/Locales/uk_UA.axaml b/src/Resources/Locales/uk_UA.axaml
index a3b63bde..3dd6bda3 100644
--- a/src/Resources/Locales/uk_UA.axaml
+++ b/src/Resources/Locales/uk_UA.axaml
@@ -185,6 +185,8 @@
Виявлено порожній коміт! Продовжити (--allow-empty)?
ІНДЕКСУВАТИ ВСЕ ТА ЗАКОМІТИТИ
Виявлено порожній коміт! Продовжити (--allow-empty) чи індексувати все та закомітити?
+ Невирішені конфлікти
+ У вашій робочій копії є невирішені конфлікти!
Допомога Conventional Commit
Зворотньо несумісні зміни:
Закрите завдання:
diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml
index 3d41bccd..30843b7e 100644
--- a/src/Resources/Locales/zh_CN.axaml
+++ b/src/Resources/Locales/zh_CN.axaml
@@ -190,6 +190,8 @@
提交未包含变更文件!是否继续(--allow-empty)?
自动暂存并提交
提交未包含变更文件!是否继续(--allow-empty)或是自动暂存所有变更并提交?
+ 未解决的冲突
+ 您的工作副本中存在未解决的冲突!
规范化提交信息生成
破坏性更新:
关闭的ISSUE:
diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml
index 3a10f6ca..d1ac983a 100644
--- a/src/Resources/Locales/zh_TW.axaml
+++ b/src/Resources/Locales/zh_TW.axaml
@@ -190,6 +190,8 @@
未包含任何檔案變更! 您是否仍要提交 (--allow-empty)?
自动暂存并提交
未包含任何檔案變更! 您是否仍要提交 (--allow-empty)或者自動暫存全部變更並提交?
+ 未解決的衝突
+ 您的工作副本中有未解決的衝突!
產生約定式提交訊息
破壞性變更:
關閉的 Issue:
diff --git a/src/ViewModels/WorkingCopy.cs b/src/ViewModels/WorkingCopy.cs
index 10544970..634e271c 100644
--- a/src/ViewModels/WorkingCopy.cs
+++ b/src/ViewModels/WorkingCopy.cs
@@ -9,6 +9,8 @@
using CommunityToolkit.Mvvm.ComponentModel;
+using SourceGit.Views;
+
namespace SourceGit.ViewModels
{
public class WorkingCopy : ObservableObject
@@ -300,6 +302,15 @@ public void SetData(List changes)
Dispatcher.UIThread.Invoke(() =>
{
+ if((visibleUnstaged.Count > 0) && (hasConflict))
+ {
+ _repo.RefreshBranches();
+ _repo.RefreshCommits();
+ _repo.SelectedViewIndex = 1;
+ selectedUnstaged.Add(visibleUnstaged[0]);
+ App.OpenDialog(new ConflictDialog());
+ }
+
_isLoadingData = true;
HasUnsolvedConflicts = hasConflict;
VisibleUnstaged = visibleUnstaged;
@@ -310,8 +321,8 @@ public void SetData(List changes)
SelectedStaged = selectedStaged;
_isLoadingData = false;
- UpdateDetail();
UpdateInProgressState();
+ UpdateDetail();
});
}
diff --git a/src/Views/ConflictDialog.axaml b/src/Views/ConflictDialog.axaml
new file mode 100644
index 00000000..783d4d52
--- /dev/null
+++ b/src/Views/ConflictDialog.axaml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Views/ConflictDialog.axaml.cs b/src/Views/ConflictDialog.axaml.cs
new file mode 100644
index 00000000..8af8b805
--- /dev/null
+++ b/src/Views/ConflictDialog.axaml.cs
@@ -0,0 +1,18 @@
+using Avalonia.Controls;
+using Avalonia.Interactivity;
+
+namespace SourceGit.Views
+{
+ public partial class ConflictDialog : ChromelessWindow
+ {
+ public ConflictDialog()
+ {
+ InitializeComponent();
+ }
+
+ private void OnOK(object sender, RoutedEventArgs e)
+ {
+ Close();
+ }
+ }
+}
From 26a471933c21a135e946273d49b9135b401bbd7f Mon Sep 17 00:00:00 2001
From: lwray-renesas <82612797+lwray-renesas@users.noreply.github.com>
Date: Thu, 17 Apr 2025 17:14:52 +0100
Subject: [PATCH 2/2] Fixed tooltip
Tooltip for chosing mine was wrong.
Was --theirs when should be --ours.
---
src/Views/Conflict.axaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Views/Conflict.axaml b/src/Views/Conflict.axaml
index f2d7bdec..cf2e25a0 100644
--- a/src/Views/Conflict.axaml
+++ b/src/Views/Conflict.axaml
@@ -111,7 +111,7 @@
-