Author: danielsh
Date: Tue Mar  8 17:41:51 2022
New Revision: 1898739

URL: http://svn.apache.org/viewvc?rev=1898739&view=rev
Log:
On the pristines-on-demand-on-mwf branch: Add the WC format and version to `svn
info`'s other output modes.

This finishes SVN-4884.

* subversion/svn/info-cmd.c
  (print_info_xml,
   print_info): Emit the equivalents of --show-item=wc-version and
     --show-item=wc-compatible-version.

* subversion/svn/schema/info.rnc
  (wc-info): New children wc-compatible-version and wc-format.
  (wc-compatible-version, wc-format): New elements.

Modified:
    subversion/branches/pristines-on-demand-on-mwf/subversion/svn/info-cmd.c
    
subversion/branches/pristines-on-demand-on-mwf/subversion/svn/schema/info.rnc

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/svn/info-cmd.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/svn/info-cmd.c?rev=1898739&r1=1898738&r2=1898739&view=diff
==============================================================================
--- subversion/branches/pristines-on-demand-on-mwf/subversion/svn/info-cmd.c 
(original)
+++ subversion/branches/pristines-on-demand-on-mwf/subversion/svn/info-cmd.c 
Tue Mar  8 17:41:51 2022
@@ -592,6 +592,21 @@ print_info_xml(void *baton,
         svn_cl__xml_tagged_cdata(&sb, pool, "wcroot-abspath",
                                  info->wc_info->wcroot_abspath);
 
+      /* "<wc-compatible-version> xx </wc-compatible-version>" */
+      /* "<wc-format> xx </wc-format>" */
+      if (info->wc_info->wc_format > 0)
+        {
+          const svn_version_t *wc_ver
+            = svn_client_wc_version_from_format(info->wc_info->wc_format, 
pool);
+
+          svn_cl__xml_tagged_cdata(&sb, pool, "wc-compatible-version",
+                                   apr_psprintf(pool, "%d.%d", wc_ver->major,
+                                                wc_ver->minor));
+          svn_cl__xml_tagged_cdata(&sb, pool, "wc-format",
+                                   apr_psprintf(pool, "%d",
+                                                info->wc_info->wc_format));
+        }
+
       /* "<schedule> xx </schedule>" */
       svn_cl__xml_tagged_cdata(&sb, pool, "schedule",
                                schedule_str(info->wc_info->schedule));
@@ -737,6 +752,18 @@ print_info(void *baton,
                                             info->wc_info->wcroot_abspath,
                                             pool)));
 
+  if (info->wc_info && info->wc_info->wc_format > 0)
+    {
+      const svn_version_t *wc_ver
+        = svn_client_wc_version_from_format(info->wc_info->wc_format, pool);
+
+      SVN_ERR(svn_cmdline_printf(pool, _("Working Copy Compatible With 
Version: %d.%d\n"),
+                                 wc_ver->major, wc_ver->minor));
+      SVN_ERR(svn_cmdline_printf(pool, _("Working Copy Format: %d\n"),
+                                 info->wc_info->wc_format));
+    }
+
+
   if (info->URL)
     SVN_ERR(svn_cmdline_printf(pool, _("URL: %s\n"), info->URL));
 

Modified: 
subversion/branches/pristines-on-demand-on-mwf/subversion/svn/schema/info.rnc
URL: 
http://svn.apache.org/viewvc/subversion/branches/pristines-on-demand-on-mwf/subversion/svn/schema/info.rnc?rev=1898739&r1=1898738&r2=1898739&view=diff
==============================================================================
--- 
subversion/branches/pristines-on-demand-on-mwf/subversion/svn/schema/info.rnc 
(original)
+++ 
subversion/branches/pristines-on-demand-on-mwf/subversion/svn/schema/info.rnc 
Tue Mar  8 17:41:51 2022
@@ -57,6 +57,8 @@ uuid = element uuid { uuid.type }
 wc-info =
   element wc-info {
     wcroot-abspath?,
+    wc-compatible-version?,
+    wc-format?,
     schedule?,
     changelist?,
     copy-from-url?,
@@ -70,6 +72,8 @@ wc-info =
   }
 
 wcroot-abspath = element wcroot-abspath { string }
+wc-compatible-version = element wc-compatible-version { string }
+wc-format = element wc-format { xsd:nonNegativeInteger }
 
 schedule =
   element schedule { "normal" | "add" | "delete" | "replace" | "none" }


Reply via email to