Aller au contenu principal

Mercurial

Traduction Bêta Non Officielle

Cette page a été traduite par PageTurner AI (bêta). Non approuvée officiellement par le projet. Vous avez trouvé une erreur ? Signaler un problème →

Description

Affiche les informations Mercurial lorsque vous êtes dans un dépôt Mercurial. Pour une compatibilité optimale, assurez-vous que votre exécutable hg est à jour (par exemple lorsque les informations de branche ou d'état sont incorrectes).

Exemple de configuration

{
"type": "mercurial",
"style": "powerline",
"powerline_symbol": "",
"foreground": "#193549",
"background": "#ffeb3b",
"options": {
"fetch_status": true,
"native_fallback": false
}
}

Options

Récupération des informations

Comme les appels Mercurial (hg) peuvent ralentir l'expérience du prompt, nous ne récupérons pas les informations par défaut. Vous pouvez définir fetch_status sur true pour activer la récupération d'informations supplémentaires (et peupler le modèle).

NameTypeDefaultDescription
fetch_statusbooleanfalsefetch the local changes
native_fallbackbooleanfalsewhen set to true and hg.exe is not available when inside a WSL2 shared Windows drive, we will fallback to the native hg executable to fetch data. Not all information can be displayed in this case
status_formatsmap[string]stringa key, value map allowing to override how individual status items are displayed. For example, "status_formats": { "Added": "Added: %d" } will display the added count as Added: 1 instead of +1. See the Status section for available overrides

Modèle (info)

modèle par défaut
hg {{.Branch}} {{if .LocalCommitNumber}}({{.LocalCommitNumber}}:{{.ChangeSetIDShort}}){{end}}{{range .Bookmarks }} \uf02e {{.}}{{end}}{{range .Tags}} \uf02b {{.}}{{end}}{{if .Working.Changed}} \uf044 {{ .Working.String }}{{ end }}

Propriétés

NameTypeDescription
.WorkingStatuschanges in the worktree (see below)
.IsTipbooleanCurrent commit is the tip commit
.ChangeSetIDstringThe current local commit number
.ChangeSetIDShortstringThe current local commit number
.Branchstringcurrent branch
.Bookmarks[]stringthe currently checked out revision number
.Tags[]stringthe currently checked out revision number

État

NameTypeDescription
.Untrackedintnumber of files not under version control
.Modifiedintnumber of modified files
.Deletedintnumber of deleted files
.Addedintnumber of added files
.Changedbooleanif the status contains changes or not
.Stringstringa string representation of the changes above

Les modifications locales utilisent la syntaxe suivante :

IconDescription
?Untracked
~Modified
-Deleted
+Added