2010-07-30 137 views
0

我有一个Web应用程序,我希望能够创建补丁程序。具体而言,我想创建补丁以启用Web服务器中的特定功能。难以分裂的mercurial修补程序

JAVA_OPTS="-Xms128m -Xmx256m $JAVA_OPTS -Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true " 

# Perm Gen size needs to be increased if encountering OutOfMemoryError: PermGen problems. Specifying PermGen size is not valid on IBM JDKs 
PRGDIR=`dirname $0` 
JIRA_MAX_PERM_SIZE=128m 
if [ -f "${PRGDIR}/permgen.sh" ]; then 
    echo "Detecting JVM PermGen support..." 
. ${PRGDIR}/permgen.sh 
if [ $JAVA_PERMGEN_SUPPORTED = "true" ]; then 
    echo "PermGen switch is supported. Setting to ${JIRA_MAX_PERM_SIZE}" 
    JAVA_OPTS="-XX:MaxPermSize=${JIRA_MAX_PERM_SIZE} ${JAVA_OPTS}" 
    else 
     echo "PermGen switch is NOT supported and will NOT be set automatically." 
    fi 
fi 

# use this if you want to import data without notifications 
#JAVA_OPTS=" -Datlassian.mail.senddisabled=true -Datlassian.mail.fetchdisabled=true -Datlassian.mail.popdisabled=true $JAVA_OPTS " 

export JAVA_OPTS 

echo "If you encounter issues starting up JIRA Standalone Edition, please see the Troubleshooting guide at http://confluence.atlassian.com/display/JIRA/Installation+Troubleshooting+Guide" 

我想要做的就是保存补丁为每个单独的修改我需要这个文件以这样的方式,该补丁可以单独应用(使用qpush -move)或一起(qpush - 一个)

我第一次尝试用干净的版本的文件的以下内容:

hg qnew jmx.patch 

然后我修改该文件的第一行包括以下

-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8089 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false 

然后刷新补丁

hg qrefresh 

的弹出补丁以在第二变形开始从清洁基

hg qpop 
hg qnew jelly.patch 

工作我修改该文件的第一行包括以下

-Djira.jelly.on=true 

然后刷新补丁

当我然后试图qpush旧补丁,它没有申请。 然后我试图另一种方法,这是首先创建一个补丁基:

hg qpop -a 
hg qnew base.patch 

,即添加了以下的文件

JMX_OPTS= 
JELLY_OPTS= 
JAVA_OPTS=" ${JAVA_OPTS} ${JELLY_OPTS} ${JMX_OPTS} " 

,然后刷新base.patch

hg qrefresh 

然后为jmx创建一个新补丁,同时base.patch仍在应用:

hg qnew jmx.new 

编辑如下文件:

JMX_OPTS=" -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8089 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false " 

刷新补丁和流行:

hg qrefresh 
hg qpop 

果冻创建新的补丁:

hg qnew jelly.patch 

编辑的文件,如下所示:

JELLY_OPTS=" -Djira.jelly.on=true " 

更新补丁:

hg qrefresh 

但同样,当我试图qpush新创建的jelly.patch顶部的jmx.patch,有冲突。

我想Mercurial是如预期表现,但我想知道如果我可以构建我做不同的补丁,使他们可以单独应用或组合,而不排斥

回答

1

,如果你在插入你的第二个方法将工作您要更改的行之间至少有3条空行。

你也可以随机洗牌(在qpop!之后),首先应用jmx,然后果冻。你会得到“偏移x行”,但文件将被正确修补。

MQ具有硬编码的模糊编号3(参见patch.py中的patchfile())。如果在相邻行中有JMX_OPTSJELLY_OPTS,则MQ在jmx.patch中找不到上下文,因为它在jelly.patch中已更改。