Patchwork D7130: automation: avoid '~' in the temp directory on Windows

login
register
mail settings
Submitter phabricator
Date Nov. 5, 2019, 5:29 a.m.
Message ID <862c140f5a3ad22c38b5bdcd22b7df45@localhost.localdomain>
Download mbox | patch
Permalink /patch/42745/
State Not Applicable
Headers show

Comments

phabricator - Nov. 5, 2019, 5:29 a.m.
Closed by commit rHGa77338d2bdab: automation: avoid &#039;~&#039; in the temp directory on Windows (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7130?vs=17329&id=17550

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7130/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7130

AFFECTED FILES
  contrib/automation/hgautomation/aws.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/contrib/automation/hgautomation/aws.py b/contrib/automation/hgautomation/aws.py
--- a/contrib/automation/hgautomation/aws.py
+++ b/contrib/automation/hgautomation/aws.py
@@ -191,6 +191,10 @@ 
 $Setting = 'LocalAccountTokenFilterPolicy'
 Set-ItemProperty -Path $Key -Name $Setting -Value 1 -Force
 
+# Avoid long usernames in the temp directory path because the '~' causes extra quoting in ssh output
+[System.Environment]::SetEnvironmentVariable('TMP', 'C:\Temp', [System.EnvironmentVariableTarget]::User)
+[System.Environment]::SetEnvironmentVariable('TEMP', 'C:\Temp', [System.EnvironmentVariableTarget]::User)
+
 # Configure and restart the WinRM Service; Enable the required firewall exception
 Stop-Service -Name WinRM
 Set-Service -Name WinRM -StartupType Automatic