[PATCH] contrib: make editmerge look for merge markers at the beginning of the line

Christian Delahousse cdelahousse at fb.com
Fri Oct 16 22:06:46 UTC 2015


# HG changeset patch
# User Christian Delahousse <cdelahousse at fb.com>
# Date 1445032902 25200
#      Fri Oct 16 15:01:42 2015 -0700
# Node ID 2780052831c11e02e2af1e47d4b2e8113b609a8b
# Parent  0c42b6bb23297d369f8c4dbd951df3d99895c9e7
contrib: make editmerge look for merge markers at the beginning of the line

This fix adds a caret to the start of the regex looking for merge markers. This
avoids the issue arises when you've real merge conflicts in a file that tests
for the existance of merge markers in test output. Editmerge will not open on
the fake/tested merge markers because they'll be indented in.

diff --git a/contrib/editmerge b/contrib/editmerge
--- a/contrib/editmerge
+++ b/contrib/editmerge
@@ -13,7 +13,7 @@
 FILE=$1
 
 getlines() {
-  grep -n "<<<<<<" $FILE | cut -f1 -d:
+  grep -n "^<<<<<<" $FILE | cut -f1 -d:
 }
 
 # editor preference loosely based on https://mercurial-scm.org/wiki/editor


More information about the Mercurial-devel mailing list