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

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Tue Nov 5 05:29:11 UTC 2019


Closed by commit rHGa77338d2bdab: automation: avoid '~' 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

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



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


More information about the Mercurial-devel mailing list