mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-11-01 13:13:21 -07:00
feature: supports resolving multiple conflicts at once.
This commit is contained in:
parent
3783bdacbc
commit
f3f39ac593
8 changed files with 237 additions and 137 deletions
|
@ -28,17 +28,31 @@ namespace SourceGit.Commands
|
||||||
return Exec();
|
return Exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool File(string file, bool useTheirs)
|
public bool UseTheirs(List<string> files)
|
||||||
{
|
{
|
||||||
if (useTheirs)
|
StringBuilder builder = new StringBuilder();
|
||||||
|
builder.Append("checkout --theirs --");
|
||||||
|
foreach (var f in files)
|
||||||
{
|
{
|
||||||
Args = $"checkout --theirs -- \"{file}\"";
|
builder.Append(" \"");
|
||||||
}
|
builder.Append(f);
|
||||||
else
|
builder.Append("\"");
|
||||||
{
|
|
||||||
Args = $"checkout --ours -- \"{file}\"";
|
|
||||||
}
|
}
|
||||||
|
Args = builder.ToString();
|
||||||
|
return Exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool UseMine(List<string> files)
|
||||||
|
{
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
builder.Append("checkout --ours --");
|
||||||
|
foreach (var f in files)
|
||||||
|
{
|
||||||
|
builder.Append(" \"");
|
||||||
|
builder.Append(f);
|
||||||
|
builder.Append("\"");
|
||||||
|
}
|
||||||
|
Args = builder.ToString();
|
||||||
return Exec();
|
return Exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<StreamGeometry x:Key="Icons.Menu">M192 192m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0ZM192 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0ZM192 832m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0ZM864 160H352c-17.7 0-32 14.3-32 32s14.3 32 32 32h512c17.7 0 32-14.3 32-32s-14.3-32-32-32zM864 480H352c-17.7 0-32 14.3-32 32s14.3 32 32 32h512c17.7 0 32-14.3 32-32s-14.3-32-32-32zM864 800H352c-17.7 0-32 14.3-32 32s14.3 32 32 32h512c17.7 0 32-14.3 32-32s-14.3-32-32-32z</StreamGeometry>
|
<StreamGeometry x:Key="Icons.Menu">M192 192m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0ZM192 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0ZM192 832m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0ZM864 160H352c-17.7 0-32 14.3-32 32s14.3 32 32 32h512c17.7 0 32-14.3 32-32s-14.3-32-32-32zM864 480H352c-17.7 0-32 14.3-32 32s14.3 32 32 32h512c17.7 0 32-14.3 32-32s-14.3-32-32-32zM864 800H352c-17.7 0-32 14.3-32 32s14.3 32 32 32h512c17.7 0 32-14.3 32-32s-14.3-32-32-32z</StreamGeometry>
|
||||||
<StreamGeometry x:Key="Icons.Goback">M512 945c-238 0-433-195-433-433S274 79 512 79c238 0 433 195 433 433S750 945 512 945M512 0C228 0 0 228 0 512s228 512 512 512 512-228 512-512-228-512-512-512zM752 477H364l128-128a38 38 0 000-55 38 38 0 00-55 0l-185 183a55 55 0 00-16 39c0 16 6 30 16 39l185 185a39 39 0 0028 12 34 34 0 0028-14 38 38 0 000-55l-128-128h386c22 0 41-18 41-39a39 39 0 00-39-39</StreamGeometry>
|
<StreamGeometry x:Key="Icons.Goback">M512 945c-238 0-433-195-433-433S274 79 512 79c238 0 433 195 433 433S750 945 512 945M512 0C228 0 0 228 0 512s228 512 512 512 512-228 512-512-228-512-512-512zM752 477H364l128-128a38 38 0 000-55 38 38 0 00-55 0l-185 183a55 55 0 00-16 39c0 16 6 30 16 39l185 185a39 39 0 0028 12 34 34 0 0028-14 38 38 0 000-55l-128-128h386c22 0 41-18 41-39a39 39 0 00-39-39</StreamGeometry>
|
||||||
<StreamGeometry x:Key="Icons.Error">M576 832C576 867 547 896 512 896 477 896 448 867 448 832 448 797 477 768 512 768 547 768 576 797 576 832ZM512 256C477 256 448 285 448 320L448 640C448 675 477 704 512 704 547 704 576 675 576 640L576 320C576 285 547 256 512 256ZM1024 896C1024 967 967 1024 896 1024L128 1024C57 1024 0 967 0 896 0 875 5 855 14 837L14 837 398 69 398 69C420 28 462 0 512 0 562 0 604 28 626 69L1008 835C1018 853 1024 874 1024 896ZM960 896C960 885 957 875 952 865L952 864 951 863 569 98C557 77 536 64 512 64 488 64 466 77 455 99L452 105 92 825 93 825 71 867C66 876 64 886 64 896 64 931 93 960 128 960L896 960C931 960 960 931 960 896Z</StreamGeometry>
|
<StreamGeometry x:Key="Icons.Error">M576 832C576 867 547 896 512 896 477 896 448 867 448 832 448 797 477 768 512 768 547 768 576 797 576 832ZM512 256C477 256 448 285 448 320L448 640C448 675 477 704 512 704 547 704 576 675 576 640L576 320C576 285 547 256 512 256ZM1024 896C1024 967 967 1024 896 1024L128 1024C57 1024 0 967 0 896 0 875 5 855 14 837L14 837 398 69 398 69C420 28 462 0 512 0 562 0 604 28 626 69L1008 835C1018 853 1024 874 1024 896ZM960 896C960 885 957 875 952 865L952 864 951 863 569 98C557 77 536 64 512 64 488 64 466 77 455 99L452 105 92 825 93 825 71 867C66 876 64 886 64 896 64 931 93 960 128 960L896 960C931 960 960 931 960 896Z</StreamGeometry>
|
||||||
<StreamGeometry x:Key="Icons.Conflict">M352 64h320L960 352v320L672 960h-320L64 672v-320L352 64zm161 363L344 256 260 341 429 512l-169 171L344 768 513 597 682 768l85-85L598 512l169-171L682 256 513 427z</StreamGeometry>
|
<StreamGeometry x:Key="Icons.Conflict">M608 0q48 0 88 23t63 63 23 87v70h55q35 0 67 14t57 38 38 57 14 67V831q0 34-14 66t-38 57-57 38-67 13H426q-34 0-66-13t-57-38-38-57-14-66v-70h-56q-34 0-66-14t-57-38-38-57-13-67V174q0-47 23-87T109 23 196 0h412m175 244H426q-46 0-86 22T278 328t-26 85v348H608q47 0 86-22t63-62 25-85l1-348m-269 318q18 0 31 13t13 31-13 31-31 13-31-13-13-31 13-31 31-13m0-212q13 0 22 9t11 22v125q0 14-9 23t-22 10-23-7-11-22l-1-126q0-13 10-23t23-10z</StreamGeometry>
|
||||||
<StreamGeometry x:Key="Icons.Plus">m186 532 287 0 0 287c0 11 9 20 20 20s20-9 20-20l0-287 287 0c11 0 20-9 20-20s-9-20-20-20l-287 0 0-287c0-11-9-20-20-20s-20 9-20 20l0 287-287 0c-11 0-20 9-20 20s9 20 20 20z</StreamGeometry>
|
<StreamGeometry x:Key="Icons.Plus">m186 532 287 0 0 287c0 11 9 20 20 20s20-9 20-20l0-287 287 0c11 0 20-9 20-20s-9-20-20-20l-287 0 0-287c0-11-9-20-20-20s-20 9-20 20l0 287-287 0c-11 0-20 9-20 20s9 20 20 20z</StreamGeometry>
|
||||||
<StreamGeometry x:Key="Icons.Settings1">M716.3 383.1c0 38.4-6.5 76-19.4 111.8l-10.7 29.7 229.6 229.5c44.5 44.6 44.5 117.1 0 161.6a113.6 113.6 0 01-80.8 33.5a113.6 113.6 0 01-80.8-33.5L529 694l-32 13a331.6 331.6 0 01-111.9 19.4A333.5 333.5 0 0150 383.1c0-39 6.8-77.2 20-113.6L285 482l194-195-214-210A331 331 0 01383.1 50A333.5 333.5 0 01716.3 383.1zM231.6 31.6l-22.9 9.9a22.2 22.2 0 00-5.9 4.2a19.5 19.5 0 000 27.5l215 215.2L288.4 417.8 77.8 207.1a26 26 0 00-17.2-7.1a22.8 22.8 0 00-21.5 15a400.5 400.5 0 00-7.5 16.6A381.6 381.6 0 000 384c0 211.7 172.2 384 384 384c44.3 0 87.6-7.5 129-22.3L743.1 975.8A163.5 163.5 0 00859.5 1024c43.9 0 85.3-17.1 116.4-48.2a164.8 164.8 0 000-233L745.5 513C760.5 471.5 768 428 768 384C768 172 596 0 384 0c-53 0-104 10.5-152.5 31.5z</StreamGeometry>
|
<StreamGeometry x:Key="Icons.Settings1">M716.3 383.1c0 38.4-6.5 76-19.4 111.8l-10.7 29.7 229.6 229.5c44.5 44.6 44.5 117.1 0 161.6a113.6 113.6 0 01-80.8 33.5a113.6 113.6 0 01-80.8-33.5L529 694l-32 13a331.6 331.6 0 01-111.9 19.4A333.5 333.5 0 0150 383.1c0-39 6.8-77.2 20-113.6L285 482l194-195-214-210A331 331 0 01383.1 50A333.5 333.5 0 01716.3 383.1zM231.6 31.6l-22.9 9.9a22.2 22.2 0 00-5.9 4.2a19.5 19.5 0 000 27.5l215 215.2L288.4 417.8 77.8 207.1a26 26 0 00-17.2-7.1a22.8 22.8 0 00-21.5 15a400.5 400.5 0 00-7.5 16.6A381.6 381.6 0 000 384c0 211.7 172.2 384 384 384c44.3 0 87.6-7.5 129-22.3L743.1 975.8A163.5 163.5 0 00859.5 1024c43.9 0 85.3-17.1 116.4-48.2a164.8 164.8 0 000-233L745.5 513C760.5 471.5 768 428 768 384C768 172 596 0 384 0c-53 0-104 10.5-152.5 31.5z</StreamGeometry>
|
||||||
<StreamGeometry x:Key="Icons.Settings2">M928 500a21 21 0 00-19-20L858 472a11 11 0 01-9-9c-1-6-2-13-3-19a11 11 0 015-12l46-25a21 21 0 0010-26l-8-22a21 21 0 00-24-13l-51 10a11 11 0 01-12-6c-3-6-6-11-10-17a11 11 0 011-13l34-39a21 21 0 001-28l-15-18a20 20 0 00-27-4l-45 27a11 11 0 01-13-1c-5-4-10-9-15-12a11 11 0 01-3-12l19-49a21 21 0 00-9-26l-20-12a21 21 0 00-27 6L650 193a9 9 0 01-11 3c-1-1-12-5-20-7a11 11 0 01-7-10l1-52a21 21 0 00-17-22l-23-4a21 21 0 00-24 14L532 164a11 11 0 01-11 7h-20a11 11 0 01-11-7l-17-49a21 21 0 00-24-15l-23 4a21 21 0 00-17 22l1 52a11 11 0 01-8 11c-5 2-15 6-19 7c-4 1-8 0-12-4l-33-40A21 21 0 00313 146l-20 12A21 21 0 00285 184l19 49a11 11 0 01-3 12c-5 4-10 8-15 12a11 11 0 01-13 1L228 231a21 21 0 00-27 4L186 253a21 21 0 001 28L221 320a11 11 0 011 13c-3 5-7 11-10 17a11 11 0 01-12 6l-51-10a21 21 0 00-24 13l-8 22a21 21 0 0010 26l46 25a11 11 0 015 12l0 3c-1 6-2 11-3 16a11 11 0 01-9 9l-51 8A21 21 0 0096 500v23A21 21 0 00114 544l51 8a11 11 0 019 9c1 6 2 13 3 19a11 11 0 01-5 12l-46 25a21 21 0 00-10 26l8 22a21 21 0 0024 13l51-10a11 11 0 0112 6c3 6 6 11 10 17a11 11 0 01-1 13l-34 39a21 21 0 00-1 28l15 18a20 20 0 0027 4l45-27a11 11 0 0113 1c5 4 10 9 15 12a11 11 0 013 12l-19 49a21 21 0 009 26l20 12a21 21 0 0027-6L374 832c3-3 7-5 10-4c7 3 12 5 20 7a11 11 0 018 10l-1 52a21 21 0 0017 22l23 4a21 21 0 0024-14l17-50a11 11 0 0111-7h20a11 11 0 0111 7l17 49a21 21 0 0020 15a19 19 0 004 0l23-4a21 21 0 0017-22l-1-52a11 11 0 018-10c8-3 13-5 18-7l1 0c6-2 9 0 11 3l34 41A21 21 0 00710 878l20-12a21 21 0 009-26l-18-49a11 11 0 013-12c5-4 10-8 15-12a11 11 0 0113-1l45 27a21 21 0 0027-4l15-18a21 21 0 00-1-28l-34-39a11 11 0 01-1-13c3-5 7-11 10-17a11 11 0 0112-6l51 10a21 21 0 0024-13l8-22a21 21 0 00-10-26l-46-25a11 11 0 01-5-12l0-3c1-6 2-11 3-16a11 11 0 019-9l51-8a21 21 0 0018-21v-23zm-565 188a32 32 0 01-51 5a270 270 0 011-363a32 32 0 0151 6l91 161a32 32 0 010 31zM512 782a270 270 0 01-57-6a32 32 0 01-20-47l92-160a32 32 0 0127-16h184a32 32 0 0130 41c-35 109-137 188-257 188zm15-328L436 294a32 32 0 0121-47a268 268 0 0155-6c120 0 222 79 257 188a32 32 0 01-30 41h-184a32 32 0 01-28-16z</StreamGeometry>
|
<StreamGeometry x:Key="Icons.Settings2">M928 500a21 21 0 00-19-20L858 472a11 11 0 01-9-9c-1-6-2-13-3-19a11 11 0 015-12l46-25a21 21 0 0010-26l-8-22a21 21 0 00-24-13l-51 10a11 11 0 01-12-6c-3-6-6-11-10-17a11 11 0 011-13l34-39a21 21 0 001-28l-15-18a20 20 0 00-27-4l-45 27a11 11 0 01-13-1c-5-4-10-9-15-12a11 11 0 01-3-12l19-49a21 21 0 00-9-26l-20-12a21 21 0 00-27 6L650 193a9 9 0 01-11 3c-1-1-12-5-20-7a11 11 0 01-7-10l1-52a21 21 0 00-17-22l-23-4a21 21 0 00-24 14L532 164a11 11 0 01-11 7h-20a11 11 0 01-11-7l-17-49a21 21 0 00-24-15l-23 4a21 21 0 00-17 22l1 52a11 11 0 01-8 11c-5 2-15 6-19 7c-4 1-8 0-12-4l-33-40A21 21 0 00313 146l-20 12A21 21 0 00285 184l19 49a11 11 0 01-3 12c-5 4-10 8-15 12a11 11 0 01-13 1L228 231a21 21 0 00-27 4L186 253a21 21 0 001 28L221 320a11 11 0 011 13c-3 5-7 11-10 17a11 11 0 01-12 6l-51-10a21 21 0 00-24 13l-8 22a21 21 0 0010 26l46 25a11 11 0 015 12l0 3c-1 6-2 11-3 16a11 11 0 01-9 9l-51 8A21 21 0 0096 500v23A21 21 0 00114 544l51 8a11 11 0 019 9c1 6 2 13 3 19a11 11 0 01-5 12l-46 25a21 21 0 00-10 26l8 22a21 21 0 0024 13l51-10a11 11 0 0112 6c3 6 6 11 10 17a11 11 0 01-1 13l-34 39a21 21 0 00-1 28l15 18a20 20 0 0027 4l45-27a11 11 0 0113 1c5 4 10 9 15 12a11 11 0 013 12l-19 49a21 21 0 009 26l20 12a21 21 0 0027-6L374 832c3-3 7-5 10-4c7 3 12 5 20 7a11 11 0 018 10l-1 52a21 21 0 0017 22l23 4a21 21 0 0024-14l17-50a11 11 0 0111-7h20a11 11 0 0111 7l17 49a21 21 0 0020 15a19 19 0 004 0l23-4a21 21 0 0017-22l-1-52a11 11 0 018-10c8-3 13-5 18-7l1 0c6-2 9 0 11 3l34 41A21 21 0 00710 878l20-12a21 21 0 009-26l-18-49a11 11 0 013-12c5-4 10-8 15-12a11 11 0 0113-1l45 27a21 21 0 0027-4l15-18a21 21 0 00-1-28l-34-39a11 11 0 01-1-13c3-5 7-11 10-17a11 11 0 0112-6l51 10a21 21 0 0024-13l8-22a21 21 0 00-10-26l-46-25a11 11 0 01-5-12l0-3c1-6 2-11 3-16a11 11 0 019-9l51-8a21 21 0 0018-21v-23zm-565 188a32 32 0 01-51 5a270 270 0 011-363a32 32 0 0151 6l91 161a32 32 0 010 31zM512 782a270 270 0 01-57-6a32 32 0 01-20-47l92-160a32 32 0 0127-16h184a32 32 0 0130 41c-35 109-137 188-257 188zm15-328L436 294a32 32 0 0121-47a268 268 0 0155-6c120 0 222 79 257 188a32 32 0 01-30 41h-184a32 32 0 01-28-16z</StreamGeometry>
|
||||||
|
@ -88,4 +88,6 @@
|
||||||
<StreamGeometry x:Key="Icons.SyntaxHighlight">M875 128h-725A107 107 0 0043 235v555A107 107 0 00149 896h725a107 107 0 00107-107v-555A107 107 0 00875 128zm-115 640h-183v-58l25-3c15 0 19-8 14-24l-22-61H419l-28 82 39 2V768h-166v-58l18-3c18-2 22-11 26-24l125-363-40-4V256h168l160 448 39 3zM506 340l-72 218h145l-71-218h-2z</StreamGeometry>
|
<StreamGeometry x:Key="Icons.SyntaxHighlight">M875 128h-725A107 107 0 0043 235v555A107 107 0 00149 896h725a107 107 0 00107-107v-555A107 107 0 00875 128zm-115 640h-183v-58l25-3c15 0 19-8 14-24l-22-61H419l-28 82 39 2V768h-166v-58l18-3c18-2 22-11 26-24l125-363-40-4V256h168l160 448 39 3zM506 340l-72 218h145l-71-218h-2z</StreamGeometry>
|
||||||
<StreamGeometry x:Key="Icons.SoftwareUpdate">M900 287c40 69 60 144 60 225s-20 156-60 225c-40 69-94 123-163 163-69 40-144 60-225 60s-156-20-225-60c-69-40-123-94-163-163C84 668 64 593 64 512s20-156 60-225 94-123 163-163c69-40 144-60 225-60s156 20 225 60 123 94 163 163zM762 512c0-9-3-16-9-22L578 315l-44-44c-6-6-13-9-22-9s-16 3-22 9l-44 44-176 176c-6 6-9 13-9 22s3 16 9 22l44 44c6 6 13 9 22 9s16-3 22-9l92-92v269c0 9 3 16 9 22 6 6 13 9 22 9h62c8 0 16-3 22-9 6-6 9-13 9-22V486l92 92c6 6 13 9 22 9 8 0 16-3 22-9l44-44c6-6 9-13 9-22z</StreamGeometry>
|
<StreamGeometry x:Key="Icons.SoftwareUpdate">M900 287c40 69 60 144 60 225s-20 156-60 225c-40 69-94 123-163 163-69 40-144 60-225 60s-156-20-225-60c-69-40-123-94-163-163C84 668 64 593 64 512s20-156 60-225 94-123 163-163c69-40 144-60 225-60s156 20 225 60 123 94 163 163zM762 512c0-9-3-16-9-22L578 315l-44-44c-6-6-13-9-22-9s-16 3-22 9l-44 44-176 176c-6 6-9 13-9 22s3 16 9 22l44 44c6 6 13 9 22 9s16-3 22-9l92-92v269c0 9 3 16 9 22 6 6 13 9 22 9h62c8 0 16-3 22-9 6-6 9-13 9-22V486l92 92c6 6 13 9 22 9 8 0 16-3 22-9l44-44c6-6 9-13 9-22z</StreamGeometry>
|
||||||
<StreamGeometry x:Key="Icons.Target">M765 555C747 661 661 747 555 765L555 683 469 683 469 765C363 747 277 661 259 555L341 555 341 469 259 469C277 363 363 277 469 259L469 341 555 341 555 259C661 277 747 363 765 469L683 469 683 555 765 555M851 469C832 315 709 192 555 173L555 85 469 85 469 173C315 192 192 315 173 469L85 469 85 555 173 555C192 709 315 832 469 851L469 939 555 939 555 851C709 832 832 709 851 555L939 555 939 469 851 469M512 427C559 427 597 465 597 512 597 559 559 597 512 597 465 597 427 559 427 512 427 465 465 427 512 427L512 427Z</StreamGeometry>
|
<StreamGeometry x:Key="Icons.Target">M765 555C747 661 661 747 555 765L555 683 469 683 469 765C363 747 277 661 259 555L341 555 341 469 259 469C277 363 363 277 469 259L469 341 555 341 555 259C661 277 747 363 765 469L683 469 683 555 765 555M851 469C832 315 709 192 555 173L555 85 469 85 469 173C315 192 192 315 173 469L85 469 85 555 173 555C192 709 315 832 469 851L469 939 555 939 555 851C709 832 832 709 851 555L939 555 939 469 851 469M512 427C559 427 597 465 597 512 597 559 559 597 512 597 465 597 427 559 427 512 427 465 465 427 512 427L512 427Z</StreamGeometry>
|
||||||
|
<StreamGeometry x:Key="Icons.Incoming">M973 358a51 51 0 0151 51v563a51 51 0 01-51 51H51a51 51 0 01-51-51V410a51 51 0 0151-51h256a51 51 0 110 102H102v461h819V461h-205a51 51 0 110-102h256zM51 102a51 51 0 110-102h256c141 0 256 115 256 256v388l66-66a51 51 0 1172 72l-154 154a51 51 0 01-72 0l-154-154a51 51 0 1172-72L461 644V256c0-85-69-154-154-154H51z</StreamGeometry>
|
||||||
|
<StreamGeometry x:Key="Icons.Local">M976 0h-928A48 48 0 000 48v652a48 48 0 0048 48h416V928H200a48 48 0 000 96h624a48 48 0 000-96H560v-180h416a48 48 0 0048-48V48A48 48 0 00976 0zM928 652H96V96h832v556z</StreamGeometry>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|
|
@ -160,6 +160,7 @@
|
||||||
<x:String x:Key="Text.FileCM.Discard" xml:space="preserve">Discard...</x:String>
|
<x:String x:Key="Text.FileCM.Discard" xml:space="preserve">Discard...</x:String>
|
||||||
<x:String x:Key="Text.FileCM.DiscardMulti" xml:space="preserve">Discard {0} files...</x:String>
|
<x:String x:Key="Text.FileCM.DiscardMulti" xml:space="preserve">Discard {0} files...</x:String>
|
||||||
<x:String x:Key="Text.FileCM.DiscardSelectedLines" xml:space="preserve">Discard Changes in Selected Line(s)</x:String>
|
<x:String x:Key="Text.FileCM.DiscardSelectedLines" xml:space="preserve">Discard Changes in Selected Line(s)</x:String>
|
||||||
|
<x:String x:Key="Text.FileCM.OpenWithExternalMerger" xml:space="preserve">Open External Merge Tool</x:String>
|
||||||
<x:String x:Key="Text.FileCM.SaveAsPatch" xml:space="preserve">Save As Patch...</x:String>
|
<x:String x:Key="Text.FileCM.SaveAsPatch" xml:space="preserve">Save As Patch...</x:String>
|
||||||
<x:String x:Key="Text.FileCM.Stage" xml:space="preserve">Stage...</x:String>
|
<x:String x:Key="Text.FileCM.Stage" xml:space="preserve">Stage...</x:String>
|
||||||
<x:String x:Key="Text.FileCM.StageMulti" xml:space="preserve">Stage {0} files...</x:String>
|
<x:String x:Key="Text.FileCM.StageMulti" xml:space="preserve">Stage {0} files...</x:String>
|
||||||
|
@ -169,6 +170,8 @@
|
||||||
<x:String x:Key="Text.FileCM.Unstage" xml:space="preserve">Unstage</x:String>
|
<x:String x:Key="Text.FileCM.Unstage" xml:space="preserve">Unstage</x:String>
|
||||||
<x:String x:Key="Text.FileCM.UnstageMulti" xml:space="preserve">Unstage {0} files</x:String>
|
<x:String x:Key="Text.FileCM.UnstageMulti" xml:space="preserve">Unstage {0} files</x:String>
|
||||||
<x:String x:Key="Text.FileCM.UnstageSelectedLines" xml:space="preserve">Unstage Changes in Selected Line(s)</x:String>
|
<x:String x:Key="Text.FileCM.UnstageSelectedLines" xml:space="preserve">Unstage Changes in Selected Line(s)</x:String>
|
||||||
|
<x:String x:Key="Text.FileCM.UseTheirs" xml:space="preserve">Use Theirs (checkout --theirs)</x:String>
|
||||||
|
<x:String x:Key="Text.FileCM.UseMine" xml:space="preserve">Use Mine (checkout --ours)</x:String>
|
||||||
<x:String x:Key="Text.FileHistory" xml:space="preserve">File History</x:String>
|
<x:String x:Key="Text.FileHistory" xml:space="preserve">File History</x:String>
|
||||||
<x:String x:Key="Text.Filter" xml:space="preserve">FILTER</x:String>
|
<x:String x:Key="Text.Filter" xml:space="preserve">FILTER</x:String>
|
||||||
<x:String x:Key="Text.GitFlow" xml:space="preserve">Git-Flow</x:String>
|
<x:String x:Key="Text.GitFlow" xml:space="preserve">Git-Flow</x:String>
|
||||||
|
@ -431,7 +434,6 @@
|
||||||
<x:String x:Key="Text.WorkingCopy.IncludeUntracked" xml:space="preserve">INCLUDE UNTRACKED FILES</x:String>
|
<x:String x:Key="Text.WorkingCopy.IncludeUntracked" xml:space="preserve">INCLUDE UNTRACKED FILES</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.MessageHistories" xml:space="preserve">MESSAGE HISTORIES</x:String>
|
<x:String x:Key="Text.WorkingCopy.MessageHistories" xml:space="preserve">MESSAGE HISTORIES</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.NoCommitHistories" xml:space="preserve">NO RECENT INPUT MESSAGES</x:String>
|
<x:String x:Key="Text.WorkingCopy.NoCommitHistories" xml:space="preserve">NO RECENT INPUT MESSAGES</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.OpenMerger" xml:space="preserve">OPEN MERGE</x:String>
|
|
||||||
<x:String x:Key="Text.WorkingCopy.Staged" xml:space="preserve">STAGED</x:String>
|
<x:String x:Key="Text.WorkingCopy.Staged" xml:space="preserve">STAGED</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Staged.Unstage" xml:space="preserve">UNSTAGE</x:String>
|
<x:String x:Key="Text.WorkingCopy.Staged.Unstage" xml:space="preserve">UNSTAGE</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Staged.UnstageAll" xml:space="preserve">UNSTAGE ALL</x:String>
|
<x:String x:Key="Text.WorkingCopy.Staged.UnstageAll" xml:space="preserve">UNSTAGE ALL</x:String>
|
||||||
|
@ -439,6 +441,5 @@
|
||||||
<x:String x:Key="Text.WorkingCopy.Unstaged.Stage" xml:space="preserve">STAGE</x:String>
|
<x:String x:Key="Text.WorkingCopy.Unstaged.Stage" xml:space="preserve">STAGE</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Unstaged.StageAll" xml:space="preserve">STAGE ALL</x:String>
|
<x:String x:Key="Text.WorkingCopy.Unstaged.StageAll" xml:space="preserve">STAGE ALL</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Unstaged.ViewAssumeUnchaged" xml:space="preserve">VIEW ASSUME UNCHANGED</x:String>
|
<x:String x:Key="Text.WorkingCopy.Unstaged.ViewAssumeUnchaged" xml:space="preserve">VIEW ASSUME UNCHANGED</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.UseMine" xml:space="preserve">USE MINE</x:String>
|
<x:String x:Key="Text.WorkingCopy.ResolveTip" xml:space="preserve">Right-click the selected file(s), and make your choice to resolve conflicts.</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.UseTheirs" xml:space="preserve">USE THEIRS</x:String>
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|
|
@ -160,6 +160,7 @@
|
||||||
<x:String x:Key="Text.FileCM.Discard" xml:space="preserve">放弃更改...</x:String>
|
<x:String x:Key="Text.FileCM.Discard" xml:space="preserve">放弃更改...</x:String>
|
||||||
<x:String x:Key="Text.FileCM.DiscardMulti" xml:space="preserve">放弃 {0} 个文件的更改...</x:String>
|
<x:String x:Key="Text.FileCM.DiscardMulti" xml:space="preserve">放弃 {0} 个文件的更改...</x:String>
|
||||||
<x:String x:Key="Text.FileCM.DiscardSelectedLines" xml:space="preserve">放弃选中的更改</x:String>
|
<x:String x:Key="Text.FileCM.DiscardSelectedLines" xml:space="preserve">放弃选中的更改</x:String>
|
||||||
|
<x:String x:Key="Text.FileCM.OpenWithExternalMerger" xml:space="preserve">使用外部合并工具打开</x:String>
|
||||||
<x:String x:Key="Text.FileCM.SaveAsPatch" xml:space="preserve">另存为补丁...</x:String>
|
<x:String x:Key="Text.FileCM.SaveAsPatch" xml:space="preserve">另存为补丁...</x:String>
|
||||||
<x:String x:Key="Text.FileCM.Stage" xml:space="preserve">暂存(add)...</x:String>
|
<x:String x:Key="Text.FileCM.Stage" xml:space="preserve">暂存(add)...</x:String>
|
||||||
<x:String x:Key="Text.FileCM.StageMulti" xml:space="preserve">暂存(add){0} 个文件...</x:String>
|
<x:String x:Key="Text.FileCM.StageMulti" xml:space="preserve">暂存(add){0} 个文件...</x:String>
|
||||||
|
@ -169,6 +170,8 @@
|
||||||
<x:String x:Key="Text.FileCM.Unstage" xml:space="preserve">从暂存中移除</x:String>
|
<x:String x:Key="Text.FileCM.Unstage" xml:space="preserve">从暂存中移除</x:String>
|
||||||
<x:String x:Key="Text.FileCM.UnstageMulti" xml:space="preserve">从暂存中移除 {0} 个文件</x:String>
|
<x:String x:Key="Text.FileCM.UnstageMulti" xml:space="preserve">从暂存中移除 {0} 个文件</x:String>
|
||||||
<x:String x:Key="Text.FileCM.UnstageSelectedLines" xml:space="preserve">从暂存中移除选中的更改</x:String>
|
<x:String x:Key="Text.FileCM.UnstageSelectedLines" xml:space="preserve">从暂存中移除选中的更改</x:String>
|
||||||
|
<x:String x:Key="Text.FileCM.UseTheirs" xml:space="preserve">使用 THEIRS (checkout --theirs)</x:String>
|
||||||
|
<x:String x:Key="Text.FileCM.UseMine" xml:space="preserve">使用 MINE (checkout --ours)</x:String>
|
||||||
<x:String x:Key="Text.FileHistory" xml:space="preserve">文件历史</x:String>
|
<x:String x:Key="Text.FileHistory" xml:space="preserve">文件历史</x:String>
|
||||||
<x:String x:Key="Text.Filter" xml:space="preserve">过滤</x:String>
|
<x:String x:Key="Text.Filter" xml:space="preserve">过滤</x:String>
|
||||||
<x:String x:Key="Text.GitFlow" xml:space="preserve">GIT工作流</x:String>
|
<x:String x:Key="Text.GitFlow" xml:space="preserve">GIT工作流</x:String>
|
||||||
|
@ -431,7 +434,6 @@
|
||||||
<x:String x:Key="Text.WorkingCopy.IncludeUntracked" xml:space="preserve">显示未跟踪文件</x:String>
|
<x:String x:Key="Text.WorkingCopy.IncludeUntracked" xml:space="preserve">显示未跟踪文件</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.MessageHistories" xml:space="preserve">历史提交信息</x:String>
|
<x:String x:Key="Text.WorkingCopy.MessageHistories" xml:space="preserve">历史提交信息</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.NoCommitHistories" xml:space="preserve">没有提交信息记录</x:String>
|
<x:String x:Key="Text.WorkingCopy.NoCommitHistories" xml:space="preserve">没有提交信息记录</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.OpenMerger" xml:space="preserve">打开合并工具</x:String>
|
|
||||||
<x:String x:Key="Text.WorkingCopy.Staged" xml:space="preserve">已暂存</x:String>
|
<x:String x:Key="Text.WorkingCopy.Staged" xml:space="preserve">已暂存</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Staged.Unstage" xml:space="preserve">从暂存区移除选中</x:String>
|
<x:String x:Key="Text.WorkingCopy.Staged.Unstage" xml:space="preserve">从暂存区移除选中</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Staged.UnstageAll" xml:space="preserve">从暂存区移除所有</x:String>
|
<x:String x:Key="Text.WorkingCopy.Staged.UnstageAll" xml:space="preserve">从暂存区移除所有</x:String>
|
||||||
|
@ -439,6 +441,5 @@
|
||||||
<x:String x:Key="Text.WorkingCopy.Unstaged.Stage" xml:space="preserve">暂存选中</x:String>
|
<x:String x:Key="Text.WorkingCopy.Unstaged.Stage" xml:space="preserve">暂存选中</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Unstaged.StageAll" xml:space="preserve">暂存所有</x:String>
|
<x:String x:Key="Text.WorkingCopy.Unstaged.StageAll" xml:space="preserve">暂存所有</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.Unstaged.ViewAssumeUnchaged" xml:space="preserve">查看忽略变更文件</x:String>
|
<x:String x:Key="Text.WorkingCopy.Unstaged.ViewAssumeUnchaged" xml:space="preserve">查看忽略变更文件</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.UseMine" xml:space="preserve">使用MINE</x:String>
|
<x:String x:Key="Text.WorkingCopy.ResolveTip" xml:space="preserve">请选中冲突文件,打开右键菜单,选择合适的解决方式</x:String>
|
||||||
<x:String x:Key="Text.WorkingCopy.UseTheirs" xml:space="preserve">使用THEIRS</x:String>
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|
|
@ -129,6 +129,7 @@ namespace SourceGit.ViewModels
|
||||||
{
|
{
|
||||||
var commit = commits[0] as Models.Commit;
|
var commit = commits[0] as Models.Commit;
|
||||||
AutoSelectedCommit = commit;
|
AutoSelectedCommit = commit;
|
||||||
|
NavigationId = _navigationId + 1;
|
||||||
|
|
||||||
if (_detailContext is CommitDetail detail)
|
if (_detailContext is CommitDetail detail)
|
||||||
{
|
{
|
||||||
|
|
|
@ -386,34 +386,42 @@ namespace SourceGit.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void UseTheirs()
|
public async void UseTheirs(List<Models.Change> changes)
|
||||||
{
|
{
|
||||||
if (_detailContext is ConflictContext ctx)
|
var files = new List<string>();
|
||||||
|
foreach (var change in changes)
|
||||||
{
|
{
|
||||||
_repo.SetWatcherEnabled(false);
|
if (change.IsConflit)
|
||||||
var succ = await Task.Run(() => new Commands.Checkout(_repo.FullPath).File(ctx.Change.Path, true));
|
files.Add(change.Path);
|
||||||
if (succ)
|
|
||||||
{
|
|
||||||
await Task.Run(() => new Commands.Add(_repo.FullPath, [ctx.Change]).Exec());
|
|
||||||
}
|
|
||||||
_repo.MarkWorkingCopyDirtyManually();
|
|
||||||
_repo.SetWatcherEnabled(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_repo.SetWatcherEnabled(false);
|
||||||
|
var succ = await Task.Run(() => new Commands.Checkout(_repo.FullPath).UseTheirs(files));
|
||||||
|
if (succ)
|
||||||
|
{
|
||||||
|
await Task.Run(() => new Commands.Add(_repo.FullPath, changes).Exec());
|
||||||
|
}
|
||||||
|
_repo.MarkWorkingCopyDirtyManually();
|
||||||
|
_repo.SetWatcherEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void UseMine()
|
public async void UseMine(List<Models.Change> changes)
|
||||||
{
|
{
|
||||||
if (_detailContext is ConflictContext ctx)
|
var files = new List<string>();
|
||||||
|
foreach (var change in changes)
|
||||||
{
|
{
|
||||||
_repo.SetWatcherEnabled(false);
|
if (change.IsConflit)
|
||||||
var succ = await Task.Run(() => new Commands.Checkout(_repo.FullPath).File(ctx.Change.Path, false));
|
files.Add(change.Path);
|
||||||
if (succ)
|
|
||||||
{
|
|
||||||
await Task.Run(() => new Commands.Add(_repo.FullPath, [ctx.Change]).Exec());
|
|
||||||
}
|
|
||||||
_repo.MarkWorkingCopyDirtyManually();
|
|
||||||
_repo.SetWatcherEnabled(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_repo.SetWatcherEnabled(false);
|
||||||
|
var succ = await Task.Run(() => new Commands.Checkout(_repo.FullPath).UseMine(files));
|
||||||
|
if (succ)
|
||||||
|
{
|
||||||
|
await Task.Run(() => new Commands.Add(_repo.FullPath, changes).Exec());
|
||||||
|
}
|
||||||
|
_repo.MarkWorkingCopyDirtyManually();
|
||||||
|
_repo.SetWatcherEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void UseExternalMergeTool()
|
public async void UseExternalMergeTool()
|
||||||
|
@ -499,6 +507,7 @@ namespace SourceGit.ViewModels
|
||||||
Native.OS.OpenInFileManager(path, true);
|
Native.OS.OpenInFileManager(path, true);
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
};
|
};
|
||||||
|
menu.Items.Add(explore);
|
||||||
|
|
||||||
var openWith = new MenuItem();
|
var openWith = new MenuItem();
|
||||||
openWith.Header = App.Text("OpenWith");
|
openWith.Header = App.Text("OpenWith");
|
||||||
|
@ -509,82 +518,130 @@ namespace SourceGit.ViewModels
|
||||||
Native.OS.OpenWithDefaultEditor(path);
|
Native.OS.OpenWithDefaultEditor(path);
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
};
|
};
|
||||||
|
menu.Items.Add(openWith);
|
||||||
|
menu.Items.Add(new MenuItem() { Header = "-" });
|
||||||
|
|
||||||
var stage = new MenuItem();
|
if (change.IsConflit)
|
||||||
stage.Header = App.Text("FileCM.Stage");
|
|
||||||
stage.Icon = App.CreateMenuIcon("Icons.File.Add");
|
|
||||||
stage.Click += (_, e) =>
|
|
||||||
{
|
{
|
||||||
StageChanges(changes);
|
var useTheirs = new MenuItem();
|
||||||
e.Handled = true;
|
useTheirs.Icon = App.CreateMenuIcon("Icons.Incoming");
|
||||||
};
|
useTheirs.Header = App.Text("FileCM.UseTheirs");
|
||||||
|
useTheirs.Click += (_, e) =>
|
||||||
var discard = new MenuItem();
|
|
||||||
discard.Header = App.Text("FileCM.Discard");
|
|
||||||
discard.Icon = App.CreateMenuIcon("Icons.Undo");
|
|
||||||
discard.Click += (_, e) =>
|
|
||||||
{
|
|
||||||
Discard(changes, true);
|
|
||||||
e.Handled = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
var stash = new MenuItem();
|
|
||||||
stash.Header = App.Text("FileCM.Stash");
|
|
||||||
stash.Icon = App.CreateMenuIcon("Icons.Stashes");
|
|
||||||
stash.Click += (_, e) =>
|
|
||||||
{
|
|
||||||
if (PopupHost.CanCreatePopup())
|
|
||||||
{
|
{
|
||||||
PopupHost.ShowPopup(new StashChanges(_repo, changes, false));
|
UseTheirs(changes);
|
||||||
}
|
e.Handled = true;
|
||||||
e.Handled = true;
|
};
|
||||||
};
|
|
||||||
|
var useMine = new MenuItem();
|
||||||
var patch = new MenuItem();
|
useMine.Icon = App.CreateMenuIcon("Icons.Local");
|
||||||
patch.Header = App.Text("FileCM.SaveAsPatch");
|
useMine.Header = App.Text("FileCM.UseMine");
|
||||||
patch.Icon = App.CreateMenuIcon("Icons.Diff");
|
useMine.Click += (_, e) =>
|
||||||
patch.Click += async (_, e) =>
|
|
||||||
{
|
|
||||||
var topLevel = App.GetTopLevel();
|
|
||||||
if (topLevel == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
var options = new FilePickerSaveOptions();
|
|
||||||
options.Title = App.Text("FileCM.SaveAsPatch");
|
|
||||||
options.DefaultExtension = ".patch";
|
|
||||||
options.FileTypeChoices = [new FilePickerFileType("Patch File") { Patterns = ["*.patch"] }];
|
|
||||||
|
|
||||||
var storageFile = await topLevel.StorageProvider.SaveFilePickerAsync(options);
|
|
||||||
if (storageFile != null)
|
|
||||||
{
|
{
|
||||||
var succ = await Task.Run(() => Commands.SaveChangesAsPatch.Exec(_repo.FullPath, changes, true, storageFile.Path.LocalPath));
|
UseMine(changes);
|
||||||
if (succ)
|
e.Handled = true;
|
||||||
App.SendNotification(_repo.FullPath, App.Text("SaveAsPatchSuccess"));
|
};
|
||||||
}
|
|
||||||
|
|
||||||
e.Handled = true;
|
var openMerger = new MenuItem();
|
||||||
};
|
openMerger.Icon = App.CreateMenuIcon("Icons.OpenWith");
|
||||||
|
openMerger.Header = App.Text("FileCM.OpenWithExternalMerger");
|
||||||
|
openMerger.Click += (_, e) =>
|
||||||
|
{
|
||||||
|
UseExternalMergeTool();
|
||||||
|
e.Handled = true;
|
||||||
|
};
|
||||||
|
|
||||||
var history = new MenuItem();
|
menu.Items.Add(useTheirs);
|
||||||
history.Header = App.Text("FileHistory");
|
menu.Items.Add(useMine);
|
||||||
history.Icon = App.CreateMenuIcon("Icons.Histories");
|
menu.Items.Add(openMerger);
|
||||||
history.Click += (_, e) =>
|
menu.Items.Add(new MenuItem() { Header = "-" });
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
var window = new Views.FileHistories() { DataContext = new FileHistories(_repo.FullPath, change.Path) };
|
var stage = new MenuItem();
|
||||||
window.Show();
|
stage.Header = App.Text("FileCM.Stage");
|
||||||
e.Handled = true;
|
stage.Icon = App.CreateMenuIcon("Icons.File.Add");
|
||||||
};
|
stage.Click += (_, e) =>
|
||||||
|
{
|
||||||
|
StageChanges(changes);
|
||||||
|
e.Handled = true;
|
||||||
|
};
|
||||||
|
|
||||||
var assumeUnchanged = new MenuItem();
|
var discard = new MenuItem();
|
||||||
assumeUnchanged.Header = App.Text("FileCM.AssumeUnchanged");
|
discard.Header = App.Text("FileCM.Discard");
|
||||||
assumeUnchanged.Icon = App.CreateMenuIcon("Icons.File.Ignore");
|
discard.Icon = App.CreateMenuIcon("Icons.Undo");
|
||||||
assumeUnchanged.IsEnabled = change.WorkTree != Models.ChangeState.Untracked;
|
discard.Click += (_, e) =>
|
||||||
assumeUnchanged.Click += (_, e) =>
|
{
|
||||||
{
|
Discard(changes, true);
|
||||||
new Commands.AssumeUnchanged(_repo.FullPath).Add(change.Path);
|
e.Handled = true;
|
||||||
e.Handled = true;
|
};
|
||||||
};
|
|
||||||
|
|
||||||
|
var stash = new MenuItem();
|
||||||
|
stash.Header = App.Text("FileCM.Stash");
|
||||||
|
stash.Icon = App.CreateMenuIcon("Icons.Stashes");
|
||||||
|
stash.Click += (_, e) =>
|
||||||
|
{
|
||||||
|
if (PopupHost.CanCreatePopup())
|
||||||
|
{
|
||||||
|
PopupHost.ShowPopup(new StashChanges(_repo, changes, false));
|
||||||
|
}
|
||||||
|
e.Handled = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
var patch = new MenuItem();
|
||||||
|
patch.Header = App.Text("FileCM.SaveAsPatch");
|
||||||
|
patch.Icon = App.CreateMenuIcon("Icons.Diff");
|
||||||
|
patch.Click += async (_, e) =>
|
||||||
|
{
|
||||||
|
var topLevel = App.GetTopLevel();
|
||||||
|
if (topLevel == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var options = new FilePickerSaveOptions();
|
||||||
|
options.Title = App.Text("FileCM.SaveAsPatch");
|
||||||
|
options.DefaultExtension = ".patch";
|
||||||
|
options.FileTypeChoices = [new FilePickerFileType("Patch File") { Patterns = ["*.patch"] }];
|
||||||
|
|
||||||
|
var storageFile = await topLevel.StorageProvider.SaveFilePickerAsync(options);
|
||||||
|
if (storageFile != null)
|
||||||
|
{
|
||||||
|
var succ = await Task.Run(() => Commands.SaveChangesAsPatch.Exec(_repo.FullPath, changes, true, storageFile.Path.LocalPath));
|
||||||
|
if (succ)
|
||||||
|
App.SendNotification(_repo.FullPath, App.Text("SaveAsPatchSuccess"));
|
||||||
|
}
|
||||||
|
|
||||||
|
e.Handled = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
var history = new MenuItem();
|
||||||
|
history.Header = App.Text("FileHistory");
|
||||||
|
history.Icon = App.CreateMenuIcon("Icons.Histories");
|
||||||
|
history.Click += (_, e) =>
|
||||||
|
{
|
||||||
|
var window = new Views.FileHistories() { DataContext = new FileHistories(_repo.FullPath, change.Path) };
|
||||||
|
window.Show();
|
||||||
|
e.Handled = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
var assumeUnchanged = new MenuItem();
|
||||||
|
assumeUnchanged.Header = App.Text("FileCM.AssumeUnchanged");
|
||||||
|
assumeUnchanged.Icon = App.CreateMenuIcon("Icons.File.Ignore");
|
||||||
|
assumeUnchanged.IsEnabled = change.WorkTree != Models.ChangeState.Untracked;
|
||||||
|
assumeUnchanged.Click += (_, e) =>
|
||||||
|
{
|
||||||
|
new Commands.AssumeUnchanged(_repo.FullPath).Add(change.Path);
|
||||||
|
e.Handled = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
menu.Items.Add(stage);
|
||||||
|
menu.Items.Add(discard);
|
||||||
|
menu.Items.Add(stash);
|
||||||
|
menu.Items.Add(patch);
|
||||||
|
menu.Items.Add(new MenuItem() { Header = "-" });
|
||||||
|
menu.Items.Add(history);
|
||||||
|
menu.Items.Add(assumeUnchanged);
|
||||||
|
menu.Items.Add(new MenuItem() { Header = "-" });
|
||||||
|
}
|
||||||
|
|
||||||
var copy = new MenuItem();
|
var copy = new MenuItem();
|
||||||
copy.Header = App.Text("CopyPath");
|
copy.Header = App.Text("CopyPath");
|
||||||
copy.Icon = App.CreateMenuIcon("Icons.Copy");
|
copy.Icon = App.CreateMenuIcon("Icons.Copy");
|
||||||
|
@ -592,23 +649,56 @@ namespace SourceGit.ViewModels
|
||||||
{
|
{
|
||||||
App.CopyText(change.Path);
|
App.CopyText(change.Path);
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
menu.Items.Add(explore);
|
|
||||||
menu.Items.Add(openWith);
|
|
||||||
menu.Items.Add(new MenuItem() { Header = "-" });
|
|
||||||
menu.Items.Add(stage);
|
|
||||||
menu.Items.Add(discard);
|
|
||||||
menu.Items.Add(stash);
|
|
||||||
menu.Items.Add(patch);
|
|
||||||
menu.Items.Add(new MenuItem() { Header = "-" });
|
|
||||||
menu.Items.Add(history);
|
|
||||||
menu.Items.Add(assumeUnchanged);
|
|
||||||
menu.Items.Add(new MenuItem() { Header = "-" });
|
|
||||||
menu.Items.Add(copy);
|
menu.Items.Add(copy);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
var hasConflicts = false;
|
||||||
|
var hasNoneConflicts = false;
|
||||||
|
foreach (var change in changes)
|
||||||
|
{
|
||||||
|
if (change.IsConflit)
|
||||||
|
{
|
||||||
|
hasConflicts = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hasNoneConflicts = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasConflicts)
|
||||||
|
{
|
||||||
|
if (hasNoneConflicts)
|
||||||
|
{
|
||||||
|
App.RaiseException(_repo.FullPath, "You have selected both non-conflict changes with conflicts!");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var useTheirs = new MenuItem();
|
||||||
|
useTheirs.Icon = App.CreateMenuIcon("Icons.Incoming");
|
||||||
|
useTheirs.Header = App.Text("FileCM.UseTheirs");
|
||||||
|
useTheirs.Click += (_, e) =>
|
||||||
|
{
|
||||||
|
UseTheirs(changes);
|
||||||
|
e.Handled = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
var useMine = new MenuItem();
|
||||||
|
useMine.Icon = App.CreateMenuIcon("Icons.Local");
|
||||||
|
useMine.Header = App.Text("FileCM.UseMine");
|
||||||
|
useMine.Click += (_, e) =>
|
||||||
|
{
|
||||||
|
UseMine(changes);
|
||||||
|
e.Handled = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
menu.Items.Add(useTheirs);
|
||||||
|
menu.Items.Add(useMine);
|
||||||
|
return menu;
|
||||||
|
}
|
||||||
|
|
||||||
var stage = new MenuItem();
|
var stage = new MenuItem();
|
||||||
stage.Header = App.Text("FileCM.StageMulti", changes.Count);
|
stage.Header = App.Text("FileCM.StageMulti", changes.Count);
|
||||||
stage.Icon = App.CreateMenuIcon("Icons.File.Add");
|
stage.Icon = App.CreateMenuIcon("Icons.File.Add");
|
||||||
|
|
|
@ -296,11 +296,6 @@ namespace SourceGit.Views
|
||||||
if (DataContext is ViewModels.Histories histories)
|
if (DataContext is ViewModels.Histories histories)
|
||||||
{
|
{
|
||||||
histories.Select(commitDataGrid.SelectedItems);
|
histories.Select(commitDataGrid.SelectedItems);
|
||||||
|
|
||||||
if (histories.DetailContext is ViewModels.CommitDetail detail)
|
|
||||||
{
|
|
||||||
commitDataGrid.ScrollIntoView(detail.Commit, null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,21 +184,21 @@
|
||||||
<Grid Grid.Row="3" Background="{DynamicResource Brush.Contents}">
|
<Grid Grid.Row="3" Background="{DynamicResource Brush.Contents}">
|
||||||
<DataGrid x:Name="stagedList"
|
<DataGrid x:Name="stagedList"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
ItemsSource="{Binding Staged}"
|
ItemsSource="{Binding Staged}"
|
||||||
SelectedItem="{Binding SelectedStagedChange, Mode=TwoWay}"
|
SelectedItem="{Binding SelectedStagedChange, Mode=TwoWay}"
|
||||||
SelectionMode="Extended"
|
SelectionMode="Extended"
|
||||||
CanUserReorderColumns="False"
|
CanUserReorderColumns="False"
|
||||||
CanUserResizeColumns="False"
|
CanUserResizeColumns="False"
|
||||||
CanUserSortColumns="False"
|
CanUserSortColumns="False"
|
||||||
IsReadOnly="True"
|
IsReadOnly="True"
|
||||||
HeadersVisibility="None"
|
HeadersVisibility="None"
|
||||||
Focusable="False"
|
Focusable="False"
|
||||||
RowHeight="26"
|
RowHeight="26"
|
||||||
HorizontalScrollBarVisibility="Auto"
|
HorizontalScrollBarVisibility="Auto"
|
||||||
VerticalScrollBarVisibility="Auto"
|
VerticalScrollBarVisibility="Auto"
|
||||||
KeyDown="OnStagedListKeyDown"
|
KeyDown="OnStagedListKeyDown"
|
||||||
ContextRequested="OnStagedListContextRequested"
|
ContextRequested="OnStagedListContextRequested"
|
||||||
IsVisible="{Binding Source={x:Static vm:Preference.Instance}, Path=StagedChangeViewMode, Converter={x:Static c:ChangeViewModeConverters.IsList}}">
|
IsVisible="{Binding Source={x:Static vm:Preference.Instance}, Path=StagedChangeViewMode, Converter={x:Static c:ChangeViewModeConverters.IsList}}">
|
||||||
<DataGrid.Columns>
|
<DataGrid.Columns>
|
||||||
<DataGridTemplateColumn Header="ICON">
|
<DataGridTemplateColumn Header="ICON">
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
@ -319,12 +319,8 @@
|
||||||
<Border Background="{DynamicResource Brush.Window}" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}">
|
<Border Background="{DynamicResource Brush.Window}" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}">
|
||||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
|
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
<Path Width="64" Height="64" Data="{StaticResource Icons.Conflict}" Fill="{DynamicResource Brush.FG2}"/>
|
<Path Width="64" Height="64" Data="{StaticResource Icons.Conflict}" Fill="{DynamicResource Brush.FG2}"/>
|
||||||
<TextBlock Margin="0,16,0,28" FontSize="20" FontWeight="Bold" Text="{DynamicResource Text.WorkingCopy.Conflicts}" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Center"/>
|
<TextBlock Margin="0,16,0,8" FontSize="20" FontWeight="Bold" Text="{DynamicResource Text.WorkingCopy.Conflicts}" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Center"/>
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
<TextBlock Text="{DynamicResource Text.WorkingCopy.ResolveTip}" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Center"/>
|
||||||
<Button Classes="flat" FontWeight="Regular" Content="{DynamicResource Text.WorkingCopy.UseTheirs}" Height="26" Padding="16,0" Command="{Binding $parent[v:WorkingCopy].DataContext.(vm:WorkingCopy).UseTheirs}"/>
|
|
||||||
<Button Classes="flat" FontWeight="Regular" Content="{DynamicResource Text.WorkingCopy.UseMine}" Height="26" Padding="16,0" Margin="8,0" Command="{Binding $parent[v:WorkingCopy].DataContext.(vm:WorkingCopy).UseMine}"/>
|
|
||||||
<Button Classes="flat" FontWeight="Regular" Content="{DynamicResource Text.WorkingCopy.OpenMerger}" Height="26" Padding="16,0" Command="{Binding $parent[v:WorkingCopy].DataContext.(vm:WorkingCopy).UseExternalMergeTool}"/>
|
|
||||||
</StackPanel>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|
Loading…
Reference in a new issue