From sa2c@sa2c.net  Fri Nov 24 11:43:57 2006
Return-Path: <sa2c@sa2c.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id E824216A415
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 24 Nov 2006 11:43:56 +0000 (UTC)
	(envelope-from sa2c@sa2c.net)
Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.182])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 867D943D49
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 24 Nov 2006 11:43:14 +0000 (GMT)
	(envelope-from sa2c@sa2c.net)
Received: by py-out-1112.google.com with SMTP id f31so481320pyh
        for <FreeBSD-gnats-submit@freebsd.org>; Fri, 24 Nov 2006 03:43:55 -0800 (PST)
Received: by 10.35.96.7 with SMTP id y7mr5660640pyl.1164368634438;
        Fri, 24 Nov 2006 03:43:54 -0800 (PST)
Received: from berkeley.l.sa2c.net ( [125.192.101.90])
        by mx.google.com with ESMTP id n67sm9242623pyh.2006.11.24.03.43.53;
        Fri, 24 Nov 2006 03:43:54 -0800 (PST)
Received: by berkeley.l.sa2c.net (Postfix, from userid 3104)
	id E333240E4; Fri, 24 Nov 2006 20:43:45 +0900 (JST)
Message-Id: <20061124114345.E333240E4@berkeley.l.sa2c.net>
Date: Fri, 24 Nov 2006 20:43:45 +0900 (JST)
From: NIIMI Satoshi <sa2c@sa2c.net>
Reply-To: NIIMI Satoshi <sa2c@sa2c.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: devel/mercurial: hgmerge does not work
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         105813
>Category:       ports
>Synopsis:       devel/mercurial: hgmerge does not work
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    roberto
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 24 11:50:04 GMT 2006
>Closed-Date:    Tue Oct 02 19:13:57 GMT 2007
>Last-Modified:  Tue Oct 02 19:13:57 GMT 2007
>Originator:     NIIMI Satoshi
>Release:        FreeBSD 6.1-RELEASE-p10 i386
>Organization:
>Environment:
System: FreeBSD berkeley.l.sa2c.net 6.1-RELEASE-p10 FreeBSD 6.1-RELEASE-p10 #17: Sun Oct 1 13:00:54 JST 2006 root@berkeley.l.sa2c.net:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:

Unlike bash and ksh, FreeBSD's /bin/sh behaves:

| % sh -c 'type /nonexistent; echo $?'
| /nonexistent: No such file or directory
| 0

Because of above, testing "/Developer/.../FileMerge" and
"/usr/bin/test" always succeeds and they are used unconditionally.

	
>How-To-Repeat:
Run "hg merge" with clean ~/.hgrc and HGMERGE environment variable.
	
>Fix:

	

--- mercurial.diff begins here ---
--- devel/mercurial/Makefile	Thu Nov 23 16:44:43 2006 +0000
+++ devel/mercurial/Makefile	Fri Nov 24 05:55:36 2006 +0900
@@ -7,6 +7,7 @@
 
 PORTNAME=	mercurial
 PORTVERSION=	0.9.1
+PORTREVISION=	1
 CATEGORIES=	devel python
 MASTER_SITES=	http://www.selenic.com/mercurial/release/
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ devel/mercurial/files/patch-hgmerge	Fri Nov 24 05:48:06 2006 +0900
@@ -0,0 +1,63 @@
+--- hgmerge	Tue Nov 21 23:08:29 2006 -0200
++++ hgmerge	Fri Nov 24 05:27:38 2006 +0900
+@@ -20,6 +20,18 @@ if [ -z "$EDITOR" ]; then
+ if [ -z "$EDITOR" ]; then
+     EDITOR="vi"
+ fi
++
++isexecutable ()
++{
++    case "$1" in
++        */*)
++            [ -x "$1" ] && return 0 || return 1
++            ;;
++        *)
++            type "$1" >/dev/null 2>&1 && return 0 || return 1
++            ;;
++    esac
++}
+ 
+ # find decent versions of our utilities, insisting on the GNU versions where we
+ # need to
+@@ -28,13 +40,13 @@ DIFF="gdiff"
+ DIFF="gdiff"
+ PATCH="gpatch"
+ 
+-type "$MERGE" >/dev/null 2>&1 || MERGE=
+-type "$DIFF3" >/dev/null 2>&1 || DIFF3="diff3"
++isexecutable "$MERGE" || MERGE=
++isexecutable "$DIFF3" || DIFF3="diff3"
+ $DIFF3 --version >/dev/null 2>&1 || DIFF3=
+-type "$DIFF"  >/dev/null 2>&1 || DIFF="diff"
+-type "$DIFF"  >/dev/null 2>&1 || DIFF=
+-type "$PATCH" >/dev/null 2>&1 || PATCH="patch"
+-type "$PATCH" >/dev/null 2>&1 || PATCH=
++isexecutable "$DIFF"  || DIFF="diff"
++isexecutable "$DIFF"  || DIFF=
++isexecutable "$PATCH" || PATCH="patch"
++isexecutable "$PATCH" || PATCH=
+ 
+ # find optional visual utilities
+ FILEMERGE="/Developer/Applications/Utilities/FileMerge.app/Contents/MacOS/FileMerge"
+@@ -42,15 +54,15 @@ TKDIFF="tkdiff"
+ TKDIFF="tkdiff"
+ MELD="meld"
+ 
+-type "$FILEMERGE" >/dev/null 2>&1 || FILEMERGE=
+-type "$KDIFF3"    >/dev/null 2>&1 || KDIFF3=
+-type "$TKDIFF"    >/dev/null 2>&1 || TKDIFF=
+-type "$MELD"      >/dev/null 2>&1 || MELD=
++isexecutable "$FILEMERGE" || FILEMERGE=
++isexecutable "$KDIFF3"    || KDIFF3=
++isexecutable "$TKDIFF"    || TKDIFF=
++isexecutable "$MELD"      || MELD=
+ 
+ # Hack for Solaris
+ TEST="/usr/bin/test"
+-type "$TEST" >/dev/null 2>&1 || TEST="/bin/test"
+-type "$TEST" >/dev/null 2>&1 || TEST="test"
++isexecutable "$TEST" || TEST="/bin/test"
++isexecutable "$TEST" || TEST="test"
+ 
+ # random part of names
+ RAND="$RANDOM$RANDOM"
--- mercurial.diff ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->roberto 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Fri Nov 24 11:50:15 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=105813 

From: NIIMI Satoshi <sa2c@sa2c.net>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/105813: devel/mercurial: hgmerge does not work
Date: Wed, 03 Oct 2007 02:45:13 +0900

 Please close this PR.
 
 The problem was fixed by:
 http://lists.freebsd.org/pipermail/cvs-ports/2007-October/135557.html
 
 -- 
 NIIMI Satoshi
State-Changed-From-To: open->closed 
State-Changed-By: roberto 
State-Changed-When: Tue Oct 2 19:11:27 UTC 2007 
State-Changed-Why:  
Fixed, see http://lists.freebsd.org/pipermail/cvs-ports/2007-October/135557.html 

http://www.freebsd.org/cgi/query-pr.cgi?pr=105813 
>Unformatted:
