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

Ben, question about adm_ops.c:svn_wc_revert

From: Karl Fogel <kfogel_at_newton.ch.collab.net>
Date: 2002-01-25 02:35:05 CET

svn_wc_revert() has this code:

  [...]
  /* Determine if PATH is a WC root. If PATH is a file, it should
     definitely NOT be a WC root. */
  SVN_ERR (svn_wc_is_wc_root (&wc_root, path, pool));
  if (! wc_root)
    {
      /* Split the basename from the parent path. */
      svn_path_split (path, &p_dir, &bname, pool);
      if (svn_path_is_empty (p_dir))
        p_dir = svn_stringbuf_create (".", pool);
    }
  [...]

Based on how `wc_root' is used there and later on, I'm wondering if a
svn_wc_is_wc_root() is the real question the code wants to ask?
Aren't we just trying to find out if `path' is a file or directory,
and if file, do some things that are specific to reverting files?

Here's why I ask: if this should really be a call to
svn_io_node_kind() or something, then svn_wc_is_wc_root() doesn't need
to be called at all in this file... which means its only remaining
calls would be in get_editor.c... which means it could become a
private, static function again.

(Whereas if it's to remain public, it probably doesn't belong in
get_editor.c, but maybe in questions.c or something?)

Not urgent, just curious,
-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:59 2006

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.