Skip to content

Commit 62c70cf

Browse files
Robert Holtrjmholt
Robert Holt
authored andcommitted
Updates
1 parent 19d9509 commit 62c70cf

File tree

2 files changed

+37
-30
lines changed

2 files changed

+37
-30
lines changed

tools/GitHubTools.psm1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,10 +439,16 @@ function Get-GitCommit
439439
$organization = $originDetails.Organization
440440
$repository = $originDetails.Repository
441441

442+
Wait-Debugger
443+
442444
Write-Verbose "Getting local git commit data"
443445

446+
$null = Exec { git fetch --all }
447+
448+
$lastCommonCommit = Exec { git merge-base $SinceRef $UntilRef }
449+
444450
$format = '%H||%P||%aN||%aE||%s'
445-
$commits = Exec { git --no-pager log "$SinceRef..$UntilRef" --format=$format }
451+
$commits = Exec { git --no-pager log "$lastCommonCommit..$UntilRef" --format=$format }
446452

447453
$irmParams = if ($GitHubToken)
448454
{

tools/changelog/updateChangelog.ps1

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -243,23 +243,7 @@ $psesChangelogSection = Get-GitCommit @psesGetCommitParams |
243243

244244
Write-Host "PSES CHANGELOG:`n`n$psesChangelogSection`n`n"
245245

246-
$cloneLocation = Join-Path ([System.IO.Path]::GetTempPath()) "${psesRepoName}_changelogupdate"
247-
248-
$cloneParams = @{
249-
OriginRemote = "https://github.com/$FromFork/$psesRepoName"
250-
Destination = $cloneLocation
251-
CheckoutBranch = $branchName
252-
CloneBranch = $PsesBaseBranch
253-
Clobber = $true
254-
Remotes = @{ 'upstream' = "https://github.com/$TargetFork/$vscodeRepoName" }
255-
}
256-
Copy-GitRepository @cloneParams -Verbose:$VerbosePreference
257-
258-
UpdateChangelogFile -NewSection $psesChangelogSection -Path "$cloneLocation/$ChangelogName"
259-
260-
Submit-GitChanges -RepositoryLocation $cloneLocation -File $GalleryFileName -Branch $branchName -Message "Update CHANGELOG for $ReleaseName" -Verbose:$VerbosePreference
261-
262-
#endregion
246+
#endregion PSES Changelog
263247

264248
#region vscode-PowerShell Changelog
265249
$psesChangelogPostamble = $psesChangelogSection -split "`n"
@@ -273,7 +257,6 @@ $psExtGetCommitParams = @{
273257
RepositoryPath = $PSExtensionRepositoryPath
274258
Verbose = $VerbosePreference
275259
}
276-
277260
$psextChangelogSection = Get-GitCommit @psExtGetCommitParams |
278261
Get-ChangeInfoFromCommit -GitHubToken $GitHubToken -Verbose:$VerbosePreference |
279262
Skip-IgnoredChange @ignore -Verbose:$VerbosePreference |
@@ -282,28 +265,29 @@ $psextChangelogSection = Get-GitCommit @psExtGetCommitParams |
282265

283266
Write-Host "vscode-PowerShell CHANGELOG:`n`n$psextChangelogSection`n`n"
284267

285-
$cloneLocation = Join-Path ([System.IO.Path]::GetTempPath()) "${vscodeRepoName}_changelogupdate"
268+
#endregion vscode-PowerShell Changelog
269+
270+
#region PRs
271+
272+
return
273+
274+
# PSES PR
275+
$cloneLocation = Join-Path ([System.IO.Path]::GetTempPath()) "${psesRepoName}_changelogupdate"
286276

287277
$cloneParams = @{
288-
OriginRemote = "https://github.com/$FromFork/$vscodeRepoName"
278+
OriginRemote = "https://github.com/$FromFork/$psesRepoName"
289279
Destination = $cloneLocation
290280
CheckoutBranch = $branchName
291-
CloneBranch = $PSExtensionBaseBranch
281+
CloneBranch = $PsesBaseBranch
292282
Clobber = $true
293283
Remotes = @{ 'upstream' = "https://github.com/$TargetFork/$vscodeRepoName" }
294-
PullUpstream = $true
295284
}
296285
Copy-GitRepository @cloneParams -Verbose:$VerbosePreference
297286

298-
UpdateChangelogFile -NewSection $psextChangelogSection -Path "$cloneLocation/$ChangelogName"
299-
300-
Submit-GitChanges -RepositoryLocation $cloneLocation -File $GalleryFileName -Branch $branchName -Message "Update CHANGELOG for $ReleaseName" -Verbose:$VerbosePreference
301-
302-
#endregion vscode-PowerShell Changelog
287+
UpdateChangelogFile -NewSection $psesChangelogSection -Path "$cloneLocation/$ChangelogName"
303288

304-
#region PRs
289+
Submit-GitChanges -RepositoryLocation $cloneLocation -File $GalleryFileName -Branch $branchName -Message "Update CHANGELOG for $PsesReleaseName" -Verbose:$VerbosePreference
305290

306-
# PSES PR
307291
$prParams = @{
308292
Organization = $TargetFork
309293
Repository = $psesRepoName
@@ -316,6 +300,23 @@ $prParams = @{
316300
New-GitHubPR @prParams -Verbose:$VerbosePreference
317301

318302
# vscode-PowerShell PR
303+
$cloneLocation = Join-Path ([System.IO.Path]::GetTempPath()) "${vscodeRepoName}_changelogupdate"
304+
305+
$cloneParams = @{
306+
OriginRemote = "https://github.com/$FromFork/$vscodeRepoName"
307+
Destination = $cloneLocation
308+
CheckoutBranch = $branchName
309+
CloneBranch = $PSExtensionBaseBranch
310+
Clobber = $true
311+
Remotes = @{ 'upstream' = "https://github.com/$TargetFork/$vscodeRepoName" }
312+
PullUpstream = $true
313+
}
314+
Copy-GitRepository @cloneParams -Verbose:$VerbosePreference
315+
316+
UpdateChangelogFile -NewSection $psextChangelogSection -Path "$cloneLocation/$ChangelogName"
317+
318+
Submit-GitChanges -RepositoryLocation $cloneLocation -File $GalleryFileName -Branch $branchName -Message "Update CHANGELOG for $PSExtensionReleaseName" -Verbose:$VerbosePreference
319+
319320
$prParams = @{
320321
Organization = $TargetFork
321322
Repository = $vscodeRepoName

0 commit comments

Comments
 (0)