Index: subversion/include/svn_types.h
===================================================================
--- subversion/include/svn_types.h	(revision 15421)
+++ subversion/include/svn_types.h	(working copy)
@@ -188,31 +188,6 @@
   svn_recursive
 };
 
-
-/** A general subversion directory entry. */
-typedef struct svn_dirent_t
-{
-  /** node kind */
-  svn_node_kind_t kind;
-
-  /** length of file text, or 0 for directories */
-  svn_filesize_t size;
-
-  /** does the node have props? */
-  svn_boolean_t has_props;
-
-  /** last rev in which this node changed */
-  svn_revnum_t created_rev;
-
-  /** time of created_rev (mod-time) */
-  apr_time_t time;
-
-  /** author of created_rev */
-  const char *last_author;
-
-} svn_dirent_t;
-
-
 
 
 /** Keyword substitution.
@@ -458,6 +433,67 @@
 svn_lock_t *
 svn_lock_dup (const svn_lock_t *lock, apr_pool_t *pool);
 
+
+/**
+ * A general subversion directory entry with lock information.
+ *
+ * @since New in 1.3.
+ */
+typedef struct svn_dirent2_t
+{
+  /** node kind */
+  svn_node_kind_t kind;
+
+  /** length of file text, or 0 for directories */
+  svn_filesize_t size;
+
+  /** does the node have props? */
+  svn_boolean_t has_props;
+
+  /** last rev in which this node changed */
+  svn_revnum_t created_rev;
+
+  /** time of created_rev (mod-time) */
+  apr_time_t time;
+
+  /** author of created_rev */
+  const char *last_author;
+
+  /** repository lock details, if present or NULL */
+  svn_lock_t *lock;
+
+} svn_dirent2_t;
+
+
+/**
+ * Similar to @c svn_dirent2_t except that @svn_dirent_t give only
+ * subversion directory entry.
+ *
+ * @deprecated Provided for backward compatibility with the 1.2 API.
+ */
+typedef struct svn_dirent_t
+{
+  /** node kind */
+  svn_node_kind_t kind;
+
+  /** length of file text, or 0 for directories */
+  svn_filesize_t size;
+
+  /** does the node have props? */
+  svn_boolean_t has_props;
+
+  /** last rev in which this node changed */
+  svn_revnum_t created_rev;
+
+  /** time of created_rev (mod-time) */
+  apr_time_t time;
+
+  /** author of created_rev */
+  const char *last_author;
+
+} svn_dirent_t;
+
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
Index: subversion/libsvn_client/ls.c
===================================================================
--- subversion/libsvn_client/ls.c	(revision 15421)
+++ subversion/libsvn_client/ls.c	(working copy)
@@ -75,7 +75,7 @@
                 const char *path_or_url,
                 const svn_opt_revision_t *peg_revision,
                 const svn_opt_revision_t *revision,
-                svn_boolean_t recurse,               
+                svn_boolean_t recurse,
                 svn_client_ctx_t *ctx,
                 apr_pool_t *pool)
 {
@@ -83,14 +83,18 @@
   svn_revnum_t rev;
   svn_node_kind_t url_kind;
   const char *url;
+  apr_hash_t *locks;
+  apr_hash_index_t *hi;
+  apr_hash_index_t *hl;
 
+
   /* Get an RA plugin for this filesystem object. */
   SVN_ERR (svn_client__ra_session_from_path (&ra_session, &rev,
                                              &url, path_or_url, peg_revision,
                                              revision, ctx, pool));
 
   /* Decide if the URL is a file or directory. */
-  SVN_ERR (svn_ra_check_path (ra_session, "", rev, &url_kind, pool));
+  svn_ra_check_path (ra_session, "", rev, &url_kind, pool);
 
   if (url_kind == svn_node_dir)
     {
@@ -135,6 +139,48 @@
                               _("URL '%s' non-existent in that revision"),
                               url);
 
+  /* Get Lock entries in to the hash. */
+  svn_ra_get_locks (ra_session, &locks, "", pool);
+
+  for (hi = apr_hash_first (pool, *dirents); hi; hi = apr_hash_next (hi))
+    {
+      const void *key;
+      void *val;
+      const char *bname;
+      svn_dirent_t *entry;
+      svn_dirent2_t *newent;
+
+      apr_hash_this (hi, &key, NULL, &val);
+      bname = key;
+      entry = val;
+
+      newent = apr_pcalloc (pool, sizeof(*newent));
+      memcpy (newent, entry, sizeof (*entry));
+
+      /* Traverse through locks hash. */ 
+      for (hl = apr_hash_first (pool, locks); hl; hl = apr_hash_next (hl))
+        {
+          const void *kkey;
+          void *vval;
+          const char *lockon;
+
+          apr_hash_this (hl, &kkey, NULL, &vval);
+          lockon = kkey;
+
+          if (strlen (bname) >= strlen(lockon))
+            continue;
+
+          if (strcasecmp (&lockon[strlen(lockon)-strlen(bname)], bname) == 0)
+            {
+              newent->lock = vval;
+              break;
+            }
+
+        }
+
+      apr_hash_set (*dirents, bname, APR_HASH_KEY_STRING, newent);
+    }
+
   return SVN_NO_ERROR;
 }
 
