subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1162033 - in /subversion/trunk/subversion: libsvn_wc/entries.c svn/info-cmd.c tests/cmdline/info_tests.py
Date Fri, 26 Aug 2011 09:06:35 GMT
Author: rhuijben
Date: Fri Aug 26 09:06:34 2011
New Revision: 1162033

URL: http://svn.apache.org/viewvc?rev=1162033&view=rev
Log:
Resolve segfault when retrieving svn_wc_entry_t on a binary conflict. Also
fix a similar segfault in svn on printing conflicts. (Issue #3998)

* subversion/libsvn_wc/entries.c
  (read_one_entry): Assume that conflict paths can be NULL.

* subversion/svn/info-cmd.c
  (print_info): Assume that conflict paths can be NULL. Make conflict paths
    relative if possible.

* subversion/tests/cmdline/info_tests.py
  (binary_tree_conflict): Remove XFail. Add issue number and update the
    conflict path verification to make the test pass. Cleanup whitespace

Modified:
    subversion/trunk/subversion/libsvn_wc/entries.c
    subversion/trunk/subversion/svn/info-cmd.c
    subversion/trunk/subversion/tests/cmdline/info_tests.py

Modified: subversion/trunk/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/entries.c?rev=1162033&r1=1162032&r2=1162033&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/entries.c (original)
+++ subversion/trunk/subversion/libsvn_wc/entries.c Fri Aug 26 09:06:34 2011
@@ -896,12 +896,15 @@ read_one_entry(const svn_wc_entry_t **ne
           switch (cd->kind)
             {
             case svn_wc_conflict_kind_text:
-              entry->conflict_old = svn_dirent_basename(cd->base_abspath,
-                                                        result_pool);
-              entry->conflict_new = svn_dirent_basename(cd->their_abspath,
-                                                        result_pool);
-              entry->conflict_wrk = svn_dirent_basename(cd->my_abspath,
-                                                        result_pool);
+              if (cd->base_abspath)
+                entry->conflict_old = svn_dirent_basename(cd->base_abspath,
+                                                          result_pool);
+              if (cd->their_abspath)
+                entry->conflict_new = svn_dirent_basename(cd->their_abspath,
+                                                          result_pool);
+              if (cd->my_abspath)
+                entry->conflict_wrk = svn_dirent_basename(cd->my_abspath,
+                                                          result_pool);
               break;
             case svn_wc_conflict_kind_property:
               entry->prejfile = svn_dirent_basename(cd->their_abspath,

Modified: subversion/trunk/subversion/svn/info-cmd.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/info-cmd.c?rev=1162033&r1=1162032&r2=1162033&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/info-cmd.c (original)
+++ subversion/trunk/subversion/svn/info-cmd.c Fri Aug 26 09:06:34 2011
@@ -471,20 +471,26 @@ print_info(void *baton,
               switch (conflict->kind)
                 {
                   case svn_wc_conflict_kind_text:
-                    SVN_ERR(svn_cmdline_printf(pool,
-                              _("Conflict Previous Base File: %s\n"),
-                              svn_dirent_local_style(conflict->base_abspath,
-                                                     pool)));
-
-                    SVN_ERR(svn_cmdline_printf(pool,
-                              _("Conflict Previous Working File: %s\n"),
-                              svn_dirent_local_style(conflict->my_abspath,
-                                                     pool)));
-
-                    SVN_ERR(svn_cmdline_printf(pool,
-                              _("Conflict Current Base File: %s\n"),
-                              svn_dirent_local_style(conflict->their_abspath,
-                                                     pool)));
+                    if (conflict->base_abspath)
+                      SVN_ERR(svn_cmdline_printf(pool,
+                                _("Conflict Previous Base File: %s\n"),
+                                svn_cl__local_style_skip_ancestor(
+                                        path_prefix, conflict->base_abspath,
+                                        pool)));
+
+                    if (conflict->my_abspath)
+                      SVN_ERR(svn_cmdline_printf(pool,
+                                _("Conflict Previous Working File: %s\n"),
+                                svn_cl__local_style_skip_ancestor(
+                                        path_prefix, conflict->my_abspath,
+                                        pool)));
+
+                    if (conflict->their_abspath)
+                      SVN_ERR(svn_cmdline_printf(pool,
+                                _("Conflict Current Base File: %s\n"),
+                                svn_cl__local_style_skip_ancestor(
+                                        path_prefix, conflict->their_abspath,
+                                        pool)));
                   break;
 
                   case svn_wc_conflict_kind_property:

Modified: subversion/trunk/subversion/tests/cmdline/info_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/info_tests.py?rev=1162033&r1=1162032&r2=1162033&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/info_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/info_tests.py Fri Aug 26 09:06:34 2011
@@ -480,7 +480,7 @@ def info_show_exclude(sbox):
   # Expect error on iota (unversioned)
   svntest.actions.run_and_verify_svn(None, [], expected_error, 'info', iota)
 
-@XFail()
+@Issue(3998)
 def binary_tree_conflict(sbox):
   "svn info shouldn't crash on conflict"
   sbox.build()
@@ -489,7 +489,6 @@ def binary_tree_conflict(sbox):
   sbox.simple_propset('svn:mime-type', 'binary/octet-stream', 'iota')
   sbox.simple_commit()
 
-
   iota = sbox.ospath('iota')
 
   svntest.main.file_write(iota, 'something-else')
@@ -500,23 +499,19 @@ def binary_tree_conflict(sbox):
   expected_output = svntest.wc.State(wc_dir, {
     'iota' : Item(status='C '),
     })
-
   expected_status = svntest.wc.State(iota, {
     '' : Item(status='C ', wc_rev='2')
   })
-
   svntest.actions.run_and_verify_update(iota,
                                         expected_output, None, expected_status,
-                                        None, None, None, None, None, True,
+                                        None, None, None, None, None, False,
                                         iota, '-r', '2')
 
   expected_info = [{
       'Path' : '%s' % re.escape(iota),
-      # Another issue: we didn't show abspaths here in <= 1.6
-      'Conflict Previous Base File' : re.escape(os.path.abspath(iota + '.r3')),
-      'Conflict Current Base File' : re.escape(os.path.abspath(iota + '.r2')),
+      'Conflict Previous Base File' : re.escape(iota + '.r3'),
+      'Conflict Current Base File' : re.escape(iota + '.r2'),
   }]
-
   svntest.actions.run_and_verify_info(expected_info, iota)
 
 



Mime
View raw message