Author: neels
Date: Mon Sep 19 01:37:21 2011
New Revision: 1172411

URL: http://svn.apache.org/viewvc?rev=1172411&view=rev
Log:
Add moved-to/-from to status --xml. (Follow-up to r1157292.)

* subversion/svn/status.c (svn_cl__print_status_xml): 
    Add two attributes '<wc-status moved-from="relpath" moved-to="relpath"/>'.

Modified:
    subversion/trunk/subversion/svn/status.c

Modified: subversion/trunk/subversion/svn/status.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/status.c?rev=1172411&r1=1172410&r2=1172411&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/status.c (original)
+++ subversion/trunk/subversion/svn/status.c Mon Sep 19 01:37:21 2011
@@ -462,6 +462,24 @@ svn_cl__print_status_xml(const char *pat
   if (tree_conflicted)
     apr_hash_set(att_hash, "tree-conflicted", APR_HASH_KEY_STRING,
                  "true");
+  if (status->moved_from_abspath || status->moved_to_abspath)
+    {
+      const char *cwd;
+      const char *relpath;
+      SVN_ERR(svn_dirent_get_absolute(&cwd, "", pool));
+      if (status->moved_from_abspath)
+        {
+          relpath = make_relpath(cwd, status->moved_from_abspath, pool, pool);
+          relpath = svn_dirent_local_style(relpath, pool);
+          apr_hash_set(att_hash, "moved-from", APR_HASH_KEY_STRING, relpath);
+        }
+      if (status->moved_to_abspath)
+        {
+          relpath = make_relpath(cwd, status->moved_to_abspath, pool, pool);
+          relpath = svn_dirent_local_style(relpath, pool);
+          apr_hash_set(att_hash, "moved-to", APR_HASH_KEY_STRING, relpath);
+        }
+    }
   svn_xml_make_open_tag_hash(&sb, pool, svn_xml_normal, "wc-status",
                              att_hash);
 


Reply via email to