Index: subversion/svn/cl.h
===================================================================
--- subversion/svn/cl.h	(revision 1505676)
+++ 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 1505676)
+++ subversion/svn/svn.c	(working copy)
@@ -136,7 +136,8 @@
   opt_search_and,
   opt_mergeinfo_log,
   opt_remove_unversioned,
-  opt_remove_ignored
+  opt_remove_ignored,
+  opt_no_newline
 } svn_cl__longopt_t;
 
 
@@ -394,6 +395,8 @@
 
   {"cl",            opt_changelist, 1, NULL},
 
+  {"no-newline", opt_no_newline, 0, N_("do not output the trailing newline")},
+
   {0,               0, 0, 0},
 };
 
@@ -1638,6 +1641,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"),
+    { opt_no_newline } },
+
   { NULL, NULL, {0}, NULL, {0} }
 };
 
@@ -2314,6 +2325,9 @@
       case opt_remove_ignored:
         opt_state.remove_ignored = TRUE;
         break;
+      case opt_no_newline:
+        opt_state.no_newline = TRUE;
+        break;
       default:
         /* Hmmm. Perhaps this would be a good place to squirrel away
            opts that commands like svn diff might need. Hmmm indeed. */
Index: subversion/svn/youngest-cmd.c
===================================================================
--- subversion/svn/youngest-cmd.c	(revision 0)
+++ subversion/svn/youngest-cmd.c	(working copy)
@@ -0,0 +1,104 @@
+/*
+ * 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));
+
+  /* We want exactly 0 or 1 targets for this subcommand. */
+  if (targets->nelts > 1)
+      return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, 0, NULL);
+
+  /* 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
