hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r734921 - in /hadoop/core/trunk: ./ src/ src/core/org/apache/hadoop/ src/core/org/apache/hadoop/util/ src/webapps/hdfs/ src/webapps/job/ src/webapps/task/
Date Fri, 16 Jan 2009 06:30:22 GMT
Author: omalley
Date: Thu Jan 15 22:30:21 2009
New Revision: 734921

URL: http://svn.apache.org/viewvc?rev=734921&view=rev
Log:
HADOOP-4794. Add branch information from the source version control into
the version information that is compiled into Hadoop. (cdouglas via 
omalley)

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/core/org/apache/hadoop/HadoopVersionAnnotation.java
    hadoop/core/trunk/src/core/org/apache/hadoop/util/VersionInfo.java
    hadoop/core/trunk/src/saveVersion.sh
    hadoop/core/trunk/src/webapps/hdfs/dfshealth.jsp
    hadoop/core/trunk/src/webapps/job/jobtracker.jsp
    hadoop/core/trunk/src/webapps/task/tasktracker.jsp

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=734921&r1=734920&r2=734921&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Thu Jan 15 22:30:21 2009
@@ -34,6 +34,10 @@
 
     HADOOP-5017. Change NameNode.namesystem declaration to private.  (szetszwo)
 
+    HADOOP-4794. Add branch information from the source version control into
+    the version information that is compiled into Hadoop. (cdouglas via 
+    omalley)
+
   OPTIMIZATIONS
 
   BUG FIXES

Modified: hadoop/core/trunk/src/core/org/apache/hadoop/HadoopVersionAnnotation.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/core/org/apache/hadoop/HadoopVersionAnnotation.java?rev=734921&r1=734920&r2=734921&view=diff
==============================================================================
--- hadoop/core/trunk/src/core/org/apache/hadoop/HadoopVersionAnnotation.java (original)
+++ hadoop/core/trunk/src/core/org/apache/hadoop/HadoopVersionAnnotation.java Thu Jan 15 22:30:21
2009
@@ -53,4 +53,10 @@
    * @return the revision number as a string (eg. "451451")
    */
   String revision();
+
+  /**
+   * Get the branch from which this was compiled.
+   * @return The branch name, e.g. "trunk" or "branches/branch-0.20"
+   */
+  String branch();
 }

Modified: hadoop/core/trunk/src/core/org/apache/hadoop/util/VersionInfo.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/core/org/apache/hadoop/util/VersionInfo.java?rev=734921&r1=734920&r2=734921&view=diff
==============================================================================
--- hadoop/core/trunk/src/core/org/apache/hadoop/util/VersionInfo.java (original)
+++ hadoop/core/trunk/src/core/org/apache/hadoop/util/VersionInfo.java Thu Jan 15 22:30:21
2009
@@ -56,7 +56,15 @@
   public static String getRevision() {
     return version != null ? version.revision() : "Unknown";
   }
-  
+
+  /**
+   * Get the branch on which this originated.
+   * @return The branch name, e.g. "trunk" or "branches/branch-0.20"
+   */
+  public static String getBranch() {
+    return version != null ? version.branch() : "Unknown";
+  }
+
   /**
    * The date that Hadoop was compiled.
    * @return the compilation date in unix date format

Modified: hadoop/core/trunk/src/saveVersion.sh
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/saveVersion.sh?rev=734921&r1=734920&r2=734921&view=diff
==============================================================================
--- hadoop/core/trunk/src/saveVersion.sh (original)
+++ hadoop/core/trunk/src/saveVersion.sh Thu Jan 15 22:30:21 2009
@@ -16,31 +16,41 @@
 # limitations under the License.
 
 
-# This file is used to generate the BuildStamp.java class that
-# records the user, url, revision and timestamp.
+# This file is used to generate the package-info.java class that
+# records the version, revision, branch, user, timestamp, and url
 unset LANG
 unset LC_CTYPE
 version=$1
 user=`whoami`
 date=`date`
+cwd=`pwd`
 if [ -d .git ]; then
   revision=`git log -1 --pretty=format:"%H"`
   hostname=`hostname`
   branch=`git branch | sed -n -e 's/^* //p'`
-  url="git://$hostname/$cwd on branch $branch"
-else
+  url="git://${hostname}${cwd}"
+elif [ -d .svn ]; then
   revision=`svn info | sed -n -e 's/Last Changed Rev: \(.*\)/\1/p'`
   url=`svn info | sed -n -e 's/URL: \(.*\)/\1/p'`
+  # Get canonical branch (branches/X, tags/X, or trunk)
+  branch=`echo $url | sed -n -e 's,.*\(branches/.*\)$,\1,p' \
+                             -e 's,.*\(tags/.*\)$,\1,p' \
+                             -e 's,.*trunk$,trunk,p'`
+else
+  revision="Unknown"
+  branch="Unknown"
+  url="file://$cwd"
 fi
 mkdir -p build/src/org/apache/hadoop
 cat << EOF | \
   sed -e "s/VERSION/$version/" -e "s/USER/$user/" -e "s/DATE/$date/" \
       -e "s|URL|$url|" -e "s/REV/$revision/" \
+      -e "s|BRANCH|$branch|" \
       > build/src/org/apache/hadoop/package-info.java
 /*
  * Generated by src/saveVersion.sh
  */
