fix: wrong display when merge tag

* remove `Text.Merge.Source`  translations from `de_DE`/`es_ES`/`fr_FR`/`it_IT`/`pt_BR`/`ru_RU` because its content has been changed
This commit is contained in:
leo 2024-12-10 15:35:46 +08:00
parent 4dd3b7f412
commit 2504a52398
No known key found for this signature in database
13 changed files with 55 additions and 24 deletions

View file

@ -847,8 +847,13 @@ namespace SourceGit.ViewModels
fastForward.IsEnabled = current.TrackStatus.Ahead.Count == 0;
fastForward.Click += (_, e) =>
{
var b = _repo.Branches.Find(x => x.FriendlyName == upstream);
if (b == null)
return;
if (PopupHost.CanCreatePopup())
PopupHost.ShowAndStartPopup(new Merge(_repo, upstream, current.Name));
PopupHost.ShowAndStartPopup(new Merge(_repo, b, current.Name));
e.Handled = true;
};
submenu.Items.Add(fastForward);
@ -943,7 +948,7 @@ namespace SourceGit.ViewModels
merge.Click += (_, e) =>
{
if (PopupHost.CanCreatePopup())
PopupHost.ShowPopup(new Merge(_repo, branch.Name, current.Name));
PopupHost.ShowPopup(new Merge(_repo, branch, current.Name));
e.Handled = true;
};
submenu.Items.Add(merge);
@ -1027,7 +1032,7 @@ namespace SourceGit.ViewModels
merge.Click += (_, e) =>
{
if (PopupHost.CanCreatePopup())
PopupHost.ShowPopup(new Merge(_repo, name, current.Name));
PopupHost.ShowPopup(new Merge(_repo, branch, current.Name));
e.Handled = true;
};
@ -1086,7 +1091,7 @@ namespace SourceGit.ViewModels
merge.Click += (_, e) =>
{
if (PopupHost.CanCreatePopup())
PopupHost.ShowPopup(new Merge(_repo, tag.Name, current.Name));
PopupHost.ShowPopup(new Merge(_repo, tag, current.Name));
e.Handled = true;
};
submenu.Items.Add(merge);

View file

@ -5,7 +5,7 @@ namespace SourceGit.ViewModels
{
public class Merge : Popup
{
public string Source
public object Source
{
get;
}
@ -21,9 +21,22 @@ namespace SourceGit.ViewModels
set;
}
public Merge(Repository repo, string source, string into)
public Merge(Repository repo, Models.Branch source, string into)
{
_repo = repo;
_sourceName = source.FriendlyName;
Source = source;
Into = into;
SelectedMode = AutoSelectMergeMode();
View = new Views.Merge() { DataContext = this };
}
public Merge(Repository repo, Models.Tag source, string into)
{
_repo = repo;
_sourceName = source.Name;
Source = source;
Into = into;
SelectedMode = AutoSelectMergeMode();
@ -33,11 +46,11 @@ namespace SourceGit.ViewModels
public override Task<bool> Sure()
{
_repo.SetWatcherEnabled(false);
ProgressDescription = $"Merging '{Source}' into '{Into}' ...";
ProgressDescription = $"Merging '{_sourceName}' into '{Into}' ...";
return Task.Run(() =>
{
var succ = new Commands.Merge(_repo.FullPath, Source, SelectedMode.Arg, SetProgressDescription).Exec();
var succ = new Commands.Merge(_repo.FullPath, _sourceName, SelectedMode.Arg, SetProgressDescription).Exec();
CallUIThread(() => _repo.SetWatcherEnabled(true));
return succ;
});
@ -59,5 +72,6 @@ namespace SourceGit.ViewModels
}
private readonly Repository _repo = null;
private readonly string _sourceName = string.Empty;
}
}

View file

@ -1311,8 +1311,13 @@ namespace SourceGit.ViewModels
fastForward.IsEnabled = branch.TrackStatus.Ahead.Count == 0;
fastForward.Click += (_, e) =>
{
var b = _branches.Find(x => x.FriendlyName == upstream);
if (b == null)
return;
if (PopupHost.CanCreatePopup())
PopupHost.ShowAndStartPopup(new Merge(this, upstream, branch.Name));
PopupHost.ShowAndStartPopup(new Merge(this, b, branch.Name));
e.Handled = true;
};
@ -1391,7 +1396,7 @@ namespace SourceGit.ViewModels
merge.Click += (_, e) =>
{
if (PopupHost.CanCreatePopup())
PopupHost.ShowPopup(new Merge(this, branch.Name, _currentBranch.Name));
PopupHost.ShowPopup(new Merge(this, branch, _currentBranch.Name));
e.Handled = true;
};
@ -1687,7 +1692,7 @@ namespace SourceGit.ViewModels
merge.Click += (_, e) =>
{
if (PopupHost.CanCreatePopup())
PopupHost.ShowPopup(new Merge(this, name, _currentBranch.Name));
PopupHost.ShowPopup(new Merge(this, branch, _currentBranch.Name));
e.Handled = true;
};