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

JavaHL: add a createPatch API

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • trunk
    • 1.6-consider
    • bindings_javahl
    • None

    Description

      It would be helpful to have a specialized JavaHL API for creating a patch. 
      Specifically, we could use an API that lets us specify an array of paths that we
      want diffed, as opposed to just recursively diffing everything.  In Subclipse
      people often want to use the GUI to select a specific set of files to diff.
      
      Given that the API would need an array, it just seems to make sense to focus
      this API on a local diff, and therefore call it createPatch.  This simplifies
      the API a bit since we can remove the revision arguments.  Here is a proposed
      Java signature:
      
      
          /**
           * Create a patch with local modifications
           * @param paths array of local paths to diff
           * @param outFileName file name where difference are written
           * @param recurse traverse into subdirectories
           * @param ignoreAncestry ignore if files are not related
           * @param noDiffDeleted no output on deleted files
           * @param force diff even on binary files
           * @param relativeToDir What local file system path the diff output should
           * be relative to, or <code>null</code> if the output should use absolute
           * paths.
           * @exception ClientException If the operation fails.
           * @since 1.5
           */
          void createPatch(File[] paths, String outFileName, boolean recurse,
                           boolean ignoreAncestry, boolean noDiffDeleted,
                           boolean force, File relativeToDir) throws ClientException;
      
      
      This example uses the File class to emphasize it has to be a local path.  You
      could change it to String if you want.  It also uses the new relativeToDir param
      which is part of issue# 2723.  That could be added later or not at all if that
      issue does not get completed.
      
      The main thing is being able to potentially pass in an array of paths to the API.
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              markphip Mark Phippard
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: