Skip to main content

Mercurial

Whatโ€‹

Display Mercurial information when in a Mercurial repository. For maximum compatibility, make sure your hg executable is up-to-date (when branch or status information is incorrect for example).

Sample Configurationโ€‹

{
"type": "mercurial",
"style": "powerline",
"powerline_symbol": "๎‚ฐ",
"foreground": "#193549",
"background": "#ffeb3b",
"properties": {
"newprop": "๎ฟฑ"
}
}

Propertiesโ€‹

Fetching informationโ€‹

As doing Mercurial (hg) calls can slow down the prompt experience, we do not fetch information by default. You can set the following properties to true to enable fetching additional information (and populate the template).

NameTypeDefaultDescription
fetch_statusbooleanfalsefetch the local changes
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

Template (info)โ€‹

default template
hg {{.Branch}} {{if .LocalCommitNumber}}({{.LocalCommitNumber}}:{{.ChangeSetIDShort}}){{end}}{{range .Bookmarks }} \uf02e {{.}}{{end}}{{range .Tags}} \uf02b {{.}}{{end}}{{if .Working.Changed}} \uf044 {{ .Working.String }}{{ end }}

Propertiesโ€‹

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

Statusโ€‹

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

Local changes use the following syntax:

IconDescription
?Untracked
~Modified
-Deleted
+Added