[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] possible fix for #714, finally ;-)

From: Benjamin Pflugmann <benjamin-svn-dev_at_pflugmann.de>
Date: 2002-09-21 22:27:08 CEST

Hello.

Now the part I originally intended to work on. For issue #714,
originally named "svn revert on a missing dir should optionally check
out a fresh copy of the dir", the conclusion seemed that an automatic
update is undesired and an error message would be due. I ignored the
possibility about the --force flag for now.

Please advise if the chosen method for returning the error and the
suggested update syntax is acceptable. I am also not sure if the
quotes may be written this way (regarding i18n). Or is there a quoting
function available? Anyhow, the filename should be quoted, because it
may contain special characters and the line is intended to work with
copy&paste.

Ciao,

        Benjamin.

2002-09-21 Benjamin Pflugmann <benjamin-svn-cvs@pflugmann.de>

        * libsvn_wc/adm_ops.c:
        (revert_admin_things): Fix for issue #714: svn revert on deleted
        directories fails silently. Now it still fails, but returns an
        error and suggests the needed svn update command line. Also fixed
        a small doc typo.

Index: subversion/libsvn_wc/adm_ops.c
===================================================================
--- subversion/libsvn_wc/adm_ops.c
+++ subversion/libsvn_wc/adm_ops.c 2002-09-21 22:07:43.000000000 +0200
@@ -998,6 +998,20 @@
   if (name && (strcmp (name, SVN_WC_ENTRY_THIS_DIR) != 0))
     fullpath = svn_path_join (fullpath, name, pool);
 
+ if (entry->kind == svn_node_dir)
+ {
+ SVN_ERR (svn_io_check_path (fullpath, &kind, pool));
+ if (kind != svn_node_dir)
+ {
+ /* When the directory itself is missing in the WC, the WC
+ cannot be reverted, because the base files were part of
+ the missing directory. */
+ err = svn_error_createf (SVN_ERR_UNSUPPORTED_FEATURE, 0, NULL, pool,
+ "try instead: svn update '%s'", fullpath);
+ return revert_error (err, fullpath, "using subcommand", pool);
+ }
+ }
+
   /* Check for prop changes. */
   SVN_ERR (svn_wc_props_modified_p (&modified_p, fullpath, pool));
   if (modified_p)
@@ -1012,7 +1026,7 @@
          file with no props. */
       SVN_ERR (svn_io_check_path (thing, &working_props_kind, pool));
 
- /* If there is a pristing property file, copy it out as the
+ /* If there is a pristine property file, copy it out as the
          working property file, else just remove the working property
          file. */
       SVN_ERR (svn_io_check_path (base_thing, &kind, pool));

  • application/pgp-signature attachment: stored
Received on Sat Sep 21 22:27:51 2002

This is an archived mail posted to the Subversion Dev mailing list.