-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-pub-status.ps1
54 lines (46 loc) · 1.42 KB
/
update-pub-status.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<#
# @fileoverview run as postpublish.
# 1. update defs/which_is_used.txt
# @author PrsPrsBK
#>
Param(
[Parameter(Mandatory = $true)]
[ValidateScript({
if(-Not (Test-Path $_) -Or (Resolve-Path $_).Provider.Name -ne "FileSystem") {
throw "Please specify valid mozilla-xxx repository path : '$_'"
}
return $true
})]
[string]$MozillaRepo,
[Parameter(Mandatory = $true)]
[ValidateScript({
if((Resolve-Path $_).Provider.Name -ne "FileSystem") {
throw "Please specify valid comm repository path : '$_'"
}
return $true
})]
[string]$CommRepo
)
Begin {
Get-Command hg -ErrorAction:Ignore | Out-Null
if($? -eq $false) {
throw "hg does not exist on the PATH."
}
}
Process {
$which_is_used = (Join-Path -Path $PSScriptRoot -ChildPath "defs/which_is_used.txt")
New-Item $which_is_used -ItemType File -Force | Out-Null
Start-Job -ArgumentList $MozillaRepo, $which_is_used -ScriptBlock {
Param($repo, $log)
hg log -l 1 -R $repo --template "mozilla-central changeset: {rev}:{node}" `
| Add-Content $log
} | Wait-Job | Receive-Job | Remove-Job
Start-Job -ArgumentList $CommRepo, $which_is_used -ScriptBlock {
Param($repo, $log)
hg log -l 1 -R $repo --template "comm-central changeset: {rev}:{node}" `
| Add-Content $log
} | Wait-Job | Receive-Job | Remove-Job
}
End {
}
# vim:expandtab ff=dos fenc=utf-8 sw=2