Repository: JanDeDobbeleer/oh-my-posh
Pull request #3245 (2022-12-25 19:25:36)

feat(svn): add counting of untracked files; don't default to counting as "unmerged"
### Prerequisites

- [x] I have read and understood the [contributing guide][CONTRIBUTING.md]
- [x] The commit message follows the [conventional commits][cc] guidelines
- [x] Tests for the changes have been added (for bug fixes/features)
- [x] Docs have been added/updated (for bug fixes/features)

### Description
Implements #3242

<!--TemplateBody-->

<!---

Tips:

If you're not comfortable with working with Git, we're working a guide (https://ohmyposh.dev/docs/contributing_git) to help you out.
Oh My Posh advises GitKraken (https://www.gitkraken.com/invite/nQmDPR9D) as your preferred cross platform Git GUI power tool.

-->

[CONTRIBUTING.md]: https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/CONTRIBUTING.md
[cc]: https://www.conventionalcommits.org/en/v1.0.0/#summary


mjcarman: Implements #3242

Patch:
diff --git a/src/segments/svn.go b/src/segments/svn.go
index 4d6fd71f..56eb8661 100644
--- a/src/segments/svn.go
+++ b/src/segments/svn.go
@@ -13,6 +13,8 @@ type SvnStatus struct {
 
 func (s *SvnStatus) add(code string) {
 	switch code {
+	case "?":
+		s.Untracked++
 	case "C":
 		s.Conflicted++
 	case "D":
@@ -21,10 +23,8 @@ func (s *SvnStatus) add(code string) {
 		s.Added++
 	case "M":
 		s.Modified++
-	case "R":
+	case "R", "!":
 		s.Moved++
-	default:
-		s.Unmerged++
 	}
 }
 
diff --git a/website/docs/segments/svn.mdx b/website/docs/segments/svn.mdx
index c54057a9..4a1d8e1d 100644
--- a/website/docs/segments/svn.mdx
+++ b/website/docs/segments/svn.mdx
@@ -58,6 +58,7 @@ You can set the following properties to `true` to enable fetching additional inf
 
 | Name            | Type      | Description                                    |
 | --------------- | --------- | ---------------------------------------------- |
+| `.Untracked`    | `int`     | number of files not under version control      |
 | `.Modified`     | `int`     | number of modified files                       |
 | `.Deleted`      | `int`     | number of deleted files                        |
 | `.Added`        | `int`     | number of added files                          |
@@ -71,6 +72,7 @@ Local changes use the following syntax:
 
 | Icon | Description |
 | ---- | ----------- |
+| `?`  | untracked   |
 | `+`  | added       |
 | `!`  | conflicted  |
 | `-`  | deleted     |


Test patch:
diff --git a/src/segments/svn_test.go b/src/segments/svn_test.go
index fdc5e7e7..f2696ff0 100644
--- a/src/segments/svn_test.go
+++ b/src/segments/svn_test.go
@@ -58,13 +58,14 @@ func TestSvnTemplateString(t *testing.T) {
 	}{
 		{
 			Case:     "Default template",
-			Expected: "\ue0a0trunk r2 +2 ~3 -7 >13 x5 !1",
+			Expected: "\ue0a0trunk r2 ?9 +2 ~3 -7 >13 x5 !1",
 			Template: " \ue0a0{{.Branch}} r{{.BaseRev}} {{.Working.String}} ",
 			Svn: &Svn{
 				Branch:  "trunk",
 				BaseRev: 2,
 				Working: &SvnStatus{
 					ScmStatus: ScmStatus{
+						Untracked:  9,
 						Added:      2,
 						Conflicted: 1,
 						Deleted:    7,
@@ -175,23 +176,27 @@ func TestSetSvnStatus(t *testing.T) {
 		{
 			Case: "changed",
 			StatusOutput: `
-!       Untracked.File
+?       Untracked.File
+!       Missing.File
 A       FileHasBeen.Added
 D       FileMarkedAs.Deleted
 M       Modified.File
+C       Conflicted.File
 R       Moved.File`,
 			ExpectedWorking: &SvnStatus{ScmStatus: ScmStatus{
-				Modified: 1,
-				Added:    1,
-				Deleted:  1,
-				Unmerged: 1,
-				Moved:    1,
+				Modified:   1,
+				Added:      1,
+				Deleted:    1,
+				Moved:      2,
+				Untracked:  1,
+				Conflicted: 1,
 			}},
-			RefOutput:       "1133",
-			ExpectedRef:     1133,
-			BranchOutput:    "^/trunk",
-			ExpectedBranch:  "trunk",
-			ExpectedChanged: true,
+			RefOutput:         "1133",
+			ExpectedRef:       1133,
+			BranchOutput:      "^/trunk",
+			ExpectedBranch:    "trunk",
+			ExpectedChanged:   true,
+			ExpectedConflicts: true,
 		},
 		{
 			Case:         "conflict",