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

[PATCH] fix for issue #2556: support working copies on the root of a (virtual) drive

From: Lieven Govaerts <lgo_at_mobsol.be>
Date: 2006-08-14 16:34:14 CEST

Hi,

attached patch is a fix for issue #2556:
http://subversion.tigris.org/issues/show_bug.cgi?id=2556.

Windows allows one to create virtual drives to folders. If you map a virtual
drive to a working copy, so the working copy is on the root of that folder,
Subversion will fail updating and committing that working copy. In fact,
this issue is not dependent on using virtual drives, a working copy on the
root of a physical drive or partition will show the same issue.

This patch provides two fixes:
1. Introduce 'X:/' as a syntax for a root folder, on Windows. I've
encapsulated the check whether a path is a root folder in a new function
svn_path_is_root. There's a number of direct comparisons between path and
'/' throughout the code, so I've replaced them with a call to
svn_path_is_root. While my tests point out that it now works correctly, I've
might have missed some.
 
2. Fix an issue where Subversion thinks a working copy on a root path (both
'/' and 'X:/') is switched. I'm pretty sure the old code couldn't work on
unix either, probably no one has ever tested a working copy on '/'?

regards,

Lieven.

[[[
Fix for issue #2556: on Windows, X:/ is a root folder, so whenever we check
for the root folder, check for X:/ too.

* subversion/include/svn_path.h
  (svn_path_is_root): New function declaration.

* subversion/libsvn_subr/path.c
  (svn_path_is_root): New function. Tests for either '/' on all platforms
   or 'X:/' on Windows.
  (is_canonical): 'X:/' syntax on Windows is canonical.
  (svn_path_join): Support the new type of root path on Windows, mostly by
   replacing direct comparisons of path and '/' with a call to
   svn_path_is_root.
  (svn_path_dirname): idem
  (svn_path_basename): idem
  (svn_path_canonicalize): don't strip the trailing slash if the path is
   of the 'X:/' syntax.

* subversion/libsvn_wc/status.c
  (assemble_status): add support for working copies at the root of a
(virtual)
   drive. This is not Windows specific, this code didn't work for working
   copies on '/' either.

* subversion/tests/cmdline/update_tests.py
  (update_wc_on_windows_drive): New test for issue 2556.
  (test_list): add the new test to the list.
]]]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Mon Aug 14 16:35: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.