-@HadoopVersionAnnotation(version="VERSION", revision="REV", 
+@HadoopVersionAnnotation(version="VERSION", revision="REV", branch="BRANCH",
                          user="USER", date="DATE", url="URL")
 package org.apache.hadoop;
 EOF

Modified: hadoop/core/trunk/src/webapps/hdfs/dfshealth.jsp
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/webapps/hdfs/dfshealth.jsp?rev=734921&r1=734920&r2=734921&view=diff
==============================================================================
--- hadoop/core/trunk/src/webapps/hdfs/dfshealth.jsp (original)
+++ hadoop/core/trunk/src/webapps/hdfs/dfshealth.jsp Thu Jan 15 22:30:21 2009
@@ -239,8 +239,8 @@
 
 <div id="dfstable"> <table>	  
 <tr> <td id="col1"> Started: <td> <%= fsn.getStartTime()%>
-<tr> <td id="col1"> Version: <td> <%= VersionInfo.getVersion()%>,
r<%= VersionInfo.getRevision()%>
-<tr> <td id="col1"> Compiled: <td> <%= VersionInfo.getDate()%> by
<%= VersionInfo.getUser()%>
+<tr> <td id="col1"> Version: <td> <%= VersionInfo.getVersion()%>,
<%= VersionInfo.getRevision()%>
+<tr> <td id="col1"> Compiled: <td> <%= VersionInfo.getDate()%> by
<%= VersionInfo.getUser()%> from <%= VersionInfo.getBranch()%>
 <tr> <td id="col1"> Upgrades: <td> <%= jspHelper.getUpgradeStatusText()%>
 </table></div><br>				      
 

Modified: hadoop/core/trunk/src/webapps/job/jobtracker.jsp
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/webapps/job/jobtracker.jsp?rev=734921&r1=734920&r2=734921&view=diff
==============================================================================
--- hadoop/core/trunk/src/webapps/job/jobtracker.jsp (original)
+++ hadoop/core/trunk/src/webapps/job/jobtracker.jsp Thu Jan 15 22:30:21 2009
@@ -85,9 +85,10 @@
 <b>State:</b> <%= status.getJobTrackerState() %><br>
 <b>Started:</b> <%= new Date(tracker.getStartTime())%><br>
 <b>Version:</b> <%= VersionInfo.getVersion()%>,
-                r<%= VersionInfo.getRevision()%><br>
+                <%= VersionInfo.getRevision()%><br>
 <b>Compiled:</b> <%= VersionInfo.getDate()%> by 
-                 <%= VersionInfo.getUser()%><br>
+                 <%= VersionInfo.getUser()%> from
+                 <%= VersionInfo.getBranch()%><br>
 <b>Identifier:</b> <%= tracker.getTrackerIdentifier()%><br>     
           
                    
 <hr>

Modified: hadoop/core/trunk/src/webapps/task/tasktracker.jsp
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/webapps/task/tasktracker.jsp?rev=734921&r1=734920&r2=734921&view=diff
==============================================================================
--- hadoop/core/trunk/src/webapps/task/tasktracker.jsp (original)
+++ hadoop/core/trunk/src/webapps/task/tasktracker.jsp Thu Jan 15 22:30:21 2009
@@ -21,9 +21,10 @@
 <h1><%= trackerName %> Task Tracker Status</h1>
 <img src="/static/hadoop-logo.jpg"/><br>
 <b>Version:</b> <%= VersionInfo.getVersion()%>,
-                r<%= VersionInfo.getRevision()%><br>
+                <%= VersionInfo.getRevision()%><br>
 <b>Compiled:</b> <%= VersionInfo.getDate()%> by 
-                 <%= VersionInfo.getUser()%><br>
+                 <%= VersionInfo.getUser()%> from
+                 <%= VersionInfo.getBranch()%><br>
 
 <h2>Running tasks</h2>
 <center>



Mime
View raw message