Author: jgbutler
Date: Wed Feb 17 18:04:03 2010
New Revision: 911126
URL: http://svn.apache.org/viewvc?rev=911126&view=rev
Log:
[Ibator] Fixes for IBATIS-699 - Overwrite unmergeable XML files if enabled
Modified:
ibatis/java/ibator/trunk/core/ibator-core/doc/ReleaseNotes.txt
ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/api/Ibator.java
Modified: ibatis/java/ibator/trunk/core/ibator-core/doc/ReleaseNotes.txt
URL:
http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/doc/ReleaseNotes.txt?rev=911126&r1=911125&r2=911126&view=diff
==============================================================================
--- ibatis/java/ibator/trunk/core/ibator-core/doc/ReleaseNotes.txt (original)
+++ ibatis/java/ibator/trunk/core/ibator-core/doc/ReleaseNotes.txt Wed Feb 17
18:04:03 2010
@@ -16,6 +16,7 @@
5. Fixed IBATIS-609 - incorrect parsing of Java generic types
6. Fixed spelling error LONCVARCHAR->LONGVARCHAR (thanks Allard)
7. Fixed IBATIS-731 - change name of primary key variable to avoid conflicts
+8. Fixed IBATIS-699 - Overwrite unmergeable XML files if enabled
Enhancements:
1. IBATIS-569 - Make it easier to override IbatorRules in plugins
Modified:
ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/api/Ibator.java
URL:
http://svn.apache.org/viewvc/ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/api/Ibator.java?rev=911126&r1=911125&r2=911126&view=diff
==============================================================================
---
ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/api/Ibator.java
(original)
+++
ibatis/java/ibator/trunk/core/ibator-core/src/main/java/org/apache/ibatis/ibator/api/Ibator.java
Wed Feb 17 18:04:03 2010
@@ -234,6 +234,10 @@
if (targetFile.exists()) {
if (gxf.isMergeable()) {
source = XmlFileMergerJaxp.getMergedSource(gxf,
targetFile);
+ } else if (shellCallback.isOverwriteEnabled()) {
+ source = gxf.getFormattedContent();
+ warnings.add(Messages.getString("Warning.11",
//$NON-NLS-1$
+ targetFile.getAbsolutePath()));
} else {
source = gxf.getFormattedContent();
targetFile = getUniqueFileName(directory,
gxf.getFileName());