[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 3826

From: Noorul Islam K M <noorul_at_collab.net>
Date: Wed, 02 Mar 2011 23:04:15 +0530

Please find attached patch for issue 3826. All tests pass using 'make
check'

Log
[[[

Fix for issue 3826. Make svn diff respect absolute paths. Also fix
corresponding test.

* subversion/svn/diff-cmd.c
  (svn_cl__diff): Do not convert absolute path into relative one.

* subversion/tests/cmdline/diff_tests.py
  (diff_abs_localpath_from_wc_folder): Fix test to use correct absolute
    path. Remove XFail marker.

Patch by: Noorul Islam K M <noorul{_AT_}collab.net>
Found by: danielsh
]]]

Index: subversion/tests/cmdline/diff_tests.py
===================================================================
--- subversion/tests/cmdline/diff_tests.py (revision 1076214)
+++ subversion/tests/cmdline/diff_tests.py (working copy)
@@ -3761,7 +3761,6 @@
                                      '-c2', '--git')
   os.chdir(was_cwd)
 
-_at_XFail()
 @Issue(3826)
 def diff_abs_localpath_from_wc_folder(sbox):
   "diff absolute localpath from wc folder"
@@ -3770,9 +3769,10 @@
 
   A_path = os.path.join(wc_dir, 'A')
   B_path = os.path.join(wc_dir, 'A', 'B')
+ B_abspath = os.path.abspath(B_path)
   os.chdir(os.path.abspath(A_path))
   svntest.actions.run_and_verify_svn(None, None, [], 'diff',
- os.path.abspath(B_path))
+ B_abspath)
   
 ########################################################################
 #Run the tests
Index: subversion/svn/diff-cmd.c
===================================================================
--- subversion/svn/diff-cmd.c (revision 1076214)
+++ subversion/svn/diff-cmd.c (working copy)
@@ -324,8 +324,11 @@
             return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
                                      _("Path '%s' not relative to base URLs"),
                                      path);
+ if (! svn_dirent_is_absolute(path))
+ path = svn_relpath_canonicalize(path, iterpool);
+ else
+ path = svn_dirent_canonicalize(path, iterpool);
 
- path = svn_relpath_canonicalize(path, iterpool);
           if (svn_path_is_url(old_target))
             target1 = svn_path_url_add_component2(old_target, path, iterpool);
           else
Received on 2011-03-02 18:35:12 CET

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.