Patchwork [1,of,2,contrib,v2] contrib: make editmergeps able to work with Windows GUI editors

login
register
mail settings
Submitter Kostia Balytskyi
Date May 20, 2017, 12:03 a.m.
Message ID <a3098a10073eab5f0930.1495238580@devvm1416.lla2.facebook.com>
Download mbox | patch
Permalink /patch/20748/
State Accepted
Headers show

Comments

Kostia Balytskyi - May 20, 2017, 12:03 a.m.
# HG changeset patch
# User Kostia Balytskyi <ikostia@fb.com>
# Date 1495238455 25200
#      Fri May 19 17:00:55 2017 -0700
# Node ID a3098a10073eab5f0930e6bd6ddce6ba1de5349b
# Parent  2412345e35cc0b17c98e050a480cb4b4f03bd5bb
contrib: make editmergeps able to work with Windows GUI editors

Using Start-Process -Wait makes it wait until the process finishes,
which is necesssary for Windows GUI applications. My short testing
also demonstrated that it does not hurt with command line vim.

Patch

diff --git a/contrib/editmergeps.ps1 b/contrib/editmergeps.ps1
--- a/contrib/editmergeps.ps1
+++ b/contrib/editmergeps.ps1
@@ -46,7 +46,7 @@  if (($ed -eq "vim") -or ($ed -eq "emacs"
   # or the user stops editing the file
   while (($firstline -ne $nil) -and ($firstline -ne $previousline))
   {
-    & "$ed" "+$firstline" "$file"
+    Start-Process -Wait $ed $linearg,$file
     $previousline = $firstline
     $lines = Get-Lines
     $firstline = if ($lines.Length -gt 0) { $lines[0] } else { $nil }