Index: subversion/clients/cmdline/ls-cmd.c
===================================================================
--- subversion/clients/cmdline/ls-cmd.c	(revision 15421)
+++ subversion/clients/cmdline/ls-cmd.c	(working copy)
@@ -50,7 +50,8 @@
   for (i = 0; i < array->nelts; ++i)
     {
       const char *utf8_entryname;
-      svn_dirent_t *dirent;
+      svn_dirent2_t *dirent;
+      svn_lock_t *lock;
       svn_sort__item_t *item;
 
       svn_pool_clear (subpool);
@@ -63,15 +64,15 @@
       utf8_entryname = item->key;
 
       dirent = apr_hash_get (dirents, utf8_entryname, item->klen);
-
+      lock = dirent->lock;
       if (verbose)
         {
           apr_time_t now = apr_time_now();
           apr_time_exp_t exp_time;
           apr_status_t apr_err;
           apr_size_t size;
-          char timestr[20];
-          const char *sizestr, *utf8_timestr;
+          char timestr[20], lock_timestr[20];
+          const char *sizestr, *utf8_timestr, *utf8_lock_timestr;
           
           /* svn_time_to_human_cstring gives us something *way* too long
              to use for this, so we have to roll our own.  We include
@@ -98,13 +99,42 @@
 
           sizestr = apr_psprintf (subpool, "%" SVN_FILESIZE_T_FMT,
                                   dirent->size);
+          if (lock)
+            {
+               apr_time_exp_lt (&exp_time, lock->creation_date);
+               if (apr_time_sec
+                    (now - lock->creation_date) < (365 * 86400 / 2)
+                   && apr_time_sec
+                    (lock->creation_date - now) < (365 * 86400 / 2))
+                 {
+                   apr_err = apr_strftime (lock_timestr, &size,
+                                           sizeof (lock_timestr),
+                                           "%b %d %H:%M", &exp_time);
+                 }
+               else
+                 {
+                   apr_err = apr_strftime (lock_timestr, &size,
+                                           sizeof (timestr),
+                                           "%b %d  %Y", &exp_time);
+                 }
 
+               /* if that failed, just zero out the string and print nothing */
+               if (apr_err)
+                 lock_timestr[0] = '\0';
+
+              /* we need it in UTF-8. */
+              SVN_ERR (svn_utf_cstring_to_utf8
+                         (&utf8_lock_timestr, lock_timestr, subpool));
+            }
+
           SVN_ERR (svn_cmdline_printf
-                   (subpool, "%7ld %-8.8s %10s %12s %s%s\n",
+                   (subpool, "%7ld %-12s %10s %12s %-12s %12s %s%s\n",
                     dirent->created_rev,
                     dirent->last_author ? dirent->last_author : " ? ",
                     (dirent->kind == svn_node_file) ? sizestr : "",
                     utf8_timestr,
+                    lock ? lock->owner : "",
+                    lock ? utf8_lock_timestr : "",
                     utf8_entryname,
                     (dirent->kind == svn_node_dir) ? "/" : ""));
         }
@@ -177,8 +207,9 @@
     {
       svn_stringbuf_t *sb;
       const char *utf8_entryname;
-      svn_dirent_t *dirent;
+      svn_dirent2_t *dirent;
       svn_sort__item_t *item;
+      svn_lock_t* lock;
 
       svn_pool_clear (subpool);
 
@@ -190,6 +221,7 @@
       utf8_entryname = item->key;
 
       dirent = apr_hash_get (dirents, utf8_entryname, item->klen);
+      lock = dirent->lock;
 
       sb = svn_stringbuf_create ("", subpool);
 
@@ -238,6 +270,49 @@
       /* "</commit>" */
       svn_xml_make_close_tag (&sb, subpool, "commit");
 
+      /* "<lock>" */
+      if (lock)
+        {
+          svn_xml_make_open_tag (&sb, pool, svn_xml_normal, "lock", NULL);
+
+          svn_xml_make_open_tag (&sb, pool, svn_xml_protect_pcdata,
+                                 "token", NULL);
+          svn_xml_escape_cdata_cstring (&sb, lock->token, pool);
+          svn_xml_make_close_tag (&sb, pool, "token");
+
+          svn_xml_make_open_tag (&sb, pool, svn_xml_protect_pcdata,
+                                 "owner", NULL);
+          svn_xml_escape_cdata_cstring (&sb, lock->owner, pool);
+          svn_xml_make_close_tag (&sb, pool, "owner");
+
+          if (lock->comment)
+            {
+              svn_xml_make_open_tag (&sb, pool, svn_xml_normal,
+                                     "comment", NULL);
+              svn_xml_escape_cdata_cstring (&sb, lock->comment, pool);
+              svn_xml_make_close_tag (&sb, pool, "comment");
+            }
+
+          svn_xml_make_open_tag (&sb, pool, svn_xml_protect_pcdata,
+                                 "created", NULL);
+          svn_xml_escape_cdata_cstring (&sb, svn_time_to_cstring
+                                        (lock->creation_date, pool),
+                                        pool);
+          svn_xml_make_close_tag (&sb, pool, "created");
+
+          if (lock->expiration_date != 0)
+            {
+              svn_xml_make_open_tag (&sb, pool, svn_xml_protect_pcdata,
+                                     "expires", NULL);
+              svn_xml_escape_cdata_cstring (&sb, svn_time_to_cstring
+                                            (lock->expiration_date, pool),
+                                            pool);
+              svn_xml_make_close_tag (&sb, pool, "expires");
+            }
+
+          /* "<lock>" */
+          svn_xml_make_close_tag (&sb, subpool, "lock");
+        }
       /* "</entry>" */
       svn_xml_make_close_tag (&sb, subpool, "entry");
 
Index: subversion/clients/cmdline/main.c
===================================================================
--- subversion/clients/cmdline/main.c	(revision 15421)
+++ subversion/clients/cmdline/main.c	(working copy)
@@ -389,12 +389,14 @@
        "current\n"
        "  working directory.\n"
        "\n"
-       "  With --verbose, the following fields show the status of the item:\n"
+       "  With --verbose, the following fields will be shown for each item:\n"
        "\n"
        "    Revision number of the last commit\n"
        "    Author of the last commit\n"
        "    Size (in bytes)\n"
-       "    Date and time of the last commit\n"),
+       "    Date and time of the last commit\n"
+       "    Date and time of the lock creation\n"
+       "    Owner of the lock\n"),
     {'r', 'v', 'R', svn_cl__incremental_opt, svn_cl__xml_opt,
      SVN_CL__AUTH_OPTIONS, svn_cl__config_dir_opt} },
   
