Permalink
Browse files

Merge pull request #12 from CraigStuntz/master

Make status prefix in prompt configurable. Fixes issue #11.
  • Loading branch information...
2 parents ec2b952 + 489afd1 commit 636235fe18f33717e88b45a2803e3cfb4d82ef53 @JeremySkinner committed Sep 6, 2012
Showing with 14 additions and 6 deletions.
  1. +6 −6 HgPrompt.ps1
  2. +8 −0 Settings.ps1
View
12 HgPrompt.ps1
@@ -22,25 +22,25 @@ function Write-HgStatus($status = (get-hgStatus $global:PoshHgSettings.GetFileSt
Write-Host $status.Branch -NoNewline -BackgroundColor $branchBg -ForegroundColor $branchFg
if($status.Added) {
- Write-Host " +$($status.Added)" -NoNewline -BackgroundColor $s.AddedBackgroundColor -ForegroundColor $s.AddedForegroundColor
+ Write-Host "$($s.AddedStatusPrefix)$($status.Added)" -NoNewline -BackgroundColor $s.AddedBackgroundColor -ForegroundColor $s.AddedForegroundColor
}
if($status.Modified) {
- Write-Host " ~$($status.Modified)" -NoNewline -BackgroundColor $s.ModifiedBackgroundColor -ForegroundColor $s.ModifiedForegroundColor
+ Write-Host "$($s.ModifiedStatusPrefix)$($status.Modified)" -NoNewline -BackgroundColor $s.ModifiedBackgroundColor -ForegroundColor $s.ModifiedForegroundColor
}
if($status.Deleted) {
- Write-Host " -$($status.Deleted)" -NoNewline -BackgroundColor $s.DeletedBackgroundColor -ForegroundColor $s.DeletedForegroundColor
+ Write-Host "$($s.DeletedStatusPrefix)$($status.Deleted)" -NoNewline -BackgroundColor $s.DeletedBackgroundColor -ForegroundColor $s.DeletedForegroundColor
}
if ($status.Untracked) {
- Write-Host " ?$($status.Untracked)" -NoNewline -BackgroundColor $s.UntrackedBackgroundColor -ForegroundColor $s.UntrackedForegroundColor
+ Write-Host "$($s.UntrackedStatusPrefix)$($status.Untracked)" -NoNewline -BackgroundColor $s.UntrackedBackgroundColor -ForegroundColor $s.UntrackedForegroundColor
}
if($status.Missing) {
- Write-Host " !$($status.Missing)" -NoNewline -BackgroundColor $s.MissingBackgroundColor -ForegroundColor $s.MissingForegroundColor
+ Write-Host "$($s.MissingStatusPrefix)$($status.Missing)" -NoNewline -BackgroundColor $s.MissingBackgroundColor -ForegroundColor $s.MissingForegroundColor
}
if($status.Renamed) {
- Write-Host " ^$($status.Renamed)" -NoNewline -BackgroundColor $s.RenamedBackgroundColor -ForegroundColor $s.RenamedForegroundColor
+ Write-Host "$($s.RenamedStatusPrefix)$($status.Renamed)" -NoNewline -BackgroundColor $s.RenamedBackgroundColor -ForegroundColor $s.RenamedForegroundColor
}
if($s.ShowTags -and ($status.Tags.Length -or $status.ActiveBookmark.Length)) {
View
8 Settings.ps1
@@ -54,4 +54,12 @@ $global:PoshHgSettings = New-Object PSObject -Property @{
AppliedPatchBackgroundColor = $Host.UI.RawUI.BackgroundColor
PatchSeparator = ' › '
PatchSeparatorColor = [ConsoleColor]::White
+
+ # Status Count Prefixes for prompt
+ AddedStatusPrefix = ' +'
+ ModifiedStatusPrefix = ' ~'
+ DeletedStatusPrefix = ' -'
+ UntrackedStatusPrefix = ' ?'
+ MissingStatusPrefix = ' !'
+ RenamedStatusPrefix = ' ^'
}

0 comments on commit 636235f

Please sign in to comment.