Uploaded image for project: 'Subversion'
  1. Subversion
  2. SVN-3169

svn_wc_set_changelist should release it's own error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.x
    • 1.5.0
    • libsvn_wc
    • None

    Description

      svn_wc_set_changelist calls its notify func and assumes this notify func knows 
      it must release the error provided to it.
      
      ----- adm_ops.c ------
      if (entry->changelist && changelist && notify_func)
          {
            svn_error_t *unversioned_err =
              svn_error_createf(SVN_ERR_WC_CHANGELIST_MOVE, NULL,
                                _("Removing '%s' from changelist '%s'."),
                                path, entry->changelist);
            notify = svn_wc_create_notify(path, svn_wc_notify_changelist_moved, 
                                          pool);
            notify->err = unversioned_err;
            notify_func(notify_baton, notify, pool);
          }
      --------------
      
      subversion/svn/notify.c does this for this specific case, but the notify 
      handler is part of the public api which does not define this requirement
      
      ----- subversion/svn/notify.c -----
      case svn_wc_notify_changelist_failed:
            svn_handle_warning(stderr, n->err);
            svn_error_clear(n->err);
            break;
      
      case svn_wc_notify_changelist_moved:
            svn_handle_warning(stderr, n->err);
            svn_error_clear(n->err);
            break;
      
      ----- subversion/svn/notify.c -----
      
      The release of the err variable must be moved to the caller. As we can't change 
      all receivers.
      
      BTW. svn_wc_notify_changelist_failed can be removed if we do this before 1.5, 
      as this value is never send to the notify listeners
      

      Attachments

        1. 1_svn_wc_notify-fix.patch
          3 kB
          Bert Huijben
        2. 2_svn_wc_notify-fix.patch
          3 kB
          Bert Huijben

        Activity

          People

            Unassigned Unassigned
            rhuijben Bert Huijben
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: