Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Support for subrepositories #22

Open
wants to merge 2 commits into from

1 participant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 17 additions and 5 deletions.
  1. +5 −0 HgPrompt.ps1
  2. +4 −1 HgUtils.ps1
  3. +4 −3 README.md
  4. +4 −1 Settings.ps1
View
5 HgPrompt.ps1
@@ -42,6 +42,11 @@ function Write-HgStatus($status = (get-hgStatus $global:PoshHgSettings.GetFileSt
if($status.Renamed) {
Write-Host "$($s.RenamedStatusPrefix)$($status.Renamed)" -NoNewline -BackgroundColor $s.RenamedBackgroundColor -ForegroundColor $s.RenamedForegroundColor
}
+
+ if($status.Subrepos) {
+ Write-Host "$($s.SubreposStatusPrefix)$($status.Subrepos)" -NoNewline -BackgroundColor $s.SubreposBackgroundColor -ForegroundColor $s.SubreposForegroundColor
+ }
+
if($s.ShowTags -and ($status.Tags.Length -or $status.ActiveBookmark.Length)) {
write-host $s.BeforeTagText -NoNewLine
View
5 HgUtils.ps1
@@ -30,6 +30,7 @@ function Get-HgStatus($getFileStatus=$true, $getBookmarkStatus=$true) {
$modified = 0
$deleted = 0
$missing = 0
+ $subrepos = 0
$renamed = 0
$tags = @()
$commit = ""
@@ -74,6 +75,7 @@ function Get-HgStatus($getFileStatus=$true, $getBookmarkStatus=$true) {
'(\d+) deleted' { $missing = $matches[1] }
'(\d+) unknown' { $untracked = $matches[1] }
'(\d+) renamed' { $renamed = $matches[1] }
+ '(\d+) subrepos' { $subrepos = $matches[1] }
}
}
}
@@ -103,7 +105,8 @@ function Get-HgStatus($getFileStatus=$true, $getBookmarkStatus=$true) {
"Behind" = $behind;
"MultipleHeads" = $multipleHeads;
"ActiveBookmark" = $active;
- "Branch" = $branch}
+ "Branch" = $branch;
+ "Subrepos" = $subrepos}
}
}
View
7 README.md
@@ -40,18 +40,19 @@ PowerShell generates its prompt by executing a `prompt` function, if one exists.
By default, the status summary has the following format:
- [{HEAD-name} +A ~B -C ?D !E ^F]
+ [{HEAD-name} +A ~B -C ?D !E ^F subrepos~G]
* `{HEAD-name}` is the current branch, or the SHA of a detached HEAD
* Cyan means the branch matches its remote
* Red means the branch is behind its remote
-* ABCDEF represent the working directory
+* ABCDEFG represent the working directory
* `+` = Added files
* `~` = Modified files
* `-` = Removed files
* `?` = Untracked files
* `!` = Missing files
* `^` = Renamed files
+ * `subrepos~` = Changed subrepositories
Additionally, Posh-Hg can show any tags and bookmarks in the prompt as well as MQ patches if the MQ extension is enabled (disabled by default)
@@ -59,4 +60,4 @@ Additionally, Posh-Hg can show any tags and bookmarks in the prompt as well as M
- Jeremy Skinner, http://www.jeremyskinner.co.uk/
- Keith Dahlby, http://solutionizing.net/
- - Mark Embling, http://www.markembling.info/
+ - Mark Embling, http://www.markembling.info/
View
5 Settings.ps1
@@ -26,7 +26,9 @@ $global:PoshHgSettings = New-Object PSObject -Property @{
# Working directory status
AddedForegroundColor = [ConsoleColor]::Green
AddedBackgroundColor = $Host.UI.RawUI.BackgroundColor
- ModifiedForegroundColor = [ConsoleColor]::Blue
+ SubreposForegroundColor = [ConsoleColor]::Blue
+ SubreposBackgroundColor = $Host.UI.RawUI.BackgroundColor
+ ModifiedForegroundColor = [ConsoleColor]::Blue
ModifiedBackgroundColor = $Host.UI.RawUI.BackgroundColor
DeletedForegroundColor = [ConsoleColor]::Red
DeletedBackgroundColor = $Host.UI.RawUI.BackgroundColor
@@ -62,4 +64,5 @@ $global:PoshHgSettings = New-Object PSObject -Property @{
UntrackedStatusPrefix = ' ?'
MissingStatusPrefix = ' !'
RenamedStatusPrefix = ' ^'
+ SubreposStatusPrefix = ' subrepos~'
}
Something went wrong with that request. Please try again.