[CalendarServer-changes] [211] CalendarServer/trunk/support/submit

source_changes at macosforge.org source_changes at macosforge.org
Wed Sep 27 15:00:21 PDT 2006


Revision: 211
          http://trac.macosforge.org/projects/calendarserver/changeset/211
Author:   wsanchez at apple.com
Date:     2006-09-27 15:00:21 -0700 (Wed, 27 Sep 2006)

Log Message:
-----------
Swap order of version and release arguments.

We don't want to tag submissions in the repository because they aren't
anyone's business (so there!), so instead of tagging, we'll drop an
XML file into the submitted project telling us how to check out the
version that we submitted (URI + revision).

This means the working copy must consist of a single revision, so we
enforce that.

Modified Paths:
--------------
    CalendarServer/trunk/support/submit

Modified: CalendarServer/trunk/support/submit
===================================================================
--- CalendarServer/trunk/support/submit	2006-09-27 20:50:52 UTC (rev 210)
+++ CalendarServer/trunk/support/submit	2006-09-27 22:00:21 UTC (rev 211)
@@ -34,7 +34,7 @@
 
 usage ()
 {
-  program="$(basename "$0")";
+  program="$(basename "$0") version release";
 
   if [ "${1-}" != "-" ]; then echo "$1"; echo; fi;
 
@@ -52,42 +52,44 @@
 done;
 shift $((${OPTIND} - 1));
 
+if [ $# == 0 ]; then usage "No version specified"; fi;
+
+version="$1"; shift;
+
 if [ $# == 0 ]; then usage "No release specified"; fi;
 
 release="$1"; shift;
 
-if [ $# == 0 ]; then usage "No version specified"; fi;
-
-version="$1"; shift;
-
 if [ $# != 0 ]; then usage "Unrecognized arguments:" "$@"; fi;
 
-    tag="CalendarServer-${version}";
-tag_uri="http://macosxserver.apple.com:8000/svn/CalendarServer/tags/${tag}";
+ project="CalendarServer";
+     tag="${project}-${version}";
+     uri="$(svn info "${src}" --xml | sed -n 's|^.*<url>\(.*\)</url>.*$|\1|p')";
+revision="$(svnversion "${src}")";
 
 ##
 # Do the Right Thing
 ##
 
 #
-# Check for pre-existing tag
+# We need a single revision number
 #
-if ! svn ls "${tag_uri}" > /dev/null 2>&1; then
-    #
-    # Make sure changes are checked in.
-    #
-    if [ "$(svn st "${src}" | grep -v support/submit)" != "" ]; then
-        echo "Working copy has uncommitted changes.  Aborting.";
-        exit 1;
-    fi;
-
-    echo "Tagging ${tag}...";
-    svn cp . "${tag_uri}" -m "Tagging ${tag}";
+if [ -n "$(echo "${revision}" | sed 's|[0-9M]||g')" ]; then
+    echo "Working copy has multiple versions of files: ${revision}.  Aborting.";
+    exit 1;
 else
-    echo "Tag ${tag} already exists.";
+    revision="$(echo "${revision}" | sed 's|M$||g')";
 fi;
 
 #
+# Make sure changes are checked in.
+#
+if [ "$(svn st "${src}" | grep -v support/submit)" != "" ]; then
+    echo "Working copy has uncommitted changes.  Aborting.";
+    exit 1;
+fi;
+
+#
 # Do submission
 #
 
@@ -95,13 +97,29 @@
 wc="${tmp}/${tag}";
 
 echo "";
-echo "Exporting ${tag_uri}..."
-svn export "${tag_uri}" "${wc}";
+echo "Exporting ${uri}@${revision}..."
+svn export -r "${revision}" "${uri}@${revision}" "${wc}";
 
 echo ""
 echo "Tweaking for B&I...";
 ln -s support/Makefile.Apple "${wc}/Makefile";
 
+version_file="${wc}/SubmissionInfo.xml";
+cat - >> "${version_file}" <<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<submission>
+ <project>${project}</project>
+ <version>${version}</version>
+ <source>
+  <svn>
+   <uri>${uri}</uri>
+   <revision>${revision}</revision>
+   <date>$(date -u)</date>
+  </svn>
+ </source>
+</submission>
+EOF
+
 echo "";
 echo "Preparing sources...";
 make -C "${wc}" prep;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20060927/962b5a27/attachment.html


More information about the calendarserver-changes mailing list