Patchwork [1,of,4,contrib] contrib: run editmergeps.ps1 from the same location as editmergeps.bat

login
register
mail settings
Submitter Kostia Balytskyi
Date May 30, 2017, 1:27 p.m.
Message ID <e11f32343279bb07cba3.1496150878@devvm1416.lla2.facebook.com>
Download mbox | patch
Permalink /patch/21063/
State Accepted
Headers show

Comments

Kostia Balytskyi - May 30, 2017, 1:27 p.m.
# HG changeset patch
# User Kostia Balytskyi <ikostia@fb.com>
# Date 1496149008 25200
#      Tue May 30 05:56:48 2017 -0700
# Node ID e11f32343279bb07cba3e7844a6bbfc1874a065d
# Parent  cf7c88986e9f64926bdf79b04e2777d730cf8cb0
contrib: run editmergeps.ps1 from the same location as editmergeps.bat

This change is needed for cases when user does not put editmergeps.bat
directly into PATH, but rather uses 'merge-tools.editmergeps.executable'
config option to provide a full path to editmergeps.bat. In such cases,
editmergeps.ps1 cannot be run simply by name, it needs a full path. In
BATCH file %~dp0 stands for the directory in which the original file
is located.

Patch

diff --git a/contrib/editmergeps.bat b/contrib/editmergeps.bat
--- a/contrib/editmergeps.bat
+++ b/contrib/editmergeps.bat
@@ -1,2 +1,2 @@ 
 @echo off
-powershell -NoProfile -ExecutionPolicy unrestricted -Command "& 'editmergeps.ps1' %*"
+powershell -NoProfile -ExecutionPolicy unrestricted -Command "& '%~dp0\editmergeps.ps1' %*"