2010-07-30 136 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中已更改。