Index: subversion/svn/cl.h
===================================================================
--- subversion/svn/cl.h	(revision 1505096)
+++ subversion/svn/cl.h	(working copy)
@@ -242,6 +242,7 @@
   svn_boolean_t mergeinfo_log;     /* show log message in mergeinfo command */
   svn_boolean_t remove_unversioned;/* remove unversioned items */
   svn_boolean_t remove_ignored;    /* remove ignored items */
+  svn_boolean_t no_newline;        /* do not output the trailing newline */
 } svn_cl__opt_state_t;
 
 
@@ -289,7 +290,8 @@
   svn_cl__switch,
   svn_cl__unlock,
   svn_cl__update,
-  svn_cl__upgrade;
+  svn_cl__upgrade,
+  svn_cl__youngest;
 
 
 /* See definition in svn.c for documentation. */
Index: subversion/svn/svn.c
===================================================================
--- subversion/svn/svn.c	(revision 1505096)
+++ subversion/svn/svn.c	(working copy)
@@ -394,6 +394,8 @@
 
   {"cl",            opt_changelist, 1, NULL},
 
+  {"no-newline", 'n', 0, N_("do not output the trailing newline")},
+
   {0,               0, 0, 0},
 };
 
@@ -1638,6 +1640,14 @@
      "  Local modifications are preserved.\n"),
     { 'q' } },
 
+  { "youngest", svn_cl__youngest, {0}, N_
+    ("Print the youngest revision number about a local or remote item.\n"
+     "usage: youngest [TARGET]\n"
+     "\n"
+     "  Print the youngest revision number about TARGET (default: '.').\n"
+     "  TARGET may be either a working-copy path or URL.  \n"),
+    { 'n' } },
+
   { NULL, NULL, {0}, NULL, {0} }
 };
 
@@ -1975,6 +1985,9 @@
       case 'q':
         opt_state.quiet = TRUE;
         break;
+      case 'n':
+        opt_state.no_newline = TRUE;
+        break;
       case opt_incremental:
         opt_state.incremental = TRUE;
         break;
Index: subversion/svn/youngest-cmd.c
===================================================================
--- subversion/svn/youngest-cmd.c	(revision 0)
+++ subversion/svn/youngest-cmd.c	(working copy)
@@ -0,0 +1,100 @@
+/*
+ * youngest-cmd.c -- Print the youngest revision number about a resource
+ *
+ * ====================================================================
+ *    Licensed to the Apache Software Foundation (ASF) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The ASF licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
+ */
+
+/* ==================================================================== */
+
+
+
+/*** Includes. ***/
+#include "svn_dirent_uri.h"
+#include "svn_path.h"
+
+#include "cl.h"
+
+#include "svn_private_config.h"
+
+
+/*** Code. ***/
+
+/* This implements the `svn_opt_subcommand_t' interface. */
+svn_error_t *
+svn_cl__youngest(apr_getopt_t *os,
+             void *baton,
+             apr_pool_t *pool)
+{
+  svn_cl__opt_state_t *opt_state = ((svn_cl__cmd_baton_t *) baton)->opt_state;
+  svn_client_ctx_t *ctx = ((svn_cl__cmd_baton_t *) baton)->ctx;
+  apr_array_header_t *targets = NULL;
+  const char *target_path = NULL; /* TARGET path (working copy path or URL) */
+  const char *target_url = NULL; /* TARGET URL */
+  svn_ra_session_t *session;
+  svn_revnum_t latest_revision = SVN_INVALID_REVNUM;
+
+  SVN_ERR(svn_cl__args_to_target_array_print_reserved(&targets, os,
+                                                      opt_state->targets,
+                                                      ctx, FALSE, pool));
+
+  /* Parse the first target into path-or-url. */
+  target_path = APR_ARRAY_IDX(targets, 0, const char *);
+
+  /* If TARGET is omitted, use "." */
+  if( target_path == NULL )
+    {
+	  target_path = ".";
+    }
+
+  if( svn_path_is_url(target_path) )
+    {
+      /* Set Target URL */
+      target_url = target_path;
+    }
+  else
+    {
+      svn_error_t *err;
+      const char *absolute = NULL;
+
+	  /* Convert relative path to absolute path */
+      SVN_ERR( svn_dirent_get_absolute(&absolute, target_path, pool ) );
+	
+	  /* Get full URL from working path */
+      err = svn_client_url_from_path2(&target_url, absolute, ctx, pool, pool);
+	  if (err )
+	    {
+          if (err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
+            {
+              return svn_error_quick_wrap(err, _("Unversioned directory"));
+            }
+		  else
+		    {
+              return svn_error_trace(err);
+		    }
+	    }
+    }
+
+  /* Get HEAD Revisio from URL */
+  SVN_ERR( svn_client_open_ra_session2(&session, target_url, NULL, ctx, pool, pool) );
+  SVN_ERR( svn_ra_get_latest_revnum(session, &latest_revision, pool) );
+  SVN_ERR( svn_cmdline_printf(pool, "%ld%s", latest_revision,
+	  opt_state->no_newline ? "" : "\n") );
+  return SVN_NO_ERROR;
+}

Property changes on: subversion/svn/youngest-cmd.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
