subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1683324 - /subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c
Date Wed, 03 Jun 2015 13:28:06 GMT
Author: julianfoad
Date: Wed Jun  3 13:28:05 2015
New Revision: 1683324

URL: http://svn.apache.org/r1683324
Log:
On the 'move-tracking-2' branch: Implement 'svnmover revert'.

* subversion/svnmover/svnmover.c
  (action_code_t,
   action_defn,
   execute): Define the 'revert' command.
  (do_revert): New.

Modified:
    subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c

Modified: subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c?rev=1683324&r1=1683323&r2=1683324&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c (original)
+++ subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c Wed Jun  3 13:28:05
2015
@@ -484,7 +484,8 @@ typedef enum action_code_t {
   ACTION_RM,
   ACTION_COMMIT,
   ACTION_UPDATE,
-  ACTION_STATUS
+  ACTION_STATUS,
+  ACTION_REVERT
 } action_code_t;
 
 typedef struct action_defn_t {
@@ -536,6 +537,8 @@ static const action_defn_t action_defn[]
     "update to revision REV, keeping local changes"},
   {ACTION_STATUS,           "status", 0, "",
     "same as 'diff .@base .'"},
+  {ACTION_REVERT,           "revert", 0, "",
+    "revert all uncommitted changes"},
 };
 
 typedef struct action_t {
@@ -2045,6 +2048,18 @@ do_commit(svnmover_wc_t *wc,
   return SVN_NO_ERROR;
 }
 
+/* Revert all uncommitted changes in WC.
+ */
+static svn_error_t *
+do_revert(svnmover_wc_t *wc,
+          apr_pool_t *scratch_pool)
+{
+  SVN_ERR(wc_checkout(wc, wc->base_revision, scratch_pool));
+  wc->made_changes = FALSE;
+
+  return SVN_NO_ERROR;
+}
+
 typedef struct arg_t
 {
   const char *path_name;
@@ -2502,6 +2517,20 @@ execute(svnmover_wc_t *wc,
           }
           break;
 
+        case ACTION_REVERT:
+          {
+            if (wc->made_changes)
+              {
+                SVN_ERR(do_revert(wc, iterpool));
+                editor = wc->editor;
+              }
+            else
+              {
+                printf("There are no changes to revert.\n");
+              }
+          }
+          break;
+
         default:
           SVN_ERR_MALFUNCTION();
         }



Mime
View raw message