Commit 735cb183 authored by Ludovic Dubost's avatar Ludovic Dubost
Browse files

Added support for attachment date and author formatting

parent 6ab20f65
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>

<!--
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
@@ -302,6 +303,19 @@ public class GitLabGroovy {
          clonedDoc.setVersion("1.1");
        }

        // Update attachment dates
        for (xa in clonedDoc.getAttachmentList()) {
            debug("Checking attachment " + xa.getFilename())
            if (defaultDate &amp;&amp; defaultDate!="") {
               xa.setDate(defaultDate)
            }
            if (withFormat) {
               xa.setAuthor(DEFAULTAUTHOR);
            } else if (defaultUser &amp;&amp; defaultUser!="") {
               xa.setAuthor(defaultUser);
            }
        }

        clonedDoc.setComment("");
        clonedDoc.setMinorEdit(false);
        def c = clonedDoc.toXML(true, false, true, false, context.getContext())