feat(hg_branch): Add support for mercurial topics and find hg root dir (#4771)

* feat(hg_branch): Add support for mercurial topics and find hg root dir

* Fix clippy errors

* Use crate::utils::read_file

* Update config-schema.json

* Extend PathExt to retrieve device ID of Path

* Break hg root search when switching to another device

* Fix clippy and formatting errors

* Update docs/config/README.md

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>

* Update src/modules/utils/path.rs

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>

* Update src/configs/hg_branch.rs

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>

* Update hg_branch description

* Revert to lazy loading, use truncate_text from utils and use fake topic

* Format code and fix clippy error

* Revert to previous test string as topic is optional in the config

* Fix doc formatting

* Stub device_id for windows

* Update config-schema.json

* Update src/modules/hg_branch.rs

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>

* Do not use unwrap in device_id

* Fix formatter error

* Use dev under non linux unixes

Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
This commit is contained in:
Nicolas Évrard
2022-12-31 15:53:55 +01:00
committed by GitHub
parent 8a8e09dd50
commit 8d2256ab1d
6 changed files with 100 additions and 48 deletions
+2 -2
View File
@@ -750,7 +750,7 @@
"hg_branch": {
"default": {
"disabled": true,
"format": "on [$symbol$branch]($style) ",
"format": "on [$symbol$branch(:$topic)]($style) ",
"style": "bold purple",
"symbol": " ",
"truncation_length": 9223372036854775807,
@@ -3537,7 +3537,7 @@
"type": "string"
},
"format": {
"default": "on [$symbol$branch]($style) ",
"default": "on [$symbol$branch(:$topic)]($style) ",
"type": "string"
},
"truncation_length": {