Index: subversion/clients/cmdline/dtd/list.dtd
===================================================================
--- subversion/clients/cmdline/dtd/list.dtd	(revision 15421)
+++ subversion/clients/cmdline/dtd/list.dtd	(working copy)
@@ -8,9 +8,16 @@
 <!ELEMENT lists (list+)>
 <!ELEMENT list (entry*)>
 <!ATTLIST list path CDATA #REQUIRED>  <!-- local path or URL -->
-<!ELEMENT entry (name, size?, commit)>
+<!ELEMENT entry (name, size?, commit, lock?)>
 <!ATTLIST entry kind (dir | file) #REQUIRED>
 <!ELEMENT name (#PCDATA)>  <!-- name of file or directory -->
 <!ELEMENT size (#PCDATA)>  <!-- file size in bytes: integer -->
 <!ELEMENT commit (author, date)>
 <!ATTLIST commit revision CDATA #REQUIRED>  <!-- revision number: integer -->
+<!-- Lock info stored repos. -->
+<!ELEMENT lock (token, owner, comment?, created, expires?)>
+<!ELEMENT token (#PCDATA)>    <!-- lock token URI -->
+<!ELEMENT owner (#PCDATA)>    <!-- lock owner -->
+<!ELEMENT comment (#PCDATA)>  <!-- lock comment -->
+<!ELEMENT created (#PCDATA)>  <!-- creation date in ISO format -->
+<!ELEMENT expires (#PCDATA)>  <!-- expiration date in ISO format -->


