Author: rfelden
Date: Tue Jun 19 17:42:53 2007
New Revision: 62

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D62&repname=3D=
jahia_upgrade
Log:
fixcreator : merge can also occur when creating a quick fix

Modified:
    trunk/create/fixcreator/src/main/java/org/jahia/fixcreator/controller/M=
yController.java

Modified: trunk/create/fixcreator/src/main/java/org/jahia/fixcreator/contro=
ller/MyController.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/create/fixcreat=
or/src/main/java/org/jahia/fixcreator/controller/MyController.java&rev=3D62=
&repname=3Djahia_upgrade
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/create/fixcreator/src/main/java/org/jahia/fixcreator/controller/M=
yController.java (original)
+++ trunk/create/fixcreator/src/main/java/org/jahia/fixcreator/controller/M=
yController.java Tue Jun 19 17:42:53 2007
@@ -1383,6 +1383,12 @@
                                     } else if (source.getName().equals(fil=
eNameWithoutDotJava)) {
                                         File dest =3D new File(destination=
Dir, source.getName()) ;
                                         result  &=3D Tools.copy(source, de=
st) ;
+
+                                        // copy original properties file a=
long the updated copy if needed
+                                        if (oldVersion !=3D null && oldVer=
sion.exists()) {
+                                            File oldDest =3D new File(dest=
inationDir, source.getName()+".old") ;
+                                            result  &=3D Tools.copy(oldVer=
sion, oldDest) ;
+                                        }
                                     }
 =

                                 }
@@ -1416,9 +1422,15 @@
                                 result  =3D (Tools.copy(source, dest) && r=
esult);
 =

                                 // copy original properties file along the=
 updated copy if needed
-                                if (oldVersion !=3D null && oldVersion.exi=
sts()) {
+                                // or create a blank one to specify keepin=
g old values
+                                if (oldVersion !=3D null) {
                                     File oldDest =3D new File(destinationD=
ir, source.getName()+".old") ;
-                                    result  &=3D Tools.copy(oldVersion, ol=
dDest) ;
+                                    if (oldVersion.exists()) {
+                                        result  &=3D Tools.copy(oldVersion=
, oldDest) ;
+                                    } else {
+                                        result  &=3D oldDest.createNewFile=
() ;
+                                    }
+
                                 }
                             }
                         }
@@ -1451,19 +1463,22 @@
                         result  &=3D Tools.copy(source, dest) ;
 =

                         // copy original properties file along the updated=
 copy if needed
-                        if (oldVersion !=3D null && oldVersion.exists()) {
+                        // or create a blank one to specify keeping old va=
lues
+                        if (oldVersion !=3D null) {
                             File oldDest =3D new File(destinationDir, sour=
ce.getName()+".old") ;
-                            result  &=3D Tools.copy(oldVersion, oldDest) ;
+                            if (oldVersion.exists()) {
+                                result  &=3D Tools.copy(oldVersion, oldDes=
t) ;
+                            } else {
+                                result  &=3D oldDest.createNewFile() ;
+                            }
                         }
                     }
-
                 }
-
             }
-            // if anything failed, notify the user
             assert(MyHTMLTrace.channel(Application.TRACE_CHANNEL).leaveMet=
hod()) ;
             return result ;
-        } catch (FileNotFoundException e) {
+        } catch (IOException e) {
+            // if anything failed, notify the user
             e.printStackTrace();
             assert(MyHTMLTrace.channel(Application.TRACE_CHANNEL).leaveMet=
hod()) ;
             return false ;